From 28d4c9e9f4baebcfe6a8fe8cf1363aad5eff3b80 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 31 May 2016 13:03:59 +0200 Subject: [PATCH] X11: Re-enable cursor for all types of FocusOut This prevents disabled cursor mode from interfering with window frame interactions. Related to #650. --- 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 4f095b4f..41d5967c 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -1367,6 +1367,9 @@ static void processEvent(XEvent *event) case FocusIn: { + if (window->cursorMode == GLFW_CURSOR_DISABLED) + _glfwPlatformSetCursorMode(window, GLFW_CURSOR_DISABLED); + if (event->xfocus.mode == NotifyGrab || event->xfocus.mode == NotifyUngrab) { @@ -1378,15 +1381,15 @@ static void processEvent(XEvent *event) if (window->x11.ic) XSetICFocus(window->x11.ic); - if (window->cursorMode == GLFW_CURSOR_DISABLED) - _glfwPlatformSetCursorMode(window, GLFW_CURSOR_DISABLED); - _glfwInputWindowFocus(window, GLFW_TRUE); return; } case FocusOut: { + if (window->cursorMode == GLFW_CURSOR_DISABLED) + _glfwPlatformSetCursorMode(window, GLFW_CURSOR_NORMAL); + if (event->xfocus.mode == NotifyGrab || event->xfocus.mode == NotifyUngrab) { @@ -1398,9 +1401,6 @@ static void processEvent(XEvent *event) if (window->x11.ic) XUnsetICFocus(window->x11.ic); - if (window->cursorMode == GLFW_CURSOR_DISABLED) - _glfwPlatformSetCursorMode(window, GLFW_CURSOR_NORMAL); - if (window->monitor && window->autoIconify) _glfwPlatformIconifyWindow(window);