diff options
author | infirit <[email protected]> | 2014-12-13 13:54:23 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-12-13 18:32:16 +0100 |
commit | 8250785188a018fcbc1bb0f5562f531ce4226c60 (patch) | |
tree | fafb64eddc53a858129af5565a08d4366e9a6a42 /plugins/mouse | |
parent | 29167526d43aba53f4b9c176bb2e95f025b9cc4b (diff) | |
download | mate-settings-daemon-8250785188a018fcbc1bb0f5562f531ce4226c60.tar.bz2 mate-settings-daemon-8250785188a018fcbc1bb0f5562f531ce4226c60.tar.xz |
mouse: Check for touchpad before running syndaemon
This avoids error messages from syndaemon:
Unable to find a synaptics device.
Taken from GSD commit: fd4722b40351a3bfc1793fb4ec56e8a5a406786a
From: Hernando Torque <[email protected]>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=632122
Diffstat (limited to 'plugins/mouse')
-rw-r--r-- | plugins/mouse/msd-mouse-manager.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/plugins/mouse/msd-mouse-manager.c b/plugins/mouse/msd-mouse-manager.c index 426697f..5bce75b 100644 --- a/plugins/mouse/msd-mouse-manager.c +++ b/plugins/mouse/msd-mouse-manager.c @@ -607,11 +607,32 @@ device_is_touchpad (XDeviceInfo deviceinfo) } #endif +static gboolean +touchpad_is_present (void) +{ + gboolean touchpad_present = FALSE; + int numdevices, i; + XDeviceInfo *devicelist = XListInputDevices (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &numdevices); + XDevice *device; + + if (devicelist == NULL) + return 0; + + for (i = 0; i < numdevices; i++) { + if ((device = device_is_touchpad (devicelist[i]))) { + touchpad_present = TRUE; + break; + } + } + + return touchpad_present; +} + static int set_disable_w_typing (MsdMouseManager *manager, gboolean state) { - if (state) { + if (state && touchpad_is_present ()) { GError *error = NULL; char *args[5]; |