mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[BUG]: Firefox steals focus when window title changes #563
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @danaiello on GitHub (Jan 21, 2025).
Summary
If the title of a Firefox window changes, and the focus is on a different monitor, Komorebi changes the focus to the monitor where the window with the changed title is.
Easiest test case is this web site:
https://pomodoro-tracker.com/
Click start and it will start a timer, and update the title every second with the remaining time. A more common use case is email web sites that will update the title with unread email number, etc.
This bug does not occur with Edge/Chrome.
Here is the output of komorebi with Firefox and a timer running. I click over to the PowerShell window on a different monitor, and immediately the focus changes back to the monitor with the Firefox window, but only to the monitor, not the window.
Here is the output of komorebi with Edge and a timer running. The focus only changes when I click in a window, but there's a komorebi message for every time the window title changes.
Version Information
Komorebi Configuration
Hotkey Configuration
out of the box installation
Output of komorebic check
Looking for configuration files in C:\Users\XXXX
No komorebi configuration found in C:\Users\XXXX
If running 'komorebic start --await-configuration', you will manually have to call the following command to begin tiling: komorebic complete-configuration
@LGUG2Z commented on GitHub (Jan 21, 2025):
I'm aware of this and ultimately this is a Firefox/Gecko issue to be fixed by those projects and not something to be fixed in komorebi.
However, if someone has a potential workaround for this in komorebi which is relatively sensible and doesn't introduce other side effects, I will definitely consider integrating it.
For now, please open an issue on the Firefox issue tracker and link it here.
@LGUG2Z commented on GitHub (Jan 21, 2025):
Ignore the above message, I thought this was a different Firefox focus stealing issue. This should definitely be fixed in komorebi.
@LGUG2Z commented on GitHub (Jan 21, 2025):
Underlying Gecko issue: Browsers built on this engine don't send a SHOW event when windows are launched, only an OBJECT_NAMECHANGE event.
Komorebi can be configured to listen to this for specific applications to be able to tile them automatically when they launch, otherwise a minimize/restore is required. When applications identified by OBJECT_NAMECHANGE send this event, it will be treated as a SHOW, however this event also gets sent on title changes, which brings us to this behavior.
I can't think of a nice way to handle this off the top of my head. The real fix is that Gecko needs to send SHOW like every other Win32 application when it launches. For now if you want to use komorebi you'll either have to run your Pomodoro app in a different browser which sends SHOW events properly, or run a different Pomodoro app which doesn't update the page title every second.
@LGUG2Z commented on GitHub (Jan 24, 2025):
Possible idea: add a config option for title change exclusion regexes which apply to object name change applications 🤔
@danaiello commented on GitHub (Jan 24, 2025):
I see the wheels are turning here. I'm sorry that Firefox behaves badly, and I appreciate that you're trying to find a workaround anyway.
@danaiello commented on GitHub (Jan 24, 2025):
I tried to file a bug with Mozilla, but I'm not a Win32 developer, so I didn't feel comfortable describing the bug. Would you be willing to file that bug?
https://bugzilla.mozilla.org/
@LGUG2Z commented on GitHub (Jan 25, 2025):
I've implemented and tested the title regex ignore list and it should be in the next nightly release on Saturday. You can use this config snippet which I used to test the pomodoro tracker web app:
And finally, a reminder that if you are using komorebi at work to please make sure to purchase an appropriate individual commercial use license and submit a software reimbursement request to your employer 🙏