From 2072d59da54ac772410271ad2219ca107a7fff48 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Mon, 20 Jul 2020 23:43:03 +0200 Subject: xdg-shell: split last-acked and current state These states are distinct in the time period between the ack_configure and the next commit on the surface. Splitting these states avoids the following race for example: - client starts at 1000x1000 - wlr_xdg_toplevel_set_size 500x500 - size is different -> configure sent - client acks the configure - wlr_xdg_toplevel_set_size 1000x1000 - compare_xdg_toplevel_state returns true since there is no pending configure and the currently committed size is still 1000x1000 - no new configure is sent - client commits at the size it last acked, 500x500 --- include/wlr/types/wlr_xdg_shell.h | 1 + include/wlr/types/wlr_xdg_shell_v6.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index 4bd286ce..45c5aee0 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -124,6 +124,7 @@ struct wlr_xdg_toplevel { struct wlr_xdg_toplevel_state client_pending; struct wlr_xdg_toplevel_state server_pending; + struct wlr_xdg_toplevel_state last_acked; struct wlr_xdg_toplevel_state current; char *title; diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h index 5a6cf72f..2e870aa5 100644 --- a/include/wlr/types/wlr_xdg_shell_v6.h +++ b/include/wlr/types/wlr_xdg_shell_v6.h @@ -139,6 +139,7 @@ struct wlr_xdg_toplevel_v6 { struct wlr_xdg_toplevel_v6_state client_pending; struct wlr_xdg_toplevel_v6_state server_pending; + struct wlr_xdg_toplevel_v6_state last_acked; struct wlr_xdg_toplevel_v6_state current; char *title; -- cgit v1.2.3