accesskit has no effect unless screen readers are enabled #502
Replies: 3 comments 4 replies
-
Hi @drewcrawford! Thanks for the thoughtful message! We certainly want to eliminate as many stumbling blocks as possible for developers who are trying to make their software accessible. I wasn't aware that the current behavior of the Unix adapter was a problem for developers who don't use a screen reader or other assistive technology but are trying to test their work using Accerciser. For that reason alone, I think it's worthwhile for us to revisit that behavior, regardless of whose bug is giving you trouble. Unfortunately, AT-SPI doesn't allow as clean a solution as the Windows and macOS APIs do. On Windows and macOS, we can enable lazy initialization with practically zero overhead simply by responding to a particular window message or Objective-C selectors. Crucially, because those platforms themselves raise focus events that cause accessibility clients to send those initial requests, we don't have to proactively raise focus events ourselves. If I remember correctly from my work on GTK last year, this is what prevents GTK 4 from lazily initializing its accessibility subsystem as AccessKit tries to do. So, I don't think we can arrive at a win-win solution by doing something simple, such as proactively registering the root object with the AT-SPI bus regardless of the state of the I want to respond more directly to this point:
That's a valid concern. Perhaps I'm showing my jadedness here, as a (partially) blind person, a long-time assistive technology developer, and a former member of an accessibility team at a mainstream company (I was on the Windows accessibility team at Microsoft for ~3.5 years). But it seems to me that for accessibility solutions to be accepted and implemented by the non-disabled mainstream, it's important to minimize the impact of those solutions on that group. So, I worry that if a non-disabled developer notices any performance impact caused by AccessKit when running their applications without any assistive technology, they'll be less likely to use AccessKit, and by extension, possibly less likely to make their thing accessible at all. I figured that if we can get more developers to make their stuff accessible at all, even if disabled users then disproportionately bear the burden of performance issues, that's a net win. Of course, in a more fair world, there wouldn't be performance issues that disproportionately affect disabled users, and non-disabled developers wouldn't be put off by being immediately exposed to performance issues that come with implementing accessibility. Perhaps I overestimate the number of developers who would have such a strong reaction to being immediately confronted with such issues. And of course it's true that, since performance issues like the one you linked will ultimately affect assistive technology users, they really ought to be addressed. So, I don't think there's a simple correct answer to this. And again, maybe I'm carrying a chip on my shoulder and allowed that to cloud my judgment. Since @DataTriny is the primary developer of the Unix adapter, I'll defer to him on specific solutions. But I would certainly welcome a PR that documents the current behavior. Thanks again for taking the time to share your thoughts! |
Beta Was this translation helpful? Give feedback.
-
Thanks so much for getting back to me so quickly, especially with workarounds!
I understand this line of thinking, and I can't speak to what is the most viable strategy in the Microsoft orbit at all. But I also think different kinds of developers will have different kinds of concerns. My main concern is "if I break my software, will I find out?" Ultimately the more configurations I have, the less likely that is. Of particular concern and at large risk are things that I need to support but don't use personally. I'm also uncertain what the best practice is to find out if accessible technologies are contributing to e.g. a performance issue someone files on GitHub. For all those reasons "always on" would be easier for me to ship personally. With that said, having software that doesn't work as expected out of the box because of how I interact with assistive technologies was certainly "eye-opening" for me, and gave me a better understanding of how other people go through the world so that part was kinda cool actually.
I can't speak to this technically, but I can mention the distribution story for accerciser is less than excellent; the distro I normally use doesn't package it at all and I'm not sure how hard it will be to build on my own. I'd be interested to know what KDE's tool does here, I wound up on accerciser because I just figured the GNOME tooling would be more popular and well-traveled. |
Beta Was this translation helpful? Give feedback.
-
I'm now much less sure that I made the right decision about lazy initialization, as you can see in the last comment I posted on that slint issue. I'm tempted to do a complete 180 now. After all, especially at this stage of AccessKit's development (more or less usable, but still incomplete, and pre-1.0), it might be good if the developers (presumably mostly sighted) who are integrating AccessKit into their toolkits and applications immediately run into performance problems. At the same time, lazy initialization of accessibility is something that every serious GUI toolkit (possibly excluding GTK 4) and browser engine I know of attempts to do. Chromium does it for sure, because accessibility has an easily noticeable impact on performance in Chromium. A sighted person once told me that he did some testing with a screen reader, then after he turned the screen reader off, Chromium remained sluggish, particularly on a large web page, because Windows and macOS don't have a clean way for the application to find out when assistive technologies are turned off. So, with all of that in mind, in addition to the more hypothetical concern I raised yesterday, I figured lazy initialization was a foundational part of the design that I should do fairly early on (I did the first implementation on Windows in late 2021). Maybe the best solution would be to let the toolkit/application developer decide. So, for instance, Or maybe, as @drewcrawford originally suggested, the adapter should always be active in debug builds. |
Beta Was this translation helpful? Give feedback.
-
For the dedicated and often overburdened OSS maintainers: this is actually a check-in to gauge whether it would be helpful and appropriate to contribute by sending PRs, or if it's more expedient to deal with things on my own. I truly appreciate the time and effort you put into maintaining this project and for anyone who tries to improve AX generally, and ideally everything I would say would be interpreted in that light.
I am evaluating accesskit's viability for application and application-related frameworks I have in the works and everything I can say comes from an application-developer's POV.
My basic strategy to get to know the crate was to add deps to a representative project, to call
accesskit_unix::Adapter::new(...)
and pass ittodo!()
-based implementation of the required traits. Then to perform panic-oriented-programming to better understand the crate and to see how I can implement core behaviors etc.Unfortunately calling
new
in this way did not trigger my panics or have seemingly any effect, and I got stuck here for a long while. I spent a fair bit of time trying to understand what "else" I needed to do to get the accesskit family of crates to "do" anything (I read and tried all of the 4 examples on GitHub that use this API, I read a lot of API docs to try to find out how who I should call to 'activate' my adapter, I looked into drop issues, I set breakpoints inside the accesskit family of crates to step through them interactively, etc.) to eventually discover my issue is #324 and #314 and I need to run my program with my screenreader enabled. So in that sense I know the workaround and so my problem is "solved".In another sense this experience raised some practical questions about if accesskit is a good fit for my usecase:
accesskit_unix::Adapter::new(...)
, b) no print at runtime when this happens, and c) the names of properties I saw deep in my debugger (IsEnabled
andScreenReaderEnabled
) seem to be dead ends for searching for answers in the codebase itself, comments, etc.Here's a list of possible PRs I could contribute on these topics that maintainers could easily approve:
#[cfg(debug_assertions)]
NO_ACCESSKIT=1
for those affected by problems with thisSome unrelated longer-term priorities I would have, and I'd like to understand if my PRs can land here, would be:
Beta Was this translation helpful? Give feedback.
All reactions