From 84fa724456cd2d66ee4356b6a349fb2fb28205f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 11 Jul 2019 00:36:34 +0200 Subject: [PATCH] X11: Fix focus events not being filtered The filter condition had ended up below the action. (cherry picked from commit c6b95e3b07b9c20d9adae2ddebf69706540180de) --- src/x11_window.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/x11_window.c b/src/x11_window.c index dc8c1e93..2eeaf572 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -1746,9 +1746,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) { @@ -1757,6 +1754,9 @@ static void processEvent(XEvent *event) return; } + if (window->cursorMode == GLFW_CURSOR_DISABLED) + disableCursor(window); + if (window->x11.ic) XSetICFocus(window->x11.ic); @@ -1766,9 +1766,6 @@ static void processEvent(XEvent *event) case FocusOut: { - if (window->cursorMode == GLFW_CURSOR_DISABLED) - enableCursor(window); - if (event->xfocus.mode == NotifyGrab || event->xfocus.mode == NotifyUngrab) { @@ -1777,6 +1774,9 @@ static void processEvent(XEvent *event) return; } + if (window->cursorMode == GLFW_CURSOR_DISABLED) + enableCursor(window); + if (window->x11.ic) XUnsetICFocus(window->x11.ic);