Skip to content

Use AT-SPI screen reader status on Linux#285

Open
matthewflint wants to merge 1 commit intodesktop-app:masterfrom
matthewflint:fix/linux-screen-reader-mode-detection
Open

Use AT-SPI screen reader status on Linux#285
matthewflint wants to merge 1 commit intodesktop-app:masterfrom
matthewflint:fix/linux-screen-reader-mode-detection

Conversation

@matthewflint
Copy link
Copy Markdown

Summary

Use org.a11y.Status.ScreenReaderEnabled for Linux screen reader mode detection instead of treating QAccessible::isActive() as equivalent to a running screen reader.

On affected Linux X11 setups, QAccessible::isActive() can become active even when no screen reader is running. That broader accessibility-active state is a poor match for Telegram's screen-reader-specific mode and causes false activation downstream.

What changed

  • add a Linux-specific ScreenReaderState implementation based on AT-SPI status
  • keep QT_LINUX_ACCESSIBILITY_ALWAYS_ON as an explicit override
  • listen for runtime AT-SPI status changes through D-Bus
  • avoid starting org.a11y.Bus just to probe the status
  • stop using the generic QAccessible::isActive() fallback on Linux

Rationale

Applications sometimes need a narrower product signal than Qt's generic accessibility-active state. For Telegram Desktop, that signal feeds screen-reader-specific behavior and a user-facing warning bar. Using ScreenReaderEnabled is a better fit for that decision than using any accessibility backend activity as a proxy.

Validation

  • syntax-checked the touched translation units with local Qt and GIO headers
  • verified org.a11y.Status property reads against a live session bus
  • verified PropertiesChanged delivery for runtime updates
  • kept the change scoped to the Linux detector path only

Use org.a11y.Status.ScreenReaderEnabled on Linux instead of treating QAccessible::isActive() as equivalent to a running screen reader.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 17, 2026

CLA assistant check
All committers have signed the CLA.

@ilya-fedin
Copy link
Copy Markdown
Contributor

ilya-fedin commented Apr 17, 2026

Qt's implementation needs a few lines fix and I would like to avoid having 213 lines of new C(!!!) code unless the problem is discussed with Qt folks. Also, you could notice other D-Bus code in the repo uses C++ codegen.

@matthewflint
Copy link
Copy Markdown
Author

Thanks, got it. I'll take this to the Qt side first and reduce it to a minimal repro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants