xkb: don't overwrite CtrlProc in the second run of XkbFinishDeviceInit.

XkbFinishDeviceInit is called once when the device is initialised, but also
when a class copy causes the key class of a device to change. In this case, overwriting the CtrlProc of the KeybdFeedbackClass with XkbDDXKeybdCtrlProc sets up a nice recursive loop of XkbDDXKeybdCtrlProc calling itself until the cows come home.
This commit is contained in:
Peter Hutterer 2008-04-08 08:42:58 +09:30
parent fd06e8f8c1
commit 6271df6953

View File

@ -726,7 +726,10 @@ XkbSrvLedInfoPtr sli;
if (pXDev && pXDev->key && pXDev->key->xkbInfo && pXDev->kbdfeed) {
xkbi= pXDev->key->xkbInfo;
xkb= xkbi->desc;
if (pXDev->kbdfeed) {
/* If we come from DeepCopyDeviceClasses, the CtrlProc was already set
* to XkbDDXKeybdCtrlProc, overwriting it leads to happy recursion.
*/
if (pXDev->kbdfeed && pXDev->kbdfeed->CtrlProc != XkbDDXKeybdCtrlProc) {
xkbi->kbdProc= pXDev->kbdfeed->CtrlProc;
pXDev->kbdfeed->CtrlProc= XkbDDXKeybdCtrlProc;
}