Blob Blame History Raw
From 94f48f7ee94bd117d46c8aa1333883ac2f431921 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Fri, 16 Dec 2011 12:41:08 +1000
Subject: [PATCH] dix: button state must show the logical buttons, not
 physical buttons

If the device is mapped 3 2 1, a click on physical button 1 sends a button 3
press, but the state was set for button 1. Fix this, the state must be set
for that button's logical mapping.

https://bugzilla.gnome.org/show_bug.cgi?id=655928

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9567d21e85b99febe805263a4d93b15fd1f7ab42)

Conflicts:

	dix/inpututils.c
---
 Xi/exevents.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index dcb496f..9d43564 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -927,7 +927,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
 
     for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++)
         if (BitIsOn(mouse->button->down, i))
-            SetBit(event->buttons, i);
+            SetBit(event->buttons, mouse->button->map[i]);
 
     if (kbd && kbd->key)
     {
-- 
1.7.7.1