From 005386466103eb4606997a756072e4143e6dfe37 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 21 Dec 2024 11:35:53 +0300 Subject: [PATCH] xdg: Store serial corresponding to the current state --- src/wayland/shell/xdg/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wayland/shell/xdg/mod.rs b/src/wayland/shell/xdg/mod.rs index 18f06fb083a3..29c9929663fe 100644 --- a/src/wayland/shell/xdg/mod.rs +++ b/src/wayland/shell/xdg/mod.rs @@ -204,6 +204,9 @@ macro_rules! xdg_role { pub last_acked: Option<$state>, /// Holds the current state after a successful commit. pub current: $state, + /// Holds the last acked configure serial at the time of the last successful + /// commit. This serial corresponds to the current state. + pub current_serial: Option, /// Does the surface have a buffer (updated on every commit) has_buffer: bool, @@ -294,6 +297,7 @@ macro_rules! xdg_role { server_pending: None, last_acked: None, current: Default::default(), + current_serial: None, has_buffer: false, $( @@ -1603,6 +1607,7 @@ impl ToplevelSurface { if let Some(state) = guard.last_acked.clone() { guard.current = state; + guard.current_serial = guard.configure_serial; } }); } @@ -1994,6 +1999,7 @@ impl PopupSurface { if attributes.initial_configure_sent { if let Some(state) = attributes.last_acked { attributes.current = state; + attributes.current_serial = attributes.configure_serial; } } });