diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-04-15 23:03:06 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-04-18 14:39:21 +0930 |
commit | aa6687322de85a2d1025a3ae851fb290a089b2d3 (patch) | |
tree | 3d1730f84f735b95d0de8ea1d6629d31ea3c22b6 /Xi | |
parent | 51c8fd69ec9292f5e18cdc7f60e1716fbd6ae61a (diff) |
Xi: when copying button classes, copy xkb_acts as well.
This should be the last piece in the quest for the class copy.
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index f41250821..a828044fa 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -247,8 +247,6 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master) * Copies the feedback classes from device "from" into device "to". Classes * are duplicated (not just flipping the pointers). All feedback classes are * linked lists, the full list is duplicated. - * - * XXX: some XKB stuff is still missing. */ static void DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) @@ -622,8 +620,18 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) } } #ifdef XKB - to->button->xkb_acts = NULL; - /* XXX: XkbAction needs to be copied */ + if (from->button->xkb_acts) + { + 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 } else if (to->button && !from->button) { |