fix: if the new configure matches, don't overwrite state with None

This commit is contained in:
Ashley Wulber 2025-12-05 16:35:22 -05:00
parent ec30b8004f
commit 6c9a2d4e9b
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
2 changed files with 4 additions and 6 deletions

View file

@ -395,7 +395,7 @@ impl EventLoop {
app.window_event(&self.active_event_loop, window_id, event);
}
if compositor_update.xdg_window_state.is_some() {
if compositor_update.xdg_window_state.take().is_some() {
let event = WindowEvent::WindowStateChanged;
app.window_event(&self.active_event_loop, window_id, event);
}

View file

@ -313,11 +313,9 @@ impl WindowHandler for WinitState {
self.window_compositor_updates[pos].suggested_bounds |= configure.suggested_bounds
!= winit_window.last_configure.as_ref().and_then(|last| last.suggested_bounds);
self.window_compositor_updates[pos].xdg_window_state = winit_window
.last_configure
.as_ref()
.is_none_or(|last| last.state != configure.state)
.then_some(configure.state);
if winit_window.last_configure.as_ref().is_none_or(|last| last.state != configure.state) {
self.window_compositor_updates[pos].xdg_window_state = Some(configure.state);
}
self.window_compositor_updates[pos].resized |=
winit_window.configure(configure, &self.shm, &self.subcompositor_state);