From 51fdb8200a0a74f4b0accf54cc47fc57ead22262 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 20 Jul 2019 19:11:00 +0530 Subject: [PATCH] X11: Fix focus events not being filtered From upstream: https://github.com/glfw/glfw/commit/c6b95e3b07b9c20d9adae2ddebf69706540180de --- glfw/x11_window.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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);