mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-16 13:51:19 +01:00
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:
1 parent
07c9ab8fc8
commit
03404aab07
1 file changed
+3
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user