aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/layout/mod.rs16
1 files 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<W: LayoutElement> Layout<W> {
}
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<W: LayoutElement> Layout<W> {
}
}
}
- 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)