summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2009-09-27 18:25:57 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2009-09-27 18:25:57 -0700
commitceaa5c779ceed3de5ea53727649613be3133b24e (patch)
tree8d44e47f81581c1a395f44cf8e7c32509f6103ae
parenta3dbde2de87ee4f577748a8c447501a3ea462559 (diff)
XQuartz: Force a keymap resync on the first keypress to workaround XKB mucking with our keymap.
We need to find a better way to work with XKB on this.
-rw-r--r--hw/xquartz/X11Application.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 9fb192648..3cf7a7799 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1180,6 +1180,17 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
1180 break; 1180 break;
1181 1181
1182 case NSKeyDown: case NSKeyUp: 1182 case NSKeyDown: case NSKeyUp:
1183 {
1184 /* XKB clobbers our keymap at startup, so we need to force it on the first keypress.
1185 * TODO: Make this less of a kludge.
1186 */
1187 static int force_resync_keymap = YES;
1188 if(force_resync_keymap) {
1189 DarwinSendDDXEvent(kXquartzReloadKeymap, 0);
1190 force_resync_keymap = NO;
1191 }
1192 }
1193
1183 if(darwinSyncKeymap) { 1194 if(darwinSyncKeymap) {
1184#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 1195#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
1185 TISInputSourceRef key_layout = TISCopyCurrentKeyboardLayoutInputSource(); 1196 TISInputSourceRef key_layout = TISCopyCurrentKeyboardLayoutInputSource();