From 8f5b06f97723604cbb350c9738a9c265fab7af28 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Thu, 29 Aug 2024 11:27:02 +0200 Subject: [PATCH] a11y: Use desktop file name as app's accessible ID As the QGuiApplication::desktopFileName doc [1] says: > This is the file name, without the full path or the > trailing ".desktop" extension of the desktop entry that > represents this application according to the freedesktop > desktop entry specification. Since the desktop entry represents the application, also use the desktop file name for the accessible ID of the application object. This e.g. makes Okular's application object report an accessible ID of "org.kde.okular" instead of just "QApplication" as the AT-SPI2 AccessibleId property on Linux. [1] https://doc.qt.io/qt-6/qguiapplication.html#desktopFileName-prop Change-Id: I554da7baaf817866db9044128f73a9ea634cddbf Reviewed-by: Volker Hilsheimer (cherry picked from commit 13b4075093866a497e620bdd388afaf8aa0bc962) Reviewed-by: Qt Cherry-pick Bot --- src/gui/accessible/qaccessibleobject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp index 61d3a90632f..017c9f82cae 100644 --- a/src/gui/accessible/qaccessibleobject.cpp +++ b/src/gui/accessible/qaccessibleobject.cpp @@ -182,6 +182,8 @@ QString QAccessibleApplication::text(QAccessible::Text t) const return QGuiApplication::applicationName(); case QAccessible::Description: return QGuiApplication::applicationFilePath(); + case QAccessible::Identifier: + return QGuiApplication::desktopFileName(); default: break; }