diff options
Diffstat (limited to 'sway/input/libinput.c')
-rw-r--r-- | sway/input/libinput.c | 15 |
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) { | |||
166 | return true; | 166 | return true; |
167 | } | 167 | } |
168 | 168 | ||
169 | static bool set_scroll_button_lock(struct libinput_device *dev, | ||
170 | enum libinput_config_scroll_button_lock_state lock) { | ||
171 | uint32_t scroll = libinput_device_config_scroll_get_methods(dev); | ||
172 | if ((scroll & ~LIBINPUT_CONFIG_SCROLL_NO_SCROLL) == 0 || | ||
173 | libinput_device_config_scroll_get_button_lock(dev) == lock) { | ||
174 | return false; | ||
175 | } | ||
176 | sway_log(SWAY_DEBUG, "scroll_set_button_lock(%" PRIu32 ")", lock); | ||
177 | log_status(libinput_device_config_scroll_set_button_lock(dev, lock)); | ||
178 | return true; | ||
179 | } | ||
180 | |||
169 | static bool set_dwt(struct libinput_device *device, bool dwt) { | 181 | static bool set_dwt(struct libinput_device *device, bool dwt) { |
170 | if (!libinput_device_config_dwt_is_available(device) || | 182 | if (!libinput_device_config_dwt_is_available(device) || |
171 | libinput_device_config_dwt_get_enabled(device) == dwt) { | 183 | libinput_device_config_dwt_get_enabled(device) == dwt) { |
@@ -276,6 +288,9 @@ bool sway_input_configure_libinput_device(struct sway_input_device *input_device | |||
276 | if (ic->scroll_button != INT_MIN) { | 288 | if (ic->scroll_button != INT_MIN) { |
277 | changed |= set_scroll_button(device, ic->scroll_button); | 289 | changed |= set_scroll_button(device, ic->scroll_button); |
278 | } | 290 | } |
291 | if (ic->scroll_button_lock != INT_MIN) { | ||
292 | changed |= set_scroll_button_lock(device, ic->scroll_button_lock); | ||
293 | } | ||
279 | if (ic->dwt != INT_MIN) { | 294 | if (ic->dwt != INT_MIN) { |
280 | changed |= set_dwt(device, ic->dwt); | 295 | changed |= set_dwt(device, ic->dwt); |
281 | } | 296 | } |