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.
This commit is contained in:
LGUG2Z committed 2026-10-31 12:14:35 -07:00
1 parent 07c9ab8fc8
commit 03404aab07
1 file changed
+3
+3
View File
@@ -1990,7 +1990,10 @@ impl Workspace {
pub fn remove_focused_floating_window(&mut self) -> Option<Window> {
let window_id = WindowsApi::foreground_window().ok()?;
self.remove_floating_window(window_id)
}
pub fn remove_floating_window(&mut self, window_id: isize) -> Option<Window> {
let mut idx = None;
for (i, window) in self.floating_windows().iter().enumerate() {
if window_id == window.hwnd {