aboutsummaryrefslogtreecommitdiff
path: root/sway/input/libinput.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/libinput.c')
-rw-r--r--sway/input/libinput.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sway/input/libinput.c b/sway/input/libinput.c
index dd4fc0be..43875634 100644
--- a/sway/input/libinput.c
+++ b/sway/input/libinput.c
@@ -166,6 +166,18 @@ static bool set_scroll_button(struct libinput_device *dev, uint32_t button) {
return true;
}
+static bool set_scroll_button_lock(struct libinput_device *dev,
+ enum libinput_config_scroll_button_lock_state lock) {
+ uint32_t scroll = libinput_device_config_scroll_get_methods(dev);
+ if ((scroll & ~LIBINPUT_CONFIG_SCROLL_NO_SCROLL) == 0 ||
+ libinput_device_config_scroll_get_button_lock(dev) == lock) {
+ return false;
+ }
+ sway_log(SWAY_DEBUG, "scroll_set_button_lock(%" PRIu32 ")", lock);
+ log_status(libinput_device_config_scroll_set_button_lock(dev, lock));
+ return true;
+}
+
static bool set_dwt(struct libinput_device *device, bool dwt) {
if (!libinput_device_config_dwt_is_available(device) ||
libinput_device_config_dwt_get_enabled(device) == dwt) {
@@ -276,6 +288,9 @@ bool sway_input_configure_libinput_device(struct sway_input_device *input_device
if (ic->scroll_button != INT_MIN) {
changed |= set_scroll_button(device, ic->scroll_button);
}
+ if (ic->scroll_button_lock != INT_MIN) {
+ changed |= set_scroll_button_lock(device, ic->scroll_button_lock);
+ }
if (ic->dwt != INT_MIN) {
changed |= set_dwt(device, ic->dwt);
}