input: fix up usage of button->down, used to be a bitmask, is now an array.
device->button->down used to be a 32-byte bitmask with one bit for each button. This has changed into a 256-byte array, with one byte assigned for each button. Some of the callers were still using this array as a bitmask however, this is fixed with this patch. Thanks to Keith Packard for pointing this out. See also: http://lists.freedesktop.org/archives/xorg/2008-June/036202.html
This commit is contained in:
@@ -119,7 +119,7 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||
total_length += (sizeof(xValuatorState) + (v->numAxes * sizeof(int)));
|
||||
num_classes++;
|
||||
}
|
||||
buf = (char *)xalloc(total_length);
|
||||
buf = (char *)xcalloc(total_length, 1);
|
||||
if (!buf)
|
||||
return BadAlloc;
|
||||
savbuf = buf;
|
||||
@@ -139,8 +139,8 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||
tb->class = ButtonClass;
|
||||
tb->length = sizeof(xButtonState);
|
||||
tb->num_buttons = b->numButtons;
|
||||
for (i = 0; i < 32; i++)
|
||||
tb->buttons[i] = b->down[i];
|
||||
for (i = 0; i < MAP_LENGTH; i++)
|
||||
SetBitIf(tb->buttons, b->down, i);
|
||||
buf += sizeof(xButtonState);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user