Xi: keep a counter of buttons down to avoid duplicate press/release events.

If two devices are attached to the same master device, pressing button 1 on
each of them leads to two button presses from the same device. Some apps
really don't like that.

So we just put a counter in place and only send the first press and the last
release.
This commit is contained in:
Peter Hutterer 2008-01-09 17:36:39 +10:30
commit 4e85c7c322
3 changed files with 24 additions and 9 deletions

View file

@ -1178,7 +1178,7 @@ InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons,
butc->buttonsDown = 0;
butc->state = 0;
butc->motionMask = 0;
bzero((char *)butc->down, DOWN_LENGTH);
bzero((char *)butc->down, MAP_LENGTH);
#ifdef XKB
butc->xkb_acts= NULL;
#endif