diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-09-27 18:25:57 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-09-27 23:24:59 -0700 |
commit | 11ea4b47c2edc771c83e4e9128d5cc0c7fec54f7 (patch) | |
tree | 4f4eff454cd29bc57b74127fcdafd6ea2d7c03f5 /hw | |
parent | a7a499a48ed965f2253608e7c2a1b10a47092553 (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.
(cherry picked from commit ceaa5c779ceed3de5ea53727649613be3133b24e)
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xquartz/X11Application.m | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 6ade527bd..aca4d879b 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -1181,6 +1181,17 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe break; case NSKeyDown: case NSKeyUp: + { + /* XKB clobbers our keymap at startup, so we need to force it on the first keypress. + * TODO: Make this less of a kludge. + */ + static int force_resync_keymap = YES; + if(force_resync_keymap) { + DarwinSendDDXEvent(kXquartzReloadKeymap, 0); + force_resync_keymap = NO; + } + } + if(darwinSyncKeymap) { #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 TISInputSourceRef key_layout = TISCopyCurrentKeyboardLayoutInputSource(); |