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

iTerm2 Hotkey Window support #81

Open
smaugfm opened this issue Sep 6, 2022 · 0 comments
Open

iTerm2 Hotkey Window support #81

smaugfm opened this issue Sep 6, 2022 · 0 comments

Comments

@smaugfm
Copy link

smaugfm commented Sep 6, 2022

Hey, I just discovered your app and it is amazing!
However, I use iTerm2 as my terminal and particulary its built-in drop-down-always-on-top-sliding-window feature (which makes iTerm2 to behave like the famous Guake terminal for GNOME).

The problem is that when the hotkey is pressed and iTerm2 window slides out it doesn't actually activate iTerm2 application as a foreground application and Fluor doesn't change mode.

Currently, I am thinking of a workaround to this. But is there any chance you might work on this issue? I believe a different API must be used by Fluor to detect such "floating" windows.
I am not familiar with macOS development myself, but I found this code in iTerm2 project which selects what level must this sliding window be:
windowLevelJustBelowNotificiations = NSMainMenuWindowLevel - 2;

UPD: I've implemented the necessary changes myself. Here it is: https://github.com/smaug-fm/Fluor.
I only added support for iTerm2 specifically, but I can try to generalize the solution to support any app.

In short, iTerm2 uses a window with NWindowLevel not equal to 0 and when this window catches focus it does not activate iTerm2 app. So I've added an AXObserverAddNotification notification to listen for kAXFocusedWindowChangedNotification. But unfortunately, the notification only works when the window catches focus, but not when it loses it. Unfortunately, it's forced me to add polling for lost focus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant