mirror of
https://github.com/glfw/glfw.git
synced 2024-11-11 13:03:52 +00:00
X11: Fix focus events not being filtered
The filter condition had ended up below the action.
(cherry picked from commit c6b95e3b07
)
This commit is contained in:
parent
633ba53f2c
commit
84fa724456
@ -1746,9 +1746,6 @@ static void processEvent(XEvent *event)
|
|||||||
|
|
||||||
case FocusIn:
|
case FocusIn:
|
||||||
{
|
{
|
||||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
|
||||||
disableCursor(window);
|
|
||||||
|
|
||||||
if (event->xfocus.mode == NotifyGrab ||
|
if (event->xfocus.mode == NotifyGrab ||
|
||||||
event->xfocus.mode == NotifyUngrab)
|
event->xfocus.mode == NotifyUngrab)
|
||||||
{
|
{
|
||||||
@ -1757,6 +1754,9 @@ static void processEvent(XEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||||
|
disableCursor(window);
|
||||||
|
|
||||||
if (window->x11.ic)
|
if (window->x11.ic)
|
||||||
XSetICFocus(window->x11.ic);
|
XSetICFocus(window->x11.ic);
|
||||||
|
|
||||||
@ -1766,9 +1766,6 @@ static void processEvent(XEvent *event)
|
|||||||
|
|
||||||
case FocusOut:
|
case FocusOut:
|
||||||
{
|
{
|
||||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
|
||||||
enableCursor(window);
|
|
||||||
|
|
||||||
if (event->xfocus.mode == NotifyGrab ||
|
if (event->xfocus.mode == NotifyGrab ||
|
||||||
event->xfocus.mode == NotifyUngrab)
|
event->xfocus.mode == NotifyUngrab)
|
||||||
{
|
{
|
||||||
@ -1777,6 +1774,9 @@ static void processEvent(XEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||||
|
enableCursor(window);
|
||||||
|
|
||||||
if (window->x11.ic)
|
if (window->x11.ic)
|
||||||
XUnsetICFocus(window->x11.ic);
|
XUnsetICFocus(window->x11.ic);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user