Repository navigation
fix(wm): don't leave focus follows mouse stuck after a skipped raise - #1776
Open
totallynotrajat wants to merge 1 commit into
Open
totallynotrajat wants to merge 1 commit into
totallynotrajat wants to merge 1 commit into
Conversation
raise_window_at_cursor_pos falls back to searching every workspace when the cursor is not over a container on the focused workspace (padding, gaps, the bar). A window on a hidden workspace (e.g. a fullscreen one) can match, and its Raise event is dropped before process_event reaches the handler that clears has_pending_raise_op. The flag then stays true and focus follows mouse never raises again until it is toggled. Only search each monitor's focused workspace, and always clear the flag once a Raise event has been handled, whatever process_event returned.
totallynotrajat
force-pushed
the
fix/ffm-pending-raise-stuck
branch
from
November 22, 2026 23:51
ac6ecac to
92ce890
Compare
totallynotrajat
marked this pull request as ready for review
November 22, 2026 23:52
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With
--ffmandfocus_follows_mouse: Komorebi, hover focus can stop working entirely until it is toggled off and on (komorebic stateshows"has_pending_raise_op": trueand it never clears).raise_window_at_cursor_posfirst looks for a container under the cursor on the focused workspace. When the cursor is over workspace/container padding, a gap, or a bar, that finds nothing and it falls back to checking every workspace. A fullscreen window on a hidden workspace covers the whole monitor, so it matches. ARaiseevent is sent for it, andhas_pending_raise_opis set totrue.process_eventthen returns early (the window is hidden/unmanaged) before it reaches theRaisearm, which is the only place the flag is cleared. Every later hover returns early onhas_pending_raise_op.Reproduction
--ffm,komorebic focus-follows-mouse enable --implementation komorebi.komorebic state | grep has_pending_raise_opis nowtrue; hovering the tiles no longer focuses them.Fix
has_pending_raise_opafter aRaiseevent is handled, whateverprocess_eventreturned.Testing
Built on Windows 11 with MSVC (VS 2022 Build Tools),
cargo build -p komorebi -p komorebic. Setup: workspace 1 has two tiled windows, workspace 2 has one fullscreen window,komorebi.exe --ffm, hover focus enabled withkomorebic focus-follows-mouse enable --implementation komorebi. A script moves the pointer (relativemouse_eventmoves) over the left tile, the right tile, the gap between them, then both tiles again, and after each step prints the foreground window andhas_pending_raise_opfromkomorebic state.Before (installed nightly 72aa4c9): hovering the gap sets the flag, and the next hovers no longer move focus (the foreground stays on the right tile).
After (this branch):
cargo test -p komorebi --lib: 219 passed, 2 failed (monitor::tests::test_move_container_to_workspaceandtest_move_container_to_nonexistent_workspace). The same two fail on unpatchedmaster.I know FFM is no longer actively developed (#1044); this is a small fix in case it is still wanted.