forked from AuroraMiddleware/gtk
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.
This commit is contained in:
parent
e478ec09b8
commit
2feaf8f970
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user