From ba1ef22204b3f84aab943ceac768424a7519d306 Mon Sep 17 00:00:00 2001 From: alex-ds13 <145657253+alex-ds13@users.noreply.github.com> Date: Sun, 23 Feb 2025 12:55:26 +0000 Subject: [PATCH] fix(wm): take layer into account on ws restore Previously if a workspace had any floating windows it would always focus the first one when restoring. Now it only focus the floating window if the workspace layer is `Floating`. --- komorebi/src/workspace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index 25ec9fd9..ee66ea55 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -303,7 +303,7 @@ impl Workspace { // Maximised windows and floating windows should always be drawn at the top of the Z order // when switching to a workspace if let Some(window) = to_focus { - if self.maximized_window().is_none() && self.floating_windows().is_empty() { + if self.maximized_window().is_none() && matches!(self.layer, WorkspaceLayer::Tiling) { window.focus(mouse_follows_focus)?; } else if let Some(maximized_window) = self.maximized_window() { maximized_window.focus(mouse_follows_focus)?;