From 5bffe0e93e3cf72fd637ebd4edb5b51681a5b0bc Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 10:31:33 -0700 Subject: [PATCH] refactor(windows): maximize and unmaximize go through backend() The five window.maximize() / unmaximize() calls in workspace.rs become let _ = backend().maximize(id, true/false). The trait already has the capability query (Backend::supports(Capability::Maximize), true on Windows), so no trait change; the Windows daemon does not need to ask, the shared core will. WindowsBackend::maximize runs Window::maximize / unmaximize, which keep the HIDDEN_HWNDS bookkeeping. set_opacity is NOT switched: the adapter's set_opacity is the plain write, while Window::transparent/opaque take the alpha from the transparency manager and animate. BEHAVIOUR: a dead window is skipped (IsWindow first). e2e gate needed: maximizing, commands, workspaces. Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run. --- komorebi/src/workspace.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index ec69d747..4eba3431 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -729,7 +729,7 @@ impl Workspace { window.set_position(&adjusted_work_area, true)?; }; } else if let Some(window) = &mut self.maximized_window { - window.maximize(); + let _ = backend().maximize(WindowId::from_hwnd(window.hwnd), true); } else if !self.containers().is_empty() { // windows that were not what they were told to be since the last layout, which // is something that animations only show once they are done @@ -1198,7 +1198,7 @@ impl Workspace { if let Some(window) = self.maximized_window && window.hwnd == hwnd { - window.unmaximize(); + let _ = backend().maximize(WindowId::from_hwnd(window.hwnd), false); self.maximized_window = None; self.maximized_window_restore_idx = None; return Ok(()); @@ -1888,7 +1888,7 @@ impl Workspace { self.maximized_window = floating_window; self.maximized_window_restore_idx = Option::from(focused_idx); if let Some(window) = self.maximized_window { - window.maximize(); + let _ = backend().maximize(WindowId::from_hwnd(window.hwnd), true); } return Ok(()); @@ -1910,7 +1910,7 @@ impl Workspace { self.maximized_window = Option::from(window); self.maximized_window_restore_idx = monocle_restore_idx; if let Some(window) = self.maximized_window { - window.maximize(); + let _ = backend().maximize(WindowId::from_hwnd(window.hwnd), true); } return Ok(()); @@ -1940,7 +1940,7 @@ impl Workspace { self.maximized_window_restore_idx = Option::from(focused_idx); if let Some(window) = self.maximized_window { - window.maximize(); + let _ = backend().maximize(WindowId::from_hwnd(window.hwnd), true); } self.focus_previous_container();