From 49c966bc8561d1ca71a97b83ae40852233630eb9 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 18 Jul 2022 14:48:51 +0200 Subject: [PATCH] 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ø --- src/gui/accessible/linux/atspiadaptor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/accessible/linux/atspiadaptor.cpp b/src/gui/accessible/linux/atspiadaptor.cpp index ccd75c2eea..6f6583f814 100644 --- a/src/gui/accessible/linux/atspiadaptor.cpp +++ b/src/gui/accessible/linux/atspiadaptor.cpp @@ -1523,11 +1523,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;