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...
This commit is contained in:
parent
61abf3189f
commit
c7c50157b5
|
@ -296,12 +296,13 @@ static void DarwinLoadKeyboardMapping(KeySymsRec *keySyms) {
|
||||||
static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms, CARD8 *modmap) {
|
static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms, CARD8 *modmap) {
|
||||||
DeviceIntPtr pDev;
|
DeviceIntPtr pDev;
|
||||||
|
|
||||||
|
pthread_mutex_lock(&keyInfo_mutex);
|
||||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||||
if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key)
|
if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key)
|
||||||
XkbApplyMappingChange(pDev, XkbKeySymsMask | XkbModifierMapMask,
|
XkbApplyMappingChange(pDev, keySyms, keySyms->minKeyCode,
|
||||||
keysyms, keysyms.minKeyCode,
|
keySyms->maxKeyCode - keySyms->minKeyCode + 1,
|
||||||
keysyms.maxKeyCode - keysyms.minKeyCode + 1,
|
|
||||||
modmap, serverClient);
|
modmap, serverClient);
|
||||||
|
pthread_mutex_unlock(&keyInfo_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -315,6 +316,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
|
||||||
XkbComponentNamesRec names;
|
XkbComponentNamesRec names;
|
||||||
CFIndex value;
|
CFIndex value;
|
||||||
BOOL ok;
|
BOOL ok;
|
||||||
|
XkbRMLVOSet rmlvo;
|
||||||
|
|
||||||
// Open a shared connection to the HID System.
|
// Open a shared connection to the HID System.
|
||||||
// Note that the Event Status Driver is really just a wrapper
|
// Note that the Event Status Driver is really just a wrapper
|
||||||
|
@ -325,20 +327,9 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
|
||||||
|
|
||||||
bzero(&names, sizeof(names));
|
bzero(&names, sizeof(names));
|
||||||
|
|
||||||
/* We need to really have rules... or something... */
|
XkbGetRulesDflts(&rmlvo);
|
||||||
//XkbSetRulesDflts("base", "pc105", "us", NULL, NULL);
|
InitKeyboardDeviceStruct(pDev, &rmlvo, QuartzBell,
|
||||||
|
DarwinChangeKeyboardControl);
|
||||||
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);
|
|
||||||
|
|
||||||
/* Get our key repeat settings from GlobalPreferences */
|
/* Get our key repeat settings from GlobalPreferences */
|
||||||
(void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
|
(void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
|
||||||
|
@ -366,13 +357,13 @@ void DarwinKeyboardReloadHandler(int screenNum, xEventPtr xe, DeviceIntPtr pDev,
|
||||||
KeySymsRec keySyms;
|
KeySymsRec keySyms;
|
||||||
|
|
||||||
DEBUG_LOG("DarwinKeyboardReloadHandler\n");
|
DEBUG_LOG("DarwinKeyboardReloadHandler\n");
|
||||||
if (pDev->key) {
|
// if (pDev->key) {
|
||||||
if (pDev->key->curKeySyms.map) xfree(pDev->key->curKeySyms.map);
|
// if (pDev->key->curKeySyms.map) xfree(pDev->key->curKeySyms.map);
|
||||||
xfree(pDev->key);
|
// xfree(pDev->key);
|
||||||
}
|
// }
|
||||||
|
|
||||||
DarwinLoadKeyboardMapping(&keySyms);
|
DarwinLoadKeyboardMapping(&keySyms);
|
||||||
DarwinKeyboardSetDeviceKeyMap(&keySyms);
|
DarwinKeyboardSetDeviceKeyMap(&keySyms, keyInfo.modMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue