diff --git a/glfw/wl_platform.h b/glfw/wl_platform.h index d773eb989..fb51392ae 100644 --- a/glfw/wl_platform.h +++ b/glfw/wl_platform.h @@ -186,7 +186,7 @@ typedef struct _GLFWwindowWayland } layer_shell; struct { - int width, height; + int width, height, dirty; } framebuffer_size_at_last_resize; /* information about axis events on current frame */ struct diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 781203ad5..dfe869e65 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -379,12 +379,16 @@ resizeFramebuffer(_GLFWwindow* window) { wait_for_swap_to_commit(window); window->wl.framebuffer_size_at_last_resize.width = scaled_width; window->wl.framebuffer_size_at_last_resize.height = scaled_height; + window->wl.framebuffer_size_at_last_resize.dirty = true; _glfwInputFramebufferSize(window, scaled_width, scaled_height); } void _glfwWaylandBeforeBufferSwap(_GLFWwindow* window) { - wl_egl_window_resize(window->wl.native, window->wl.framebuffer_size_at_last_resize.width, window->wl.framebuffer_size_at_last_resize.height, 0, 0); + if (window->wl.framebuffer_size_at_last_resize.dirty) { + wl_egl_window_resize(window->wl.native, window->wl.framebuffer_size_at_last_resize.width, window->wl.framebuffer_size_at_last_resize.height, 0, 0); + window->wl.framebuffer_size_at_last_resize.dirty = false; + } } void