From 18833d648fd7e1a5e962b93636bbbb38aca9c454 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 15 Nov 2007 12:13:59 +1030 Subject: [PATCH] Xi: reset xkb-stuff to NULL after copying (DeepCopyDeviceClasses) Having two devices point to the same xkb stuff causes SIGABRTs. Also, don't init a MD's xkbInfo unless the SD has an xkbInfo. --- Xi/exevents.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 158f523f0..f9ea1c9ac 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -178,9 +178,9 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master) mk->modifierKeyCount[i] = dk->modifierKeyCount[i]; #ifdef XKB - if (!mk->xkbInfo || !mk->xkbInfo->desc) - XkbInitDevice(master); if (!noXkbExtension && dk->xkbInfo && dk->xkbInfo->desc) { + if (!mk->xkbInfo || !mk->xkbInfo->desc) + XkbInitDevice(master); if (!XkbCopyKeymap(dk->xkbInfo->desc, mk->xkbInfo->desc, True)) FatalError("Couldn't pivot keymap from device to core!\n"); } @@ -238,18 +238,36 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) } ALLOC_COPY_CLASS_IF(button, ButtonClassRec); +#ifdef XKB + if (to->button) + { + to->button->xkb_acts = NULL; /* XXX: XkbAction needs to be copied */ + } +#endif ALLOC_COPY_CLASS_IF(focus, FocusClassRec); ALLOC_COPY_CLASS_IF(proximity, ProximityClassRec); ALLOC_COPY_CLASS_IF(absolute, AbsoluteClassRec); ALLOC_COPY_CLASS_IF(kbdfeed, KbdFeedbackClassRec); +#ifdef XKB + if (to->kbdfeed) + { + to->kbdfeed->xkb_sli = NULL; /* XXX: XkbSrvLedInfo needs to be copied*/ + } +#endif ALLOC_COPY_CLASS_IF(ptrfeed, PtrFeedbackClassRec); ALLOC_COPY_CLASS_IF(intfeed, IntegerFeedbackClassRec); ALLOC_COPY_CLASS_IF(stringfeed, StringFeedbackClassRec); ALLOC_COPY_CLASS_IF(bell, BellFeedbackClassRec); ALLOC_COPY_CLASS_IF(leds, LedFeedbackClassRec); - /* XXX: XkbSrvLedInfo needs to be copied. */ +#ifdef XKB + if (to->leds) + { + to->leds->xkb_sli = NULL; + /* XXX: XkbSrvLedInfo needs to be copied*/ + } +#endif } static void