From dae77d87b929ad4fb4ff20b00ee54d0d2dbccab9 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Mon, 8 Aug 2022 14:16:30 -0700 Subject: [PATCH] fix(wm): rm layout_flip for custom layouts This commit ensures that when a custom layout is loaded, either manually or via a workspace layout rule trigger threshold being amtched, any layout_flip property for the impacted workspace will be removed, to allow for key bindings to work as expected on the custom layout. --- komorebi/src/window_manager.rs | 2 ++ komorebi/src/workspace.rs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index b371a625..1adbe4ea 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -1475,6 +1475,7 @@ impl WindowManager { } workspace.set_layout(Layout::Custom(layout)); + workspace.set_layout_flip(None); self.update_focused_workspace(self.mouse_follows_focus) } @@ -1715,6 +1716,7 @@ impl WindowManager { .ok_or_else(|| anyhow!("there is no monitor"))?; workspace.set_layout(Layout::Custom(layout)); + workspace.set_layout_flip(None); // If this is the focused workspace on a non-focused screen, let's update it if focused_monitor_idx != monitor_idx && focused_workspace_idx == workspace_idx { diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index 7ff90703..12ba6125 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -183,6 +183,10 @@ impl Workspace { } if let Some(updated_layout) = updated_layout { + if !matches!(updated_layout, Layout::Default(DefaultLayout::BSP)) { + self.set_layout_flip(None); + } + self.set_layout(updated_layout); } }