From db4afc240820b541bc433b76840633d2170817b9 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Thu, 29 Jul 2021 23:03:14 +0300 Subject: xdg-surface: add pending state struct wlr_xdg_surface_state is introduced to hold the geometry and configure serial to be applied on next wl_surface.commit. This commit fixes our handling for ack_configure: instead of making the request mutate our current state, it mutates the pending state only. Co-authored-by: Simon Ser --- include/wlr/types/wlr_xdg_shell.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index 2ca7e203..c214769a 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -161,6 +161,11 @@ struct wlr_xdg_surface_configure { struct wlr_xdg_toplevel_configure *toplevel_configure; }; +struct wlr_xdg_surface_state { + uint32_t configure_serial; + struct wlr_box geometry; +}; + /** * An xdg-surface is a user interface element requiring management by the * compositor. An xdg-surface alone isn't useful, a role should be assigned to @@ -191,10 +196,10 @@ struct wlr_xdg_surface { uint32_t configure_next_serial; struct wl_list configure_list; - bool has_next_geometry; - struct wlr_box next_geometry; struct wlr_box geometry; + struct wlr_xdg_surface_state pending; + struct wl_listener surface_destroy; struct wl_listener surface_commit; -- cgit v1.2.3