From 8573b3519af138a3a12a2e77098718165f9fd8ff Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 13 Feb 2012 16:00:47 -0800 Subject: [PATCH] Don't clobber virtual core pointer touches array length The VCP has its own touches array, don't overwrite it when the class is copied from the SD to the master. Reported-by: Chase Douglas Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas --- Xi/exevents.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 816dfa7e9..ca8060d78 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -671,7 +671,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) if (from->touch) { - TouchPointInfoPtr tmp; + TouchClassPtr t, f; if (!to->touch) { classes = to->unused_classes; @@ -692,10 +692,18 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) } else classes->touch = NULL; } - tmp = to->touch->touches; - memcpy(to->touch, from->touch, sizeof(TouchClassRec)); - to->touch->touches = tmp; - to->touch->sourceid = from->id; + + + t = to->touch; + f = from->touch; + t->sourceid = f->sourceid; + t->max_touches = f->max_touches; + t->mode = f->mode; + t->buttonsDown = f->buttonsDown; + t->state = f->state; + t->motionMask = f->motionMask; + /* to->touches and to->num_touches are separate on the master, + * don't copy */ } else if (to->touch) { ClassesPtr classes;