From 38d28929063c8b69d5e520ade3833936f791f29a Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 26 May 2024 15:11:48 +0900 Subject: [PATCH] internal/glfw: bug fix: the cursor position was reset unexpectedly There was a mistake when updating GLFW to v3.3.9 at 4647e9de53bbe1c54dc125fd6e7dfc6aa16baddc. When the cursor mode is set to be enabled, the cursor position was unexpectedly reset. This change fixes the issue. Closes #2997 --- internal/glfw/win32_window_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/glfw/win32_window_windows.go b/internal/glfw/win32_window_windows.go index 6fcb33356..081aff4fe 100644 --- a/internal/glfw/win32_window_windows.go +++ b/internal/glfw/win32_window_windows.go @@ -2309,7 +2309,7 @@ func (w *Window) platformSetCursorMode(mode int) error { if mode == CursorDisabled { _glfw.platformWindow.disabledCursorWindow = w - } else { + } else if _glfw.platformWindow.disabledCursorWindow == w { _glfw.platformWindow.disabledCursorWindow = nil if err := w.platformSetCursorPos(_glfw.platformWindow.restoreCursorPosX, _glfw.platformWindow.restoreCursorPosY); err != nil { return err