Navigation Menu

Skip to content

Commit

Permalink
[X11] Ignore both NotifyGrab and NotifyUngrab modes in FocusIn/FocusO…
Browse files Browse the repository at this point in the history
…ut events
  • Loading branch information
gabomdq committed Nov 10, 2013
1 parent d21640e commit 15a3bbc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/video/x11/SDL_x11events.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 15a3bbc

Please sign in to comment.