summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-02-13 16:00:47 -0800
committerPeter Hutterer <peter.hutterer@who-t.net>2012-02-15 11:09:20 +1000
commit8573b3519af138a3a12a2e77098718165f9fd8ff (patch)
tree27a8ff0799951601da4eb3f9d6823ac562d2c6f4 /Xi
parent03d32fe7a718d9016053cdb5d57f51a74ef99b59 (diff)
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 <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c18
1 files 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;