From adf6aa8714cacf30463869e1ec7413cdf9638038 Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Mon, 18 May 2020 16:48:26 +0200 Subject: [PATCH] #528 reset ffm cache upon space change --- CHANGELOG.md | 1 + src/event.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a445bcc4..11ac216c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Properly clear focus-follows-mouse cache upon space change [#528](https://github.com/koekeishiya/yabai/issues/528) ## [3.0.1] - 2020-05-09 ### Changed diff --git a/src/event.c b/src/event.c index 7e22e886..add203ea 100644 --- a/src/event.c +++ b/src/event.c @@ -815,7 +815,12 @@ static EVENT_CALLBACK(EVENT_HANDLER_SPACE_CHANGED) struct window *focused_window = window_manager_focused_window(&g_window_manager); if (focused_window && window_manager_find_lost_focused_event(&g_window_manager, focused_window->id)) { window_manager_set_window_opacity(&g_window_manager, focused_window, g_window_manager.active_window_opacity); - window_manager_center_mouse(&g_window_manager, focused_window); + + if (g_mouse_state.ffm_window_id != focused_window->id) { + window_manager_center_mouse(&g_window_manager, focused_window); + } + + g_mouse_state.ffm_window_id = 0; window_manager_remove_lost_focused_event(&g_window_manager, focused_window->id); } }