From 7f3b932693c47e3239b48b70e84375f487b8b9a8 Mon Sep 17 00:00:00 2001 From: alex-ds13 <145657253+alex-ds13@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:36:04 +0000 Subject: [PATCH] fix(wm): sort layout and behaviour rules This commit makes sure the `layout-rules` and `window_container_behaviour_rules` are sorted when setting them from the config. So that the behaviour on workspace update is correct. --- komorebi/src/workspace.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index 876e7b1f..e2dd2c9b 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -167,6 +167,7 @@ impl Workspace { all_layout_rules.push((*count, Layout::Default(*rule))); } + all_layout_rules.sort_by_key(|(i, _)| *i); self.tile = true; } @@ -178,6 +179,7 @@ impl Workspace { all_layout_rules.push((*count, Layout::Custom(rule))); } + all_layout_rules.sort_by_key(|(i, _)| *i); self.tile = true; self.set_layout_rules(all_layout_rules); } @@ -197,11 +199,11 @@ impl Workspace { all_rules.push((*count, *behaviour)); } + all_rules.sort_by_key(|(i, _)| *i); self.set_window_container_behaviour_rules(Some(all_rules)); } } else { self.set_window_container_behaviour_rules(None); - self.set_window_container_behaviour(None); } self.set_float_override(config.float_override);