X11: Fix focus events not being filtered

From upstream: c6b95e3b07
This commit is contained in:
Kovid Goyal 2019-07-20 19:11:00 +05:30
parent fb0d98ead1
commit 51fdb8200a
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

12
glfw/x11_window.c vendored
View file

@ -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);