forge
Explore
Log in

Don't you dare go Hollow

Fix move_window_to_output losing window instead

Browse files at this commit

73d2807b4bb59c1cb96d6c0fbef5a2189ae19b8aIvan MolodetskikhParent: 7d41f11
src/layout/mod.rsmodified+8 -8
@@ -1437,15 +1437,10 @@ impl<W: LayoutElement> Layout<W> {
1437 }1437 }
1438 1438
1439 pub fn move_window_to_output(&mut self, window: W, output: &Output) {1439 pub fn move_window_to_output(&mut self, window: W, output: &Output) {
1440- if !matches!(&self.monitor_set, MonitorSet::Normal { .. }) {1440+ let mut width = None;
1441- return;1441+ let mut is_full_width = false;
1442- }
1443-
1444- self.remove_window(&window);
1445 1442
1446 if let MonitorSet::Normal { monitors, .. } = &mut self.monitor_set {1443 if let MonitorSet::Normal { monitors, .. } = &mut self.monitor_set {
1447- let mut width = None;
1448- let mut is_full_width = false;
1449 for mon in &*monitors {1444 for mon in &*monitors {
1450 for ws in &mon.workspaces {1445 for ws in &mon.workspaces {
1451 for col in &ws.columns {1446 for col in &ws.columns {
@@ -1457,8 +1452,13 @@ impl<W: LayoutElement> Layout<W> {
1457 }1452 }
1458 }1453 }
1459 }1454 }
1460- let Some(width) = width else { return };1455+ }
1461 1456
1457+ let Some(width) = width else { return };
1458+
1459+ self.remove_window(&window);
1460+
1461+ if let MonitorSet::Normal { monitors, .. } = &mut self.monitor_set {
1462 let new_idx = monitors1462 let new_idx = monitors
1463 .iter()1463 .iter()
1464 .position(|mon| &mon.output == output)1464 .position(|mon| &mon.output == output)