From 73d2807b4bb59c1cb96d6c0fbef5a2189ae19b8a Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 21 Feb 2024 09:39:32 +0400 Subject: Fix move_window_to_output losing window instead --- src/layout/mod.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 9692e73d..de43488b 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -1437,15 +1437,10 @@ impl Layout { } pub fn move_window_to_output(&mut self, window: W, output: &Output) { - if !matches!(&self.monitor_set, MonitorSet::Normal { .. }) { - return; - } - - self.remove_window(&window); + let mut width = None; + let mut is_full_width = false; if let MonitorSet::Normal { monitors, .. } = &mut self.monitor_set { - let mut width = None; - let mut is_full_width = false; for mon in &*monitors { for ws in &mon.workspaces { for col in &ws.columns { @@ -1457,8 +1452,13 @@ impl Layout { } } } - let Some(width) = width else { return }; + } + let Some(width) = width else { return }; + + self.remove_window(&window); + + if let MonitorSet::Normal { monitors, .. } = &mut self.monitor_set { let new_idx = monitors .iter() .position(|mon| &mon.output == output) -- cgit