Skip to content

Commit

Permalink
fix(wm): rm layout_flip for custom layouts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LGUG2Z committed Aug 8, 2022
1 parent 07bd538 commit dae77d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions komorebi/src/window_manager.rs
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions komorebi/src/workspace.rs
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit dae77d8

Please sign in to comment.