tmandry / Swindler

macOS window management library for Swift
https://tmandry.github.io/Swindler/docs/main/
MIT License
695 stars 66 forks source link

Window ordering routines #37

Open tmandry opened 5 years ago

tmandry commented 5 years ago

Allow setting the window ordering, within overlapping windows or actual order on the screen, using AX APIs.

My main concern with this feature is performance and user experience when re-ordering is happening (What if they type something and it ends up in the wrong window? Should we capture all user input during the operation, and re-direct it to the window that is re-focused at the end of it? Maybe that's a further enhancement.) Also, handling timeouts and failure properly.

Hammerspoon supports sendToBack, only for "visible" ordering (currently overlapping windows). This might not be enough, though, because once a window is moved to overlap with this window it could show up behind the window that was just sent to the back. We should consider exposing both options for performance reasons if that use case is not needed.