Skip to content

Commit

Permalink
xdg: Store serial corresponding to the current state
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR authored and Drakulix committed Dec 23, 2024
1 parent 5587627 commit 0053864
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/wayland/shell/xdg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Serial>,
/// Does the surface have a buffer (updated on every commit)
has_buffer: bool,

Expand Down Expand Up @@ -294,6 +297,7 @@ macro_rules! xdg_role {
server_pending: None,
last_acked: None,
current: Default::default(),
current_serial: None,
has_buffer: false,

$(
Expand Down Expand Up @@ -1603,6 +1607,7 @@ impl ToplevelSurface {

if let Some(state) = guard.last_acked.clone() {
guard.current = state;
guard.current_serial = guard.configure_serial;
}
});
}
Expand Down Expand Up @@ -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;
}
}
});
Expand Down

0 comments on commit 0053864

Please sign in to comment.