X11: Don't ignore keyboard mapping changes.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 30 Jun 2015 14:39:39 -0400
changeset 9787 08b2895a935a
parent 9786 d857f324bede
child 9788 ecda7d71342e
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.
src/video/x11/SDL_x11events.c
--- a/src/video/x11/SDL_x11events.c	Tue Jun 30 13:46:06 2015 -0400
+++ b/src/video/x11/SDL_x11events.c	Tue Jun 30 14:39:39 2015 -0400
@@ -642,11 +642,17 @@
         }
     }
     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;
     }
@@ -762,15 +768,6 @@
         }
         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;