Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query commands stealing focus #317

Closed
xdrop opened this issue Jul 5, 2024 · 3 comments
Closed

Query commands stealing focus #317

xdrop opened this issue Jul 5, 2024 · 3 comments
Labels
bug Something isn't working as expected

Comments

@xdrop
Copy link

xdrop commented Jul 5, 2024

Would it be possible to have query commands not force focus?

}
if let command {
let _answer: Result<ServerAnswer, Error> = await Task { @MainActor in
refreshSession(forceFocus: true) {

This leads to an issue with my setup (where I'm using sketchybar to list the workspace windows):

Screenshot 2024-07-05 at 11 33 38 PM

What happens is:

  1. New popup window created
  2. Sketchybar space_windows_changed event is fired
  3. Sketchybar calls aerospace list-windows ... to get up to date windows
  4. Aerospace refocuses the main application causing the popup to close

For a visual example see #168 which judging by the setup the OP is facing the same issue.

I was able to fix it with a diff like this, however I'm not sure if this has any side effects https://gist.github.com/xdrop/50d158acaa22acb3300356f714613cb8. I can send in a PR if the solution looks reasonable (though my Swift knowledge is non-existent 😄 )

@Christopher2K
Copy link

Oooh this is what I was looking for sir!!!!!!

@nikitabobko nikitabobko added the bug Something isn't working as expected label Aug 28, 2024
nikitabobko added a commit that referenced this issue Sep 8, 2024
Keep forceFocus only for destructured windows

#317

Also see:
- 4407be9 #106
- 0569bb0 #65
- f86fcd1 #201
@xdrop
Copy link
Author

xdrop commented Sep 19, 2024

Verified 425fc6b and is fixed. Thanks for fixing <3

@nikitabobko
Copy link
Owner

Released in 0.15.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants