internal/glfw: bug fix: the cursor position was reset unexpectedly

There was a mistake when updating GLFW to v3.3.9 at 4647e9de53.
When the cursor mode is set to be enabled, the cursor position was
unexpectedly reset. This change fixes the issue.

Closes #2997
This commit is contained in:
Hajime Hoshi 2024-05-26 15:11:48 +09:00
parent 5942192b66
commit 38d2892906

View File

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