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`.
This commit is contained in:
alex-ds13
2025-02-23 12:55:26 +00:00
committed by LGUG2Z
parent f7c9712706
commit ba1ef22204

View File

@@ -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)?;