Open pixmin opened 4 years ago
The autofocus functionality was implemented by reverse engineering the event-flow of the WindowServer, and so I don't actually know why it will not work for some applications.
Ref. https://github.com/koekeishiya/yabai/issues/333#issuecomment-565710628
If that can help, I just noticed that PHPStorm also has the same issue.
And Compass (MongoDB) https://www.mongodb.com/products/compass
To add here, this seems to be happening to me also, but with intellij IDEA, I think I can live with it though.
Thanks for this!
Another way the Firefox window difference manifests itself is in yabai -m window --display X && yabai -m display --focus X
. I'm not sure how related it is, but it's definitely Firefox specific so might help? Anyway:
If I use Safari/most standard windows, I can bounce a window between two displays (next; prev; next; prev) as many times as I like. With Firefox, windows get 'stuck' on a display after a few bounces, i.e. the window moving commands seem to fail. Here's an example I can reproduce on macOS 10.14.6, two displays, yabai is homebrew/2.4.1 but also happens on 2.3.0.
next
✅ focus
✅ (now on display 2)prev
✅ focus
✅ (now on display 1)next
✅ focus
✅ (now on display 2)prev
❌ (still on display 2)prev
❌ (still on display 2)To get it unstuck, you can click on the window, and normal functionality resumes. The window is never unfocused, and the click doesn't refocus it, it just seems to get yabai back in sync. I can get the "n = number of times it works = 1" if the window in question is the only window open on the machine. I.E.
next
✅ focus
✅ (now on display 2)prev
❌ (still on display 2)prev
❌ (still on display 2)Click on the window, and it will work again.
From #333
there is one application that is refusing to focus but not raise, it's called yEd:
Add Simulator to the list.
Maybe it's related to some cross-platform app tech stack? The ones I see that this happens with are Intellij IDEA, PHPStorm, PyCharm (all Jetbrains IDEs which are java Swing apps and essentially, the same app) as well as Firefox and Blender, both of which use custom GUI toolkits. It could be Swing / other custom GUI toolkits not playing nice. On the other hand other cross platform apps seem fine like Audacity, Bitwig, Visual Studio Code, Slack, etc. Compass, mentioned above, seems to be an electron app that has issues though other electron apps seem ok (Slack, VSC) white yEd is also a cross-platform app. Not sure what the common thing they have is that's preventing autofocus from working though.
Thunderbird (might use the same GUI toolkit as Firefox) is another app that always raise automatically :(
I've installed yabai just because of the "focus follow mouse autofocus" feature, but unfortunately can't keep using it since I'm a heavy user of Firefox and Thunderbird.
Today's Visual Studio Code 1.57.0 update introduced this problem; focussing VSCode causes it to be raised to the front of the desktop. The workaround for that is to downgrade to 1.56.2. I thought this may be of interest since the version introducing the problem could be compared with the previous working version. I opened issue https://github.com/microsoft/vscode/issues/126044 and the response is that the developers plan to fix it in their next update.
Yeah, the FireFox issue is really annoying. A big reason I'm only using it in a minor way on a Mac. On Linux it's my main development browser.
I just discovered this Bugzilla https://bugzilla.mozilla.org/show_bug.cgi?id=1707379 Firefox raises window when it gains focus when using yabai with focus_follows_mouse with autofocus, but not autoraise
In https://bugzilla.mozilla.org/show_bug.cgi?id=1707379, a patch has been provided for Firefox. Follow https://firefox-source-docs.mozilla.org/setup/macos_build.html to acquire source, apply the patch before .mach build
step.
Today's Firefox Nightly build 97.0a1 (2022-01-07) available on https://www.mozilla.org/en-CA/firefox/channel/desktop/ has this bug fixed. I plan to use this build until the fix is released in the stable version.
I have this issue with Microsoft Teams (but only the main chat window, not the call in-progress ' window) and Mattermost. Maybe something to do with electron apps? Someone above mentioned vscode which I think is also an electron app?
Having this issue with Microsoft Teams too, which is annoying, since I have to work with it all day.
I have just installed yabai with a minimal setup (to use "focus follow mouse" feature, without auto raise):
It works great, except for Firefox (at least that's the only application I've noticed so far). In addition to getting focused when being mouse over, Firefox also get raised.
Any idea why/how to fix this?
Thanks,