Physical button state is usually meaningless to an X client.

Signed-off-by: Chase Douglas <chase.doug...@canonical.com>
---
 Xi/xiquerypointer.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c
index a2e7442..e2a940c 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,10 @@ 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)) {
+        for (i = 0; i < pDev->button->numButtons; i++)
+            /* Logical button state is stored as core protocol mask bits */
+            if (BitIsOn(&pDev->button->state, 8 + i))
                 SetBit(buttons, i);
-                down--;
-            }
-        }
     }
     else
         rep.buttons_len = 0;
-- 
1.7.9.1

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to