Navigation Menu

Skip to content

Commit

Permalink
X11: Don't ignore keyboard mapping changes.
Browse files Browse the repository at this point in the history
MappingNotify events don't have a window associated with them, so SDL was
dropping these before the point where we would have handled them.
  • Loading branch information
icculus committed Jun 30, 2015
1 parent 4986563 commit acdb494
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/video/x11/SDL_x11events.c
Expand Up @@ -642,11 +642,17 @@ X11_DispatchEvent(_THIS)
}
}
if (!data) {
/* The window for KeymapNotify events is 0 */
/* The window for KeymapNotify, etc events is 0 */
if (xevent.type == KeymapNotify) {
if (SDL_GetKeyboardFocus() != NULL) {
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;
}
Expand Down Expand Up @@ -762,15 +768,6 @@ X11_DispatchEvent(_THIS)
}
break;

/* Has the keyboard layout changed? */
case MappingNotify:{
#ifdef DEBUG_XEVENTS
printf("window %p: MappingNotify!\n", data);
#endif
X11_UpdateKeymap(_this);
}
break;

/* Key press? */
case KeyPress:{
KeyCode keycode = xevent.xkey.keycode;
Expand Down

0 comments on commit acdb494

Please sign in to comment.