Re-add stuff I removed

This commit is contained in:
Ottatop 2023-09-04 01:54:10 -05:00
parent 8f2ce70586
commit 430fb76fc8

View file

@ -572,12 +572,36 @@ impl State {
}
}
// TODO: don't use the focused output, use the outputs the two windows are on
let output = self
.focus_state
.focused_output
.clone()
.expect("no focused output");
self.update_windows(&output);
let mut same_suggested_size = false;
if let WindowElement::Wayland(w1) = win1 {
if let WindowElement::Wayland(w2) = win2 {
if let Some(w1_size) = w1.toplevel().current_state().size {
if let Some(w2_size) = w2.toplevel().current_state().size {
same_suggested_size = w1_size == w2_size;
}
}
}
}
if same_suggested_size {
let win1_loc = self.space.element_location(win1);
let win2_loc = self.space.element_location(win2);
if let Some(win1_loc) = win1_loc {
if let Some(win2_loc) = win2_loc {
self.space.map_element(win1.clone(), win2_loc, false);
self.space.map_element(win2.clone(), win1_loc, false);
}
}
} else {
// TODO: don't use the focused output, use the outputs the two windows are on
let output = self
.focus_state
.focused_output
.clone()
.expect("no focused output");
self.update_windows(&output);
}
}
}