From c5da21984703a08d5f296aec4053cecc5869bbb3 Mon Sep 17 00:00:00 2001 From: Greg V Date: Fri, 10 Sep 2021 22:19:56 +0300 Subject: [PATCH] window: do not lose maximized/fullscreen -> default transitions on Wayland Changing surface configuration flags *to* default would never be applied. This was uncovered when implementing increment step resize: it would stop working after *one* maximization. --- window/src/os/wayland/window.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/window/src/os/wayland/window.rs b/window/src/os/wayland/window.rs index 1b037b10a..bd3563755 100644 --- a/window/src/os/wayland/window.rs +++ b/window/src/os/wayland/window.rs @@ -191,13 +191,11 @@ impl PendingEvent { state, states ); - match (self.window_state, state) { - (None, s) if s == WindowState::default() => {} - _ => { - self.window_state.replace(state); - changed = true; - } + if self.window_state.is_none() && state != WindowState::default() { + changed = true; } + // Always set it to avoid losing non-default -> default transitions + self.window_state.replace(state); changed } }