summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-04-15 13:56:11 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-04-15 13:56:11 +0930
commit4cf9c5909d926ec322ed1c7df47f95bd872bb607 (patch)
treec432fa390870a6427e245c2fe82a7745df5d9407
parent1a9d7205cd5640eb65f019336097d86301942ea7 (diff)
Xi: fix up button count.
Some leftover code from the previously used alloc/free device classes left us with a incorrect button count. So a button release didn't come through if a different pointer was moved after the button press.
-rw-r--r--Xi/exevents.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 4417e6c61..4dd9fceb8 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -603,6 +603,8 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
}
}
+ to->button->buttonsDown = 0;
+ memset(to->button->down, 0, MAP_LENGTH);
/* merge button states from all attached devices */
for (sd = inputInfo.devices; sd; sd = sd->next)
{
@@ -612,6 +614,7 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
for (i = 0; i < MAP_LENGTH; i++)
{
to->button->down[i] += sd->button->down[i];
+ to->button->buttonsDown++;
}
}
#ifdef XKB