From af6baa33be39193d19082ffd1e3ce20a23939616 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 1 Mar 2022 07:59:17 +0530 Subject: [PATCH] Ignore out of order surface configure events --- glfw/wl_platform.h | 1 + glfw/wl_window.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/glfw/wl_platform.h b/glfw/wl_platform.h index f33787c73..7d8e72200 100644 --- a/glfw/wl_platform.h +++ b/glfw/wl_platform.h @@ -219,6 +219,7 @@ typedef struct _GLFWwindowWayland struct { int width, height; uint32_t toplevel_states; + bool set; } current, pending; } _GLFWwindowWayland; diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 17081eb40..ccde713a1 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -479,6 +479,7 @@ xdgToplevelHandleConfigure(void* data, window->wl.pending.toplevel_states = new_states; window->wl.pending.width = width; window->wl.pending.height = height; + window->wl.pending.set = true; } static void xdgToplevelHandleClose(void* data, @@ -499,7 +500,8 @@ static void xdgSurfaceHandleConfigure(void* data, { _GLFWwindow* window = data; xdg_surface_ack_configure(surface, serial); - + if (!window->wl.pending.set) return; + uint32_t new_states = window->wl.pending.toplevel_states; int width = window->wl.pending.width; @@ -509,6 +511,7 @@ static void xdgSurfaceHandleConfigure(void* data, width != window->wl.current.width || height != window->wl.current.height) { + window->wl.pending.set = false; bool live_resize_done = !(new_states & TOPLEVEL_STATE_RESIZING) && (window->wl.current.toplevel_states & TOPLEVEL_STATE_RESIZING); window->wl.current.toplevel_states = new_states; set_csd_window_geometry(window, &width, &height);