From 4cf9c5909d926ec322ed1c7df47f95bd872bb607 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 15 Apr 2008 13:56:11 +0930 Subject: [PATCH] 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. --- Xi/exevents.c | 3 +++ 1 file changed, 3 insertions(+) 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