From 03404aab07bbf4cc57dba47b43db79e93715c288 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 11:58:44 -0700 Subject: [PATCH] refactor(windows): remove_focused_floating_window is KDE's two lines over a new remove_floating_window The foreground lookup and the search/removal are split as on KDE: remove_focused_floating_window(): foreground handle, then remove_floating_window(window_id). KDE's version also focuses the previous floating window before removing; the Windows one does not and still does not, so the split is the only change (the call is the hook the shared code will make optional). Item 6 of the Windows list in core-model.md section 7. Not a behaviour change. Verified: Windows clippy -D warnings via tools/fast-check PASS. --- komorebi/src/workspace.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index 990450f0..3b34259f 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -1990,7 +1990,10 @@ impl Workspace { pub fn remove_focused_floating_window(&mut self) -> Option { let window_id = WindowsApi::foreground_window().ok()?; + self.remove_floating_window(window_id) + } + pub fn remove_floating_window(&mut self, window_id: isize) -> Option { let mut idx = None; for (i, window) in self.floating_windows().iter().enumerate() { if window_id == window.hwnd {