summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-02-04 14:08:46 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2015-02-04 14:14:13 +1000
commit875f1696b780862886c75cd88b29fbc933ea7a1b (patch)
treef22f8bffd0dd4c751e2b21240481ef71b54b7cba
parent45e9b6c64b9bf0a84e3ee0e1fbb8f9f4efc3a8a0 (diff)
Only apply left-handed/scroll button configuration when it's available
https://bugs.freedesktop.org/show_bug.cgi?id=88961 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/libinput.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libinput.c b/src/libinput.c
index a24cbff..9613fbd 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -259,7 +259,8 @@ LibinputApplyConfig(DeviceIntPtr dev)
driver_data->options.matrix[6], driver_data->options.matrix[7],
driver_data->options.matrix[8]);
- if (libinput_device_config_left_handed_set(device,
+ if (libinput_device_config_left_handed_is_available(device) &&
+ libinput_device_config_left_handed_set(device,
driver_data->options.left_handed) != LIBINPUT_CONFIG_STATUS_SUCCESS)
xf86IDrvMsg(pInfo, X_ERROR,
"Failed to set LeftHanded to %d\n",
@@ -283,11 +284,13 @@ LibinputApplyConfig(DeviceIntPtr dev)
method);
}
- scroll_button = btn_xorg2linux(driver_data->options.scroll_button);
- if (libinput_device_config_scroll_set_button(device, scroll_button) != LIBINPUT_CONFIG_STATUS_SUCCESS)
- xf86IDrvMsg(pInfo, X_ERROR,
- "Failed to set ScrollButton to %d\n",
- driver_data->options.scroll_button);
+ if (libinput_device_config_scroll_get_methods(device) & LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) {
+ scroll_button = btn_xorg2linux(driver_data->options.scroll_button);
+ if (libinput_device_config_scroll_set_button(device, scroll_button) != LIBINPUT_CONFIG_STATUS_SUCCESS)
+ xf86IDrvMsg(pInfo, X_ERROR,
+ "Failed to set ScrollButton to %d\n",
+ driver_data->options.scroll_button);
+ }
}
static int