diff --git a/glfw/x11_window.c b/glfw/x11_window.c index f8a9890b4..79cc7c0ee 100644 --- a/glfw/x11_window.c +++ b/glfw/x11_window.c @@ -1586,9 +1586,6 @@ static void processEvent(XEvent *event) case FocusIn: { - if (window->cursorMode == GLFW_CURSOR_DISABLED) - disableCursor(window); - if (event->xfocus.mode == NotifyGrab || event->xfocus.mode == NotifyUngrab) { @@ -1597,15 +1594,15 @@ static void processEvent(XEvent *event) return; } + if (window->cursorMode == GLFW_CURSOR_DISABLED) + disableCursor(window); + _glfwInputWindowFocus(window, true); return; } case FocusOut: { - if (window->cursorMode == GLFW_CURSOR_DISABLED) - enableCursor(window); - if (event->xfocus.mode == NotifyGrab || event->xfocus.mode == NotifyUngrab) { @@ -1614,6 +1611,9 @@ static void processEvent(XEvent *event) return; } + if (window->cursorMode == GLFW_CURSOR_DISABLED) + enableCursor(window); + if (window->monitor && window->autoIconify) _glfwPlatformIconifyWindow(window);