From 15a3bbcbd9b49035b71717c88e48aaea00db2953 Mon Sep 17 00:00:00 2001 From: Gabriel Jacobo Date: Sun, 10 Nov 2013 20:38:50 -0300 Subject: [PATCH] [X11] Ignore both NotifyGrab and NotifyUngrab modes in FocusIn/FocusOut events --- src/video/x11/SDL_x11events.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 59642f308..423bd87d3 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -399,6 +399,14 @@ X11_DispatchEvent(_THIS) /* Gaining input focus? */ case FocusIn:{ + if (xevent.xfocus.mode == NotifyGrab || xevent.xfocus.mode == NotifyUngrab) { + /* Someone is handling a global hotkey, ignore it */ +#ifdef DEBUG_XEVENTS + printf("window %p: FocusIn (NotifyGrab/NotifyUngrab, ignoring)\n", data); +#endif + break; + } + if (xevent.xfocus.detail == NotifyInferior) { #ifdef DEBUG_XEVENTS printf("window %p: FocusIn (NotifierInferior, ignoring)\n", data); @@ -428,10 +436,10 @@ X11_DispatchEvent(_THIS) /* Losing input focus? */ case FocusOut:{ - if (xevent.xfocus.mode == NotifyGrab) { + if (xevent.xfocus.mode == NotifyGrab || xevent.xfocus.mode == NotifyUngrab) { /* Someone is handling a global hotkey, ignore it */ #ifdef DEBUG_XEVENTS - printf("window %p: FocusOut (NotifyGrab, ignoring)\n", data); + printf("window %p: FocusOut (NotifyGrab/NotifyUngrab, ignoring)\n", data); #endif break; }