Xi: when copying button classes, copy xkb_acts as well.

This should be the last piece in the quest for the class copy.
This commit is contained in:
Peter Hutterer 2008-04-15 23:03:06 +09:30
parent 51c8fd69ec
commit aa6687322d

View File

@ -247,8 +247,6 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
* Copies the feedback classes from device "from" into device "to". Classes * Copies the feedback classes from device "from" into device "to". Classes
* are duplicated (not just flipping the pointers). All feedback classes are * are duplicated (not just flipping the pointers). All feedback classes are
* linked lists, the full list is duplicated. * linked lists, the full list is duplicated.
*
* XXX: some XKB stuff is still missing.
*/ */
static void static void
DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
@ -622,8 +620,18 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
} }
} }
#ifdef XKB #ifdef XKB
to->button->xkb_acts = NULL; if (from->button->xkb_acts)
/* XXX: XkbAction needs to be copied */ {
if (!to->button->xkb_acts)
{
to->button->xkb_acts = xcalloc(1, sizeof(XkbAction));
if (!to->button->xkb_acts)
FatalError("[Xi] not enough memory for xkb_acts.\n");
}
memcpy(to->button->xkb_acts, from->button->xkb_acts,
sizeof(XkbAction));
} else
xfree(to->button->xkb_acts);
#endif #endif
} else if (to->button && !from->button) } else if (to->button && !from->button)
{ {