X11: Don't ignore keyboard mapping changes.

MappingNotify events don't have a window associated with them, so SDL was
dropping these before the point where we would have handled them.
This commit is contained in:
Ryan C. Gordon 2015-06-30 14:39:39 -04:00
parent 4986563d2f
commit acdb494ffd
1 changed files with 7 additions and 10 deletions

View File

@ -642,11 +642,17 @@ X11_DispatchEvent(_THIS)
} }
} }
if (!data) { if (!data) {
/* The window for KeymapNotify events is 0 */ /* The window for KeymapNotify, etc events is 0 */
if (xevent.type == KeymapNotify) { if (xevent.type == KeymapNotify) {
if (SDL_GetKeyboardFocus() != NULL) { if (SDL_GetKeyboardFocus() != NULL) {
X11_ReconcileKeyboardState(_this); X11_ReconcileKeyboardState(_this);
} }
} else if (xevent.type == MappingNotify) {
/* Has the keyboard layout changed? */
#ifdef DEBUG_XEVENTS
printf("window %p: MappingNotify!\n", data);
#endif
X11_UpdateKeymap(_this);
} }
return; return;
} }
@ -762,15 +768,6 @@ X11_DispatchEvent(_THIS)
} }
break; break;
/* Has the keyboard layout changed? */
case MappingNotify:{
#ifdef DEBUG_XEVENTS
printf("window %p: MappingNotify!\n", data);
#endif
X11_UpdateKeymap(_this);
}
break;
/* Key press? */ /* Key press? */
case KeyPress:{ case KeyPress:{
KeyCode keycode = xevent.xkey.keycode; KeyCode keycode = xevent.xkey.keycode;