From e1c36c9190eea707c7e4a80a9277b9acead0ecf1 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Tue, 19 Apr 2022 11:10:18 -0700 Subject: [PATCH] fix(wm): update origin ws after container removal This commit ensures that the origin workspace will be updated after a container is removed to be sent to a target workspace (specified, or currently focused) on another monitor. With this change in place, moving window containers to another monitor should not result in a ghost container that remains until the next retile on the origin workspace. fix #132 --- komorebi/src/window_manager.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index f773eb91..f849c571 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -815,6 +815,8 @@ impl WindowManager { .remove_focused_container() .ok_or_else(|| anyhow!("there is no container"))?; + monitor.update_focused_workspace(offset, &invisible_borders)?; + let target_monitor = self .monitors_mut() .get_mut(monitor_idx) @@ -845,6 +847,7 @@ impl WindowManager { self.update_focused_workspace(mouse_follows_focus) } + pub fn remove_focused_workspace(&mut self) -> Option { let focused_monitor: &mut Monitor = self.focused_monitor_mut()?; let focused_workspace_idx = focused_monitor.focused_workspace_idx();