Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
dev
-
None
-
Debian testing, qtbase self-compiled from qtbase git dev branch as of commit c5d9e4a7a78b82ed31e5225c169de4718dfe4f05
(original scenario was with the kate text editor in a KDE Neon dev edition gitunstable VM that has Qt 6.6)
-
-
a149b3fd5 (dev), 9cd1b8a28 (6.7), dcdf76ac6 (6.6), 20904f131 (tqtc/lts-6.5)
Description
Programmatically selecting an item in an item view (QTreeView, QListView, QTableView) causes an incorrect accessible focus event for the newly selected item to be sent when the focus is somewhere else. This breaks focus tracking for assistive technology, and thus e.g. makes the Orca screen reader no longer announce events for the actually focused widget.
Sample steps to reproduce:
(s.a. attached screencast)
- apply the attached patch 0001-DEMO-Adjust-widgetgallery-example-to-trigger-a11y-fo.patch to qtbase to adapt the "widgetgallery" example so that toggling the "Simple Input Widgets" checkbox in the example also selects an item in a QTreeView, QTableView and QListView to trigger the issue
- run the Orca screen reader
- build and run the (modified) widgetgallery example
- press the tab key until keyboard focus is on the "Simple Input Widgets" checkbox
- press the space key to toggle the checkbox (uncheck it)
- press the space key again to toggle the checkbox again (check it again)
Actual result:
In step 5, Orca announces the newly selected table view item instead of the new state of the checkbox ("not ticked") In step 6, Orca doesn't announce anything for the checkbox.
This is because incorrect focus events have been sent for the newly selected items on the accessibility (AT-SPI) layer that cause Orca to no longer treat the checkbox as the currently focused object.
Expected result:
In steps 5 and 6, Orca should announce the new state of the checkbox ("not ticked" in step 5, "ticked" in step 6).
Further notes:
The original scenario where I encountered this issue was with the Kate text editor: After creating a new document using Ctrl+N, moving the cursor around in the document would not result in Orca announcing the current position and text, because an incorrect focus event was sent for the item representing the document in the treeview in the "Documents" sidebar.
Attachments
For Gerrit Dashboard: QTBUG-118800 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
516155,3 | a11y: Only send focus event when item has focus | dev | qt/qtbase | Status: MERGED | +2 | 0 |
524582,2 | a11y: Only send focus event when item has focus | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
524614,2 | a11y: Only send focus event when item has focus | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
524918,2 | a11y: Only send focus event when item has focus | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |