mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
backends/native: fix the scroll button lock right/middle mismatch
In X, buttons 1, 2, 3 are left, middle, right. In evdev, the order is BTN_LEFT, BTN_RIGHT, BTN_MIDDLE. So setting a scroll button to 2 gave us a middle button in the X session and a right button in a wayland session. Fix that by hard-coding the LMR buttons handling. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1433
This commit is contained in:
parent
6e3ecadb79
commit
aa638f4d48
@ -287,12 +287,26 @@ meta_input_settings_native_set_scroll_button (MetaInputSettings *settings,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Compensate for X11 scroll buttons */
|
||||
if (button > 7)
|
||||
button -= 4;
|
||||
switch (button)
|
||||
{
|
||||
case 1:
|
||||
evcode = BTN_LEFT;
|
||||
break;
|
||||
case 2:
|
||||
evcode = BTN_MIDDLE;
|
||||
break;
|
||||
case 3:
|
||||
evcode = BTN_RIGHT;
|
||||
break;
|
||||
default:
|
||||
/* Compensate for X11 scroll buttons */
|
||||
if (button > 7)
|
||||
button -= 4;
|
||||
|
||||
/* Button is 1-indexed */
|
||||
evcode = (BTN_LEFT - 1) + button;
|
||||
}
|
||||
|
||||
/* Button is 1-indexed */
|
||||
evcode = (BTN_LEFT - 1) + button;
|
||||
method = LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user