Skip to content

fix(focus_follows_mouse): don't reset g_window_manager.ffm_mode when it is called without a corresponding MENU_OPENED#2740

Open
johnko wants to merge 2 commits intoasmvik:masterfrom
johnko:fix-ffm-disabled-when-menuclosed-without-menuopen
Open

fix(focus_follows_mouse): don't reset g_window_manager.ffm_mode when it is called without a corresponding MENU_OPENED#2740
johnko wants to merge 2 commits intoasmvik:masterfrom
johnko:fix-ffm-disabled-when-menuclosed-without-menuopen

Conversation

@johnko
Copy link
Copy Markdown

@johnko johnko commented Jan 26, 2026

i observed these logs when running yabai --verbose:

EVENT_HANDLER_WINDOW_TITLE_CHANGED: Terminal 46053
EVENT_HANDLER_APPLICATION_LAUNCHED: Google Calendar (42983) is not finished launching, subscribing to finishedLaunching changes
EVENT_HANDLER_WINDOW_TITLE_CHANGED: Terminal 46053
-[workspace_context observeValueForKeyPath:ofObject:change:context:]: Google Calendar (42983) finished launching
EVENT_HANDLER_APPLICATION_LAUNCHED: Google Calendar (42983)
EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: Google Calendar (42983)
window_manager_create_and_add_window:46295 Google Calendar -  (AXWindow:AXStandardWindow:1)
EVENT_HANDLER_WINDOW_TITLE_CHANGED: Google Calendar 46295
EVENT_HANDLER_WINDOW_FOCUSED: Google Calendar 46295
EVENT_HANDLER_WINDOW_RESIZED: Google Calendar 46295
EVENT_HANDLER_WINDOW_MOVED:DEBOUNCED Google Calendar 46295
EVENT_HANDLER_WINDOW_TITLE_CHANGED: Google Calendar 46295
EVENT_HANDLER_MENU_CLOSED
EVENT_HANDLER_MENU_CLOSED

so i think MENU_CLOSED is being called without MENU_OPENED, which leaves ffm_value enum default to FFM_DISABLED.

  • This patch just avoids setting g_window_manager.ffm_mode if is_menu_open was negative because that means it was probably called without a corresponding MENU_OPENED.

  • (Alternatively, another fix could be saving ffm_value = g_window_manager.ffm_mode earlier than just in EVENT_HANDLER(MENU_OPENED))

fixes #2217

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

Successfully merging this pull request may close these issues.

focus_follows_mouse stops working

1 participant