From 3e12229c67e6fdf174d1eef8b0f8cc0addd0ff2d 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 Change-Id: I74fae096fd886bab04187c122f268c26c91b86ab Reviewed-by: Tor Arne Vestbø (cherry picked from commit 49c966bc8561d1ca71a97b83ae40852233630eb9) Reviewed-by: Qt Cherry-pick Bot --- 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 ccd75c2eea8..6f6583f814a 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;