diff --git a/src/input.c b/src/input.c index b1ed02f5..e3700700 100644 --- a/src/input.c +++ b/src/input.c @@ -55,7 +55,7 @@ static void setCursorMode(_GLFWwindow* window, int newMode) window->cursorMode = newMode; - if (window == _glfw.focusedWindow) + if (_glfw.focusedWindow == window) { if (oldMode == GLFW_CURSOR_DISABLED) { diff --git a/src/window.c b/src/window.c index 561671e1..dcb7d003 100644 --- a/src/window.c +++ b/src/window.c @@ -425,7 +425,7 @@ GLFWAPI void glfwDestroyWindow(GLFWwindow* handle) _glfwPlatformMakeContextCurrent(NULL); // Clear the focused window pointer if this is the focused window - if (window == _glfw.focusedWindow) + if (_glfw.focusedWindow == window) _glfw.focusedWindow = NULL; _glfwPlatformDestroyWindow(window);