Skip to content

Commit

Permalink
X11: Fix focus events not being filtered
Browse files Browse the repository at this point in the history
The filter condition had ended up below the action.

(cherry picked from commit c6b95e3)
  • Loading branch information
elmindreda committed Jul 16, 2019
1 parent 633ba53 commit 84fa724
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/x11_window.c
Expand Up @@ -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)
{
Expand All @@ -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);

Expand All @@ -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)
{
Expand All @@ -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);

Expand Down

0 comments on commit 84fa724

Please sign in to comment.