From 82a5733ec523dc9861e64a8916471d5382f6e041 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 7 Apr 2021 19:55:15 +0530 Subject: [PATCH] _glfwPLatformSetWindowSize() should not be called when handling configure events as it does a bunch of work already done before --- glfw/wl_window.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 9e8362846..8239f5e9d 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -237,13 +237,15 @@ clipboard_mime(void) { return buf; } -static void dispatchChangesAfterConfigure(_GLFWwindow *window, int32_t width, int32_t height) { +static void +dispatchChangesAfterConfigure(_GLFWwindow *window, int32_t width, int32_t height) { bool size_changed = width != window->wl.width || height != window->wl.height; bool scale_changed = checkScaleChange(window); if (size_changed) { _glfwInputWindowSize(window, width, height); - _glfwPlatformSetWindowSize(window, width, height); + window->wl.width = width; window->wl.height = height; + resizeFramebuffer(window); } if (scale_changed) { @@ -448,9 +450,9 @@ static void xdgToplevelHandleConfigure(void* data, bool live_resize_done = !(new_states & TOPLEVEL_STATE_RESIZING) && (window->wl.toplevel_states & TOPLEVEL_STATE_RESIZING); window->wl.toplevel_states = new_states; set_csd_window_geometry(window, &width, &height); - debug("final window content size: %dx%d\n", window->wl.width, window->wl.height); wl_surface_commit(window->wl.surface); dispatchChangesAfterConfigure(window, width, height); + debug("final window content size: %dx%d\n", window->wl.width, window->wl.height); _glfwInputWindowFocus(window, window->wl.toplevel_states & TOPLEVEL_STATE_ACTIVATED); ensure_csd_resources(window); if (live_resize_done) _glfwInputLiveResize(window, false);