backends: add support for scroll button locking

Where enabled, the first click of the scroll button sets the button logically
down, the second click sets the button logically up.

This is an accessibility feature, it doesn't require users to keep holding the
button down while scrolling which is hard or impossible for some users.

gsettings-desktop-schemas merge request:
https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/merge_requests/39

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1432
This commit is contained in:
Peter Hutterer
2020-09-08 11:08:05 +10:00
committed by Georges Basile Stavracas Neto
parent 1c1c8b25ed
commit e078a007d6
5 changed files with 25 additions and 7 deletions

View File

@ -375,11 +375,16 @@ meta_input_settings_x11_has_two_finger_scroll (MetaInputSettings *settings,
static void
meta_input_settings_x11_set_scroll_button (MetaInputSettings *settings,
ClutterInputDevice *device,
guint button)
guint button,
gboolean button_lock)
{
gchar lock = button_lock;
change_scroll_method (device, SCROLL_METHOD_FIELD_BUTTON, button != 0);
change_property (device, "libinput Button Scrolling Button",
XA_CARDINAL, 32, &button, 1);
change_property (device, "libinput Button Scrolling Button Lock Enabled",
XA_INTEGER, 8, &lock, 1);
}
static void