Ignore out of order surface configure events

This commit is contained in:
Kovid Goyal
2022-03-01 07:59:17 +05:30
parent 1096cbe236
commit af6baa33be
2 changed files with 5 additions and 1 deletions

1
glfw/wl_platform.h vendored
View File

@@ -219,6 +219,7 @@ typedef struct _GLFWwindowWayland
struct {
int width, height;
uint32_t toplevel_states;
bool set;
} current, pending;
} _GLFWwindowWayland;

5
glfw/wl_window.c vendored
View File

@@ -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);