summaryrefslogtreecommitdiff
path: root/hw/xquartz/quartzKeyboard.c
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremy@yuffie.local>2009-02-22 00:29:48 -0800
committerJeremy Huddleston <jeremy@yuffie.local>2009-02-22 00:29:48 -0800
commitc7c50157b5137a147e69abb70b43a28fac4a9ffa (patch)
treee1300ff65e5c75a04f654aa2e094c357c859accf /hw/xquartz/quartzKeyboard.c
parent61abf3189f3f97ec5228d45c035dbfd0c249f844 (diff)
XQuartz: quartzKeyboard compile fixes for recent XKB Changes
Seems we're less divorced from XKB than we'd like for now... hopefully not having any rules installed will still let us override things the way we want to...
Diffstat (limited to 'hw/xquartz/quartzKeyboard.c')
-rw-r--r--hw/xquartz/quartzKeyboard.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 020b6a6ab..a7b6709f4 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -296,12 +296,13 @@ static void DarwinLoadKeyboardMapping(KeySymsRec *keySyms) {
static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms, CARD8 *modmap) {
DeviceIntPtr pDev;
+ pthread_mutex_lock(&keyInfo_mutex);
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key)
- XkbApplyMappingChange(pDev, XkbKeySymsMask | XkbModifierMapMask,
- keysyms, keysyms.minKeyCode,
- keysyms.maxKeyCode - keysyms.minKeyCode + 1,
+ XkbApplyMappingChange(pDev, keySyms, keySyms->minKeyCode,
+ keySyms->maxKeyCode - keySyms->minKeyCode + 1,
modmap, serverClient);
+ pthread_mutex_unlock(&keyInfo_mutex);
}
/*
@@ -315,6 +316,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
XkbComponentNamesRec names;
CFIndex value;
BOOL ok;
+ XkbRMLVOSet rmlvo;
// Open a shared connection to the HID System.
// Note that the Event Status Driver is really just a wrapper
@@ -325,20 +327,9 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
bzero(&names, sizeof(names));
- /* We need to really have rules... or something... */
- //XkbSetRulesDflts("base", "pc105", "us", NULL, NULL);
-
- pthread_mutex_lock(&keyInfo_mutex);
- assert(XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, QuartzBell,
- DarwinChangeKeyboardControl));
- assert(keyInfo.modMap!=NULL);
- pthread_mutex_unlock(&keyInfo_mutex);
-
- pthread_mutex_lock(&keyInfo_mutex);
- assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms,
- QuartzBell,
- DarwinChangeKeyboardControl ));
- pthread_mutex_unlock(&keyInfo_mutex);
+ XkbGetRulesDflts(&rmlvo);
+ InitKeyboardDeviceStruct(pDev, &rmlvo, QuartzBell,
+ DarwinChangeKeyboardControl);
/* Get our key repeat settings from GlobalPreferences */
(void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
@@ -366,13 +357,13 @@ void DarwinKeyboardReloadHandler(int screenNum, xEventPtr xe, DeviceIntPtr pDev,
KeySymsRec keySyms;
DEBUG_LOG("DarwinKeyboardReloadHandler\n");
- if (pDev->key) {
- if (pDev->key->curKeySyms.map) xfree(pDev->key->curKeySyms.map);
- xfree(pDev->key);
- }
+// if (pDev->key) {
+// if (pDev->key->curKeySyms.map) xfree(pDev->key->curKeySyms.map);
+// xfree(pDev->key);
+// }
DarwinLoadKeyboardMapping(&keySyms);
- DarwinKeyboardSetDeviceKeyMap(&keySyms);
+ DarwinKeyboardSetDeviceKeyMap(&keySyms, keyInfo.modMap);
}
//-----------------------------------------------------------------------------