Sophie

Sophie

distrib > Mageia > cauldron > x86_64 > media > core-release-src > by-pkgid > 4c532bfb9916518564da5ba2805999f5 > files > 121

qtbase5-5.15.12-3.mga10.src.rpm

From 8c20ad19a13a4b41ccc216d0dc0c333f323beed8 Mon Sep 17 00:00:00 2001
From: Michael Weghorn <m.weghorn@posteo.de>
Date: Mon, 18 Jul 2022 14:48:51 +0200
Subject: [PATCH 123/147] a11y atspi: Take dialog into account as top-level
 window
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since a dialog is also a top-level window, it should be taken
into account when trying to find the accessible's top-level
window, relative to which the position will be calulated for
`ATSPI_COORD_TYPE_WINDOW`.

Fixes: QTBUG-105042
Pick-to: 6.4 6.3 6.2
Change-Id: I74fae096fd886bab04187c122f268c26c91b86ab
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 49c966bc8561d1ca71a97b83ae40852233630eb9)
---
 src/platformsupport/linuxaccessibility/atspiadaptor.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index 174408c86c..564330c27d 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -1606,11 +1606,12 @@ bool AtSpiAdaptor::inheritsQAction(QObject *object)
 // Component
 static QAccessibleInterface * getWindow(QAccessibleInterface * interface)
 {
-    if (interface->role() == QAccessible::Window)
+    if (interface->role() == QAccessible::Dialog || interface->role() == QAccessible::Window)
         return interface;
 
     QAccessibleInterface * parent = interface->parent();
-    while (parent && parent->role() != QAccessible::Window)
+    while (parent && parent->role() != QAccessible::Dialog
+            && parent->role() != QAccessible::Window)
         parent = parent->parent();
 
     return parent;
-- 
2.40.1