Make foreign toplevel actions use transactions

This commit is contained in:
Ottatop 2024-05-27 16:17:05 -05:00
parent 6982587a84
commit fae6cae0cc

View file

@ -851,16 +851,7 @@ impl ForeignToplevelHandler for State {
return; return;
}; };
if !window.with_state(|state| state.fullscreen_or_maximized.is_fullscreen()) { self.set_window_fullscreen(&window, true);
window.toggle_fullscreen();
}
let Some(output) = window.output(&self.pinnacle) else {
return;
};
self.pinnacle.request_layout(&output);
self.schedule_render(&output);
} }
fn unset_fullscreen(&mut self, wl_surface: WlSurface) { fn unset_fullscreen(&mut self, wl_surface: WlSurface) {
@ -868,16 +859,7 @@ impl ForeignToplevelHandler for State {
return; return;
}; };
if window.with_state(|state| state.fullscreen_or_maximized.is_fullscreen()) { self.set_window_fullscreen(&window, false);
window.toggle_fullscreen();
}
let Some(output) = window.output(&self.pinnacle) else {
return;
};
self.pinnacle.request_layout(&output);
self.schedule_render(&output);
} }
fn set_maximized(&mut self, wl_surface: WlSurface) { fn set_maximized(&mut self, wl_surface: WlSurface) {
@ -885,16 +867,7 @@ impl ForeignToplevelHandler for State {
return; return;
}; };
if !window.with_state(|state| state.fullscreen_or_maximized.is_maximized()) { self.set_window_maximized(&window, true);
window.toggle_maximized();
}
let Some(output) = window.output(&self.pinnacle) else {
return;
};
self.pinnacle.request_layout(&output);
self.schedule_render(&output);
} }
fn unset_maximized(&mut self, wl_surface: WlSurface) { fn unset_maximized(&mut self, wl_surface: WlSurface) {
@ -902,16 +875,7 @@ impl ForeignToplevelHandler for State {
return; return;
}; };
if window.with_state(|state| state.fullscreen_or_maximized.is_maximized()) { self.set_window_maximized(&window, false);
window.toggle_maximized();
}
let Some(output) = window.output(&self.pinnacle) else {
return;
};
self.pinnacle.request_layout(&output);
self.schedule_render(&output);
} }
fn set_minimized(&mut self, wl_surface: WlSurface) { fn set_minimized(&mut self, wl_surface: WlSurface) {