[gtk+] xi2: Don't set button mask 4 and 5
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] xi2: Don't set button mask 4 and 5
- Date: Sat, 2 May 2015 15:56:30 +0000 (UTC)
commit 2feaf8f970d93bf24d0e9036526e451413bc0f2f
Author: Matthias Clasen <mclasen redhat com>
Date: Sat May 2 11:51:38 2015 -0400
xi2: Don't set button mask 4 and 5
We interpret buttons 4-7 as old-school scroll events, so it does
not make sense to add these to the mask. Also fix an off-by-one
in the loop here, buttons_mask is 1-based.
gdk/x11/gdkdevice-xi2.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index fad8671..66c3a31 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -762,10 +762,10 @@ _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
{
gint len, i;
- /* We're only interested in the first 5 buttons */
- len = MIN (5, buttons_state->mask_len * 8);
+ /* We're only interested in the first 3 buttons */
+ len = MIN (3, buttons_state->mask_len * 8);
- for (i = 0; i < len; i++)
+ for (i = 1; i <= len; i++)
{
if (!XIMaskIsSet (buttons_state->mask, i))
continue;
@@ -781,12 +781,6 @@ _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
case 3:
state |= GDK_BUTTON3_MASK;
break;
- case 4:
- state |= GDK_BUTTON4_MASK;
- break;
- case 5:
- state |= GDK_BUTTON5_MASK;
- break;
default:
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]