Xi: If the MD doesn't have a key/kbdfeed class, init the keyboard.
This fixes crashes on mouse/keyboard combos where the mouse is both a keyboard and a mouse. Upon copying the SD's key info into the VCP, the NULL xkbInfo of the VCP would crash the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
caade11b84
commit
32adf8d34f
|
@ -237,7 +237,14 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
|
||||||
{
|
{
|
||||||
classes = dixLookupPrivate(&to->devPrivates,
|
classes = dixLookupPrivate(&to->devPrivates,
|
||||||
UnusedClassesPrivateKey);
|
UnusedClassesPrivateKey);
|
||||||
|
|
||||||
to->kbdfeed = classes->kbdfeed;
|
to->kbdfeed = classes->kbdfeed;
|
||||||
|
if (!to->kbdfeed)
|
||||||
|
{
|
||||||
|
XkbRMLVOSet rmlvo;
|
||||||
|
XkbGetRulesDflts(&rmlvo);
|
||||||
|
InitKeyboardDeviceStruct(to, &rmlvo, NULL, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
k = &to->kbdfeed;
|
k = &to->kbdfeed;
|
||||||
|
@ -481,9 +488,9 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
|
||||||
to->key = classes->key;
|
to->key = classes->key;
|
||||||
if (!to->key)
|
if (!to->key)
|
||||||
{
|
{
|
||||||
to->key = xcalloc(1, sizeof(KeyClassRec));
|
XkbRMLVOSet rmlvo;
|
||||||
if (!to->key)
|
XkbGetRulesDflts(&rmlvo);
|
||||||
FatalError("[Xi] no memory for class shift.\n");
|
InitKeyboardDeviceStruct(to, &rmlvo, NULL, NULL);
|
||||||
} else
|
} else
|
||||||
classes->key = NULL;
|
classes->key = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue