xdg-shell: add support for cached xdg_surface state

When the pending surface state becomes cached, also cache the
pending xdg_surface state. When a cached surface state becomes
current, also make the matching cached xdg_surface state current.

References: https://github.com/swaywm/wlroots/issues/2957
This commit is contained in:
Simon Ser 2021-06-18 18:25:51 +02:00
parent 0f9ecac3cb
commit 9c3163df7a
2 changed files with 84 additions and 15 deletions

View file

@ -149,6 +149,14 @@ struct wlr_xdg_surface_configure {
struct wlr_xdg_toplevel_state *toplevel_state;
};
struct wlr_xdg_surface_state {
bool has_geometry;
struct wlr_box geometry;
uint32_t seq;
struct wl_list cached_state_link;
};
/**
* 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
@ -179,12 +187,14 @@ 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_list cached;
struct wl_listener surface_destroy;
struct wl_listener surface_commit;
struct wl_listener surface_cache;
struct {
struct wl_signal destroy;