Make button down state a bitmask. Master buttons track union of slave buttons

Mixing usage where some parts of the code treated this field as a bitmask
and other parts as an array of card8 was wrong, and as the wire protocol
wanted bitmasks, it was less invasive to switch the newer counting code use
booleans.

Master devices track slave buttons by waiting for all slave buttons to be
released before delivering the release event to the client.

This also removes the state merging code in DeepCopyDeviceClasses -- that
code was changing master device state without delivering any events,
violating protocol invariants. The result will be that existing slave
button state which does not match the master will not be visible through the
master device. Fixing this would require that we synthesize events in this
function, which seems like a bad idea. Note that keyboards have the same
issue.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
This commit is contained in:
Keith Packard
2008-06-18 11:37:00 -07:00
committed by Peter Hutterer
parent 3cc5ae6a4f
commit cfcb3da75e
3 changed files with 23 additions and 22 deletions

View File

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