diff options
author | marha <marha@users.sourceforge.net> | 2014-03-21 19:36:05 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-03-21 19:36:05 +0100 |
commit | 41fea4472dec859ddec76bdfa7108ebec71de1e3 (patch) | |
tree | 385ccec6dc105acc75169122d4e0714046cfbbd5 /xorg-server/xkb/xkbInit.c | |
parent | cd8b0d0de3fcb53f6d3ece8ce26d97aaab2c0914 (diff) | |
download | vcxsrv-41fea4472dec859ddec76bdfa7108ebec71de1e3.tar.gz vcxsrv-41fea4472dec859ddec76bdfa7108ebec71de1e3.tar.bz2 vcxsrv-41fea4472dec859ddec76bdfa7108ebec71de1e3.zip |
xserver fontconfig libX11 libXext libxcb mesa git update 21 Mar 2014
xserver commit 4fb31e4824d46edc80bb49b4065152899faa5ac6
libxcb commit cb686b576739deea00180c54697c8b62b8419ae0
libX11 commit 8be4610939b833587954957f5963eb4191b43d19
libXext commit 11aad96bd689d54156064d2e81213dc827a689d1
fontconfig commit 5478192f379d784b421329e4bf72cc780818e467
mesa commit 8d8d0cb09eb8735a04fc36cc4d0e2dc9f9d460eb
Diffstat (limited to 'xorg-server/xkb/xkbInit.c')
-rw-r--r-- | xorg-server/xkb/xkbInit.c | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/xorg-server/xkb/xkbInit.c b/xorg-server/xkb/xkbInit.c index 33420b6b6..06ec46e81 100644 --- a/xorg-server/xkb/xkbInit.c +++ b/xorg-server/xkb/xkbInit.c @@ -505,9 +505,10 @@ XkbInitControls(DeviceIntPtr pXDev, XkbSrvInfoPtr xkbi) return Success; } -_X_EXPORT Bool -InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, - BellProcPtr bell_func, KbdCtrlProcPtr ctrl_func) +static Bool +InitKeyboardDeviceStructInternal(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, + const char *keymap, int keymap_length, + BellProcPtr bell_func, KbdCtrlProcPtr ctrl_func) { int i; unsigned int check; @@ -521,8 +522,9 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, BUG_RETURN_VAL(dev == NULL, FALSE); BUG_RETURN_VAL(dev->key != NULL, FALSE); BUG_RETURN_VAL(dev->kbdfeed != NULL, FALSE); + BUG_RETURN_VAL(rmlvo && keymap, FALSE); - if (!rmlvo) { + if (!rmlvo && !keymap) { rmlvo = &rmlvo_dflts; XkbGetRulesDflts(rmlvo); } @@ -550,7 +552,7 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, } dev->key->xkbInfo = xkbi; - if (xkb_cached_map && !XkbCompareUsedRMLVO(rmlvo)) { + if (xkb_cached_map && (keymap || (rmlvo && !XkbCompareUsedRMLVO(rmlvo)))) { XkbFreeKeyboard(xkb_cached_map, XkbAllComponentsMask, TRUE); xkb_cached_map = NULL; } @@ -558,7 +560,11 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, if (xkb_cached_map) LogMessageVerb(X_INFO, 4, "XKB: Reusing cached keymap\n"); else { - xkb_cached_map = XkbCompileKeymap(dev, rmlvo); + if (rmlvo) + xkb_cached_map = XkbCompileKeymap(dev, rmlvo); + else + xkb_cached_map = XkbCompileKeymapFromString(dev, keymap, keymap_length); + if (!xkb_cached_map) { ErrorF("XKB: Failed to compile keymap\n"); goto unwind_info; @@ -627,8 +633,10 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, dev->kbdfeed->CtrlProc(dev, &dev->kbdfeed->ctrl); - XkbSetRulesDflts(rmlvo); - XkbSetRulesUsed(rmlvo); + if (rmlvo) { + XkbSetRulesDflts(rmlvo); + XkbSetRulesUsed(rmlvo); + } XkbFreeRMLVOSet(&rmlvo_dflts, FALSE); return TRUE; @@ -647,6 +655,24 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, return FALSE; } +_X_EXPORT Bool +InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, + BellProcPtr bell_func, KbdCtrlProcPtr ctrl_func) +{ + return InitKeyboardDeviceStructInternal(dev, rmlvo, + NULL, 0, bell_func, ctrl_func); +} + +_X_EXPORT Bool +InitKeyboardDeviceStructFromString(DeviceIntPtr dev, + const char *keymap, int keymap_length, + BellProcPtr bell_func, KbdCtrlProcPtr ctrl_func) +{ + return InitKeyboardDeviceStructInternal(dev, NULL, + keymap, keymap_length, + bell_func, ctrl_func); +} + /***====================================================================***/ /* |