From 9cb64b9a7f9b4ad2b5c308f85b191078c1b8d031 Mon Sep 17 00:00:00 2001 From: Christian Meissl Date: Thu, 13 Jan 2022 20:24:18 +0100 Subject: [PATCH] track if a popup has been committed --- src/wayland/shell/xdg/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wayland/shell/xdg/mod.rs b/src/wayland/shell/xdg/mod.rs index cc6f4a3..a70c928 100644 --- a/src/wayland/shell/xdg/mod.rs +++ b/src/wayland/shell/xdg/mod.rs @@ -383,6 +383,14 @@ xdg_role!( /// It is a protocol error to call commit on a wl_surface with /// the xdg_popup role when no parent is set. pub parent: Option, + + /// Defines if the surface has received at least one commit + /// + /// This can be used to check for protocol errors, like + /// checking if a popup requested a grab after it has been + /// mapped. + pub committed: bool, + popup_handle: Option } ); @@ -1399,6 +1407,7 @@ impl PopupSurface { .unwrap() .lock() .unwrap(); + attributes.committed = true; if attributes.initial_configure_sent { if let Some(state) = attributes.last_acked { if state != attributes.current {