mjrusso / scoot

Keyboard-driven MacOS cursor actuator
BSD 3-Clause "New" or "Revised" License
333 stars 14 forks source link

Scoot should lazily traverse accessibility tree for frontmost app when activated #26

Closed mjrusso closed 2 years ago

mjrusso commented 2 years ago

From #25:

Currently, when Scoot is activated, it traverses the accessibility tree for the frontmost/focused application and builds the data structure used for element-based navigation, regardless of which navigation mode is requested. The thinking here was that once Scoot is on screen, you could swap between (for example) grid-based nav and element-based nav, without any delay.

If you've activated Scoot in the grid-based or freestyle nav modes, you should be able to use the requested mode immediately, without blocking on element-based nav becoming ready.

Either wait for element-based nav to be requested before doing the work of traversing the accessibility tree (and prepping the associated data structures, etc.), or do this work in a background thread (if possible).

B1T3X commented 2 years ago

Hey @mjrusso, just wanted to add (since this is a follow-up to my original issue), The app I'm using is called Ferdi. Other apps load the grid almost instantly as I outlined.

Thanks! Let me know if you need me to do any testing. Orel

mjrusso commented 2 years ago

This is fixed in 202ebde8322cf3cf2c04aa55fc603a5dbbe456d0. (Note that I haven't cut a release yet, but plan to shortly; I'll close this issue once the new release is out.) Turns out that a viable fix was significantly more trivial than I initially expected, as it didn't require any async code.

mjrusso commented 2 years ago

Just released v1.0, which should address this issue. Give it a shot @B1T3X and let me know how it works.