summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-05-01 10:21:11 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2012-05-14 15:54:25 +1000
commit04474fc6a4c21a06c1a65c7afcbc4e0a27e3d0f7 (patch)
treee0e1715d93c907767e7e04bf3e844aa9b80a3600
parent3b25ed442ca9152841fa821ac3b01c2c9cb4e0d1 (diff)
Report logical button state in ProcXIQueryPointer
Physical button state is usually meaningless to an X client. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 1e7b500a8e1d79b91a4e857a2da06194efe8cf69)
-rw-r--r--Xi/xiquerypointer.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c
index a2e7442e0..ba99752ef 100644
--- a/Xi/xiquerypointer.c
+++ b/Xi/xiquerypointer.c
@@ -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;