AccessKit / accesskit

UI accessibility infrastructure across platforms and programming languages
BSD 3-Clause "New" or "Revised" License
990 stars 48 forks source link

fix: Improve how coordinates are computed on Unix #420

Closed DataTriny closed 1 month ago

DataTriny commented 1 month ago

Orca apparently changed the way it queries for bounds. Now only the client area of a window is considered. I chose to not drop the WindowBounds::outer field because we might need it again later, and it is public.

We also now support querying coordinates in relation to a parent, a feature that I haven't seen used but could be useful when dealing with text for instance.

mwcampbell commented 1 month ago

How do we know that the correct coordinate type for the BoundsChanged event is screen? I haven't been able to find a definitive answer on this. It seems wrong for today's requirements, particularly because an app running on Wayland doesn't know its screen coordinates. But, since AT-SPI itself wasn't designed for that environment, I wouldn't be surprised to learn that a coordinate type of screen really is assumed for that event.

mwcampbell commented 1 month ago

If you're reasonably sure that the screen coordinate type is the correct one for the BoundsChanged event, than I'm ready to merge this.

DataTriny commented 1 month ago

Good point: my initial implementation was based on tests with GTK3 as far as I remember. But in GTK4 the coordinates space seem to be the direct parent of the Component.

With that being said, neither Chromium nor Orca use it.

DataTriny commented 1 month ago

I made more tests and pushed more changes as a result. I'm quite confident in this implementation now.