libweston-desktop/xdg-shell: Check surface size against acknowledged size
We were checking against the pending size, which lead some clients
(simple-egl) to crash because they sent a buffer before acknowledging
the latest configure event.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com>
diff --git a/libweston-desktop/xdg-shell-v5.c b/libweston-desktop/xdg-shell-v5.c
index 0fb067a..b32b781 100644
--- a/libweston-desktop/xdg-shell-v5.c
+++ b/libweston-desktop/xdg-shell-v5.c
@@ -60,6 +60,7 @@
} pending;
struct {
struct weston_desktop_xdg_surface_state state;
+ struct weston_size size;
} next;
struct {
struct weston_desktop_xdg_surface_state state;
@@ -244,8 +245,8 @@
bool reconfigure = false;
if (surface->next.state.maximized || surface->next.state.fullscreen)
- reconfigure = surface->pending.size.width != wsurface->width ||
- surface->pending.size.height != wsurface->height;
+ reconfigure = surface->next.size.width != wsurface->width ||
+ surface->next.size.height != wsurface->height;
if (reconfigure) {
weston_desktop_xdg_surface_schedule_configure(surface, true);
@@ -447,6 +448,7 @@
return;
surface->next.state = surface->pending.state;
+ surface->next.size = surface->pending.size;
}
static void