fix: Fullscreen request unreachable code crash

caused by a duplication in pending_windows
This commit is contained in:
Nikola Hristov 2025-12-12 17:05:45 +02:00
parent 0116bc0dc2
commit 09bca7a575
3 changed files with 35 additions and 15 deletions

View file

@ -808,14 +808,20 @@ impl XwmHandler for State {
*context,
);
}
let surface = CosmicSurface::from(window);
shell.pending_windows.push(PendingWindow {
surface,
seat,
fullscreen: None,
maximized: false,
});
if shell
.pending_windows
.iter()
.find(|w| w.surface == window)
.is_none()
{
let surface = CosmicSurface::from(window);
shell.pending_windows.push(PendingWindow {
surface,
seat,
fullscreen: None,
maximized: false,
})
}
}
fn map_window_notify(&mut self, _xwm: XwmId, surface: X11Surface) {
@ -875,6 +881,11 @@ impl XwmHandler for State {
let seat = shell.seats.last_active().clone();
if let Some(pending) =
shell.unmap_surface(&window, &seat, &mut self.common.toplevel_info_state)
&& shell
.pending_windows
.iter()
.find(|w| &w.surface == &pending.surface)
.is_none()
{
shell.pending_windows.push(pending);
}