From 6ff9e2b44cee834aa4a0c1e45deeb237c533f0c3 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 14 Apr 2024 14:30:04 +0900 Subject: [PATCH] internal/glfw: bug fix: too early event emitting This change applies the bug fix at glfw/glfw#2046. --- internal/glfw/x11_window_linbsd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/glfw/x11_window_linbsd.c b/internal/glfw/x11_window_linbsd.c index 23e88a06f..db3f04bd8 100644 --- a/internal/glfw/x11_window_linbsd.c +++ b/internal/glfw/x11_window_linbsd.c @@ -1600,6 +1600,9 @@ static void processEvent(XEvent *event) if (event->xconfigure.width != window->x11.width || event->xconfigure.height != window->x11.height) { + window->x11.width = event->xconfigure.width; + window->x11.height = event->xconfigure.height; + _glfwInputFramebufferSize(window, event->xconfigure.width, event->xconfigure.height); @@ -1607,9 +1610,6 @@ static void processEvent(XEvent *event) _glfwInputWindowSize(window, event->xconfigure.width, event->xconfigure.height); - - window->x11.width = event->xconfigure.width; - window->x11.height = event->xconfigure.height; } int xpos = event->xconfigure.x; @@ -1637,9 +1637,10 @@ static void processEvent(XEvent *event) if (xpos != window->x11.xpos || ypos != window->x11.ypos) { - _glfwInputWindowPos(window, xpos, ypos); window->x11.xpos = xpos; window->x11.ypos = ypos; + + _glfwInputWindowPos(window, xpos, ypos); } return;