summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-12-22 20:12:48 +0300
committermonsta <[email protected]>2017-01-02 16:53:33 +0300
commit28d68cffb504d62bb2610cdb5aecdbc44bc59bd6 (patch)
treebf1377681910ce1fc7e85c38b862f7de8daa85a0 /plugins
parentbf60e7d8566ccc518e44babb9632d98c01432ef3 (diff)
downloadmate-settings-daemon-28d68cffb504d62bb2610cdb5aecdbc44bc59bd6.tar.bz2
mate-settings-daemon-28d68cffb504d62bb2610cdb5aecdbc44bc59bd6.tar.xz
mouse: libinput - hook up natural scroll configuration
adapted from: https://github.com/linuxmint/cinnamon-settings-daemon/commit/2f87c56c4b57923c8992908ea9394ab170c507dd
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mouse/msd-mouse-manager.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/plugins/mouse/msd-mouse-manager.c b/plugins/mouse/msd-mouse-manager.c
index 43ed9c1..612f481 100644
--- a/plugins/mouse/msd-mouse-manager.c
+++ b/plugins/mouse/msd-mouse-manager.c
@@ -811,8 +811,8 @@ set_click_actions_all (MsdMouseManager *manager)
}
static void
-set_natural_scroll (XDeviceInfo *device_info,
- gboolean natural_scroll)
+set_natural_scroll_synaptics (XDeviceInfo *device_info,
+ gboolean natural_scroll)
{
XDevice *device;
int format, rc;
@@ -860,6 +860,25 @@ set_natural_scroll (XDeviceInfo *device_info,
}
}
+static void
+set_natural_scroll_libinput (XDeviceInfo *device_info,
+ gboolean natural_scroll)
+{
+ g_debug ("Trying to set %s for \"%s\"", natural_scroll ? "natural (reverse) scroll" : "normal scroll", device_info->name);
+
+ touchpad_set_bool (device_info, "libinput Natural Scrolling Enabled", 0, natural_scroll);
+}
+
+static void
+set_natural_scroll (XDeviceInfo *device_info,
+ gboolean natural_scroll)
+{
+ if (property_from_name ("Synaptics Scrolling Distance"))
+ set_natural_scroll_synaptics (device_info, natural_scroll);
+
+ if (property_from_name ("libinput Natural Scrolling Enabled"))
+ set_natural_scroll_libinput (device_info, natural_scroll);
+}
static void
set_natural_scroll_all (MsdMouseManager *manager)