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.
This commit is contained in:
Peter Hutterer 2008-04-15 13:56:11 +09:30
parent 1a9d7205cd
commit 4cf9c5909d

View File

@ -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