Commit 04474fc6 authored by Chase Douglas's avatar Chase Douglas Committed by Peter Hutterer

Report logical button state in ProcXIQueryPointer

Physical button state is usually meaningless to an X client.
Signed-off-by: default avatarChase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 1e7b500a)
parent 3b25ed44
......@@ -132,7 +132,7 @@ ProcXIQueryPointer(ClientPtr client)
}
if (pDev->button) {
int i, down;
int i;
rep.buttons_len =
bytes_to_int32(bits_to_bytes(pDev->button->numButtons));
......@@ -142,14 +142,9 @@ ProcXIQueryPointer(ClientPtr client)
if (!buttons)
return BadAlloc;
down = pDev->button->buttonsDown;
for (i = 0; i < pDev->button->numButtons && down; i++) {
if (BitIsOn(pDev->button->down, i)) {
SetBit(buttons, i);
down--;
}
}
for (i = 1; i < pDev->button->numButtons; i++)
if (BitIsOn(pDev->button->down, i))
SetBit(buttons, pDev->button->map[i]);
}
else
rep.buttons_len = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment