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

When changing focus to Chrome window A, focus is immediately redirected to Chrome window B #726

Open
samuela opened this issue Nov 18, 2024 · 3 comments
Labels
bug Something isn't working as expected

Comments

@samuela
Copy link

samuela commented Nov 18, 2024

Describe the bug
When changing focus to a Google Chrome window, either via workspace or focus-monitor, I am finding that Chrome (or something else) then immediately redirects focus to a different Chrome window. I can more clearly see this focus change thanks to on-focus-changed = ['move-mouse window-lazy-center'].

I will attempt to reproduce on my personal machine and post a video. I am on a multi-monitor setup with macOS Sequoia 15.1 and AeroSpace v0.15.2-Beta b6cf827.

Related issues you could find
n/a

@samuela samuela added the bug Something isn't working as expected label Nov 18, 2024
@nmder
Copy link

nmder commented Nov 18, 2024

I think you'd need to set Displays have separate Spaces under system settings → Desktop & Dock to off.

To get this working with the prior setting set to on, I think one needs to use additional private APIs: https://github.com/lwouis/alt-tab-macos/blob/7100d251ec25a1eaae9a05b8bd609050bb727fa1/src/logic/Window.swift#L202.

@samuela
Copy link
Author

samuela commented Nov 19, 2024

I think you'd need to set Displays have separate Spaces under system settings → Desktop & Dock to off.

Interesting, I'll give this a shot

To get this working with the prior setting set to on, I think one needs to use additional private APIs:

Not sure I follow... what's the reasoning here?

@nmder
Copy link

nmder commented Nov 19, 2024

On the second point on private API, I think the app alt-tab uses additional private APIs to switch to a window on another monitor, of an application which has the most recently-used window on the current monitor. The current implementation that uses only one private API cannot achieve that, I guess. It is a macOS quirk. Hope it explains.

Thanks!

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

2 participants