From 8250785188a018fcbc1bb0f5562f531ce4226c60 Mon Sep 17 00:00:00 2001 From: infirit Date: Sat, 13 Dec 2014 13:54:23 +0100 Subject: 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 Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=632122 --- plugins/mouse/msd-mouse-manager.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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]; -- cgit v1.2.1