[gnome-settings-daemon/wip/settings-relocation: 11/12] mouse: Use gsettings-desktop-schemas mouse/touchpad settings



commit d432d4e7ab0e18102f1ae78603e933547f63e6d4
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Dec 17 15:33:45 2014 +0100

    mouse: Use gsettings-desktop-schemas mouse/touchpad settings
    
    Most settings have been moved there, so make this plugin use the new
    schemas for the handled settings, and remain using the settings-daemon
    schema for settings that can just be honored on X11.
    
    In order to simplify the situation for the future, the management of
    "middle-button-enabled", "horiz-scroll-enabled" and "disable-while-typing"
    settings have been removed, and the sane default is applied on non-libinput
    devices on X11.
    
    For all other settings, the mouse plugin has been made to ignore devices
    created through the libinput driver, as mutter handles these.
    
    Additionally, the entire plugin is disabled on Wayland, the settings
    remaining in g-s-d schemas are not a thing there.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742593

 plugins/mouse/gsd-mouse-manager.c |  225 +++++++++++++++++++++----------------
 1 files changed, 130 insertions(+), 95 deletions(-)
---
diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
index 60e77c2..0d01cd8 100644
--- a/plugins/mouse/gsd-mouse-manager.c
+++ b/plugins/mouse/gsd-mouse-manager.c
@@ -43,9 +43,12 @@
 #include <X11/keysym.h>
 #include <X11/Xatom.h>
 
+#include <gdesktop-enums.h>
+
 #include <X11/extensions/XInput.h>
 #include <X11/extensions/XIproto.h>
 
+#include "gnome-settings-bus.h"
 #include "gnome-settings-profile.h"
 #include "gsd-mouse-manager.h"
 #include "gsd-input-helper.h"
@@ -53,28 +56,25 @@
 
 #define GSD_MOUSE_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_MOUSE_MANAGER, 
GsdMouseManagerPrivate))
 
-#define SETTINGS_MOUSE_DIR         "org.gnome.settings-daemon.peripherals.mouse"
-#define SETTINGS_TOUCHPAD_DIR      "org.gnome.settings-daemon.peripherals.touchpad"
-#define SETTINGS_TRACKBALL_DIR     "org.gnome.settings-daemon.peripherals.trackball"
+#define GSD_SETTINGS_MOUSE_SCHEMA  "org.gnome.settings-daemon.peripherals.mouse"
+#define GSETTINGS_MOUSE_SCHEMA     "org.gnome.desktop.peripherals.mouse"
+#define GSETTINGS_TOUCHPAD_SCHEMA  "org.gnome.desktop.peripherals.touchpad"
+#define GSETTINGS_TRACKBALL_SCHEMA "org.gnome.desktop.peripherals.trackball"
 
 /* Keys for both touchpad and mouse */
 #define KEY_LEFT_HANDED         "left-handed"                /* a boolean for mouse, an enum for touchpad */
-#define KEY_MOTION_ACCELERATION "motion-acceleration"
-#define KEY_MOTION_THRESHOLD    "motion-threshold"
+#define KEY_SPEED               "speed"
 
 /* Touchpad settings */
-#define KEY_TOUCHPAD_DISABLE_W_TYPING    "disable-while-typing"
-#define KEY_PAD_HORIZ_SCROLL             "horiz-scroll-enabled"
 #define KEY_SCROLL_METHOD                "scroll-method"
 #define KEY_TAP_TO_CLICK                 "tap-to-click"
-#define KEY_TOUCHPAD_ENABLED             "touchpad-enabled"
+#define KEY_SEND_EVENTS                  "send-events"
 #define KEY_NATURAL_SCROLL_ENABLED       "natural-scroll"
 
 /* Mouse settings */
 #define KEY_LOCATE_POINTER               "locate-pointer"
 #define KEY_DWELL_CLICK_ENABLED          "dwell-click-enabled"
 #define KEY_SECONDARY_CLICK_ENABLED      "secondary-click-enabled"
-#define KEY_MIDDLE_BUTTON_EMULATION      "middle-button-enabled"
 
 /* Trackball settings */
 #define KEY_SCROLL_WHEEL_BUTTON          "scroll-wheel-emulation-button"
@@ -86,6 +86,7 @@ struct GsdMouseManagerPrivate
         GSettings *mouse_settings;
         GSettings *mouse_a11y_settings;
         GSettings *trackball_settings;
+        GSettings *gsd_mouse_settings;
         GdkDeviceManager *device_manager;
         guint device_added_id;
         guint device_removed_id;
@@ -357,6 +358,9 @@ set_left_handed (GsdMouseManager *manager,
         if (!xinput_device_has_buttons (device))
                 return;
 
+        if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                return;
+
         xdevice = open_gdk_device (device);
         if (xdevice == NULL)
                 return;
@@ -420,8 +424,12 @@ set_motion (GsdMouseManager *manager,
         gfloat motion_acceleration;
         int motion_threshold;
         GSettings *settings;
+        gdouble speed;
         guint i;
 
+        if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                return;
+
         xdevice = open_gdk_device (device);
         if (xdevice == NULL)
                 return;
@@ -433,8 +441,11 @@ set_motion (GsdMouseManager *manager,
         else
                 settings = manager->priv->mouse_settings;
 
-        /* Calculate acceleration */
-        motion_acceleration = g_settings_get_double (settings, KEY_MOTION_ACCELERATION);
+        speed = g_settings_get_double (settings, KEY_SPEED);
+
+        /* Calculate acceleration and threshold */
+        motion_acceleration = (speed + 1) * 5; /* speed is [-1..1], map to [0..10] */
+        motion_threshold = CLAMP (10 - floor (motion_acceleration), 1, 10);
 
         if (motion_acceleration >= 1.0) {
                 /* we want to get the acceleration, with a resolution of 0.5
@@ -461,9 +472,6 @@ set_motion (GsdMouseManager *manager,
                 denominator = -1;
         }
 
-        /* And threshold */
-        motion_threshold = g_settings_get_int (settings, KEY_MOTION_THRESHOLD);
-
         gdk_error_trap_push ();
 
         /* Get the list of feedbacks for the device */
@@ -504,53 +512,6 @@ set_motion (GsdMouseManager *manager,
         xdevice_close (xdevice);
 }
 
-static void
-set_middle_button (GsdMouseManager *manager,
-                   GdkDevice       *device,
-                   gboolean         middle_button)
-{
-        Atom prop;
-        XDevice *xdevice;
-        Atom type;
-        int format;
-        unsigned long nitems, bytes_after;
-        unsigned char *data;
-        int rc;
-
-        prop = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
-                            "Evdev Middle Button Emulation", True);
-
-        if (!prop) /* no evdev devices */
-                return;
-
-        xdevice = open_gdk_device (device);
-        if (xdevice == NULL)
-                return;
-
-       g_debug ("setting middle button on %s", gdk_device_get_name (device));
-
-        gdk_error_trap_push ();
-
-        rc = XGetDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
-                            xdevice, prop, 0, 1, False, XA_INTEGER, &type, &format,
-                            &nitems, &bytes_after, &data);
-
-        if (rc == Success && format == 8 && type == XA_INTEGER && nitems == 1) {
-                data[0] = middle_button ? 1 : 0;
-
-                XChangeDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
-                                       xdevice, prop, type, format, PropModeReplace, data, nitems);
-        }
-
-        if (gdk_error_trap_pop ())
-                g_warning ("Error in setting middle button emulation on \"%s\"", gdk_device_get_name 
(device));
-
-        if (rc == Success)
-                XFree (data);
-
-        xdevice_close (xdevice);
-}
-
 /* Ensure that syndaemon dies together with us, to avoid running several of
  * them */
 static void
@@ -619,7 +580,6 @@ set_disable_w_typing (GsdMouseManager *manager, gboolean state)
 
                 if (error) {
                         g_warning ("Failed to launch syndaemon: %s", error->message);
-                        g_settings_set_boolean (manager->priv->touchpad_settings, 
KEY_TOUCHPAD_DISABLE_W_TYPING, FALSE);
                         g_error_free (error);
                 } else {
                         g_child_watch_add (manager->priv->syndaemon_pid, syndaemon_died, manager);
@@ -646,6 +606,9 @@ set_tap_to_click (GdkDevice *device,
         unsigned char* data;
         Atom prop, type;
 
+        if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                return;
+
         prop = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Synaptics Tap Action", 
False);
         if (!prop)
                 return;
@@ -695,6 +658,9 @@ set_horiz_scroll (GdkDevice *device,
         unsigned long nitems, bytes_after;
         unsigned char *data;
 
+        if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                return;
+
         prop_edge = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Synaptics Edge 
Scrolling", False);
         prop_twofinger = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Synaptics 
Two-Finger Scrolling", False);
 
@@ -761,6 +727,9 @@ set_scroll_method (GsdMouseManager         *manager,
         unsigned long nitems, bytes_after;
         unsigned char *data;
 
+        if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                return;
+
         prop = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Synaptics Capabilities", 
True);
         prop_edge = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Synaptics Edge 
Scrolling", False);
         prop_twofinger = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Synaptics 
Two-Finger Scrolling", False);
@@ -835,6 +804,9 @@ set_touchpad_disabled (GdkDevice *device)
         int id;
         XDevice *xdevice;
 
+        if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                return;
+
         g_object_get (G_OBJECT (device), "device-id", &id, NULL);
 
         g_debug ("Trying to set device disabled for \"%s\" (%d)", gdk_device_get_name (device), id);
@@ -861,6 +833,9 @@ set_touchpad_enabled (int id)
 {
         XDevice *xdevice;
 
+        if (xdevice_is_libinput (id))
+                return;
+
         g_debug ("Trying to set device enabled for %d", id);
 
         gdk_error_trap_push ();
@@ -902,7 +877,7 @@ set_locate_pointer (GsdMouseManager *manager,
                 manager->priv->locate_pointer_spawned = (error == NULL);
 
                 if (error) {
-                        g_settings_set_boolean (manager->priv->mouse_settings, KEY_LOCATE_POINTER, FALSE);
+                        g_settings_set_boolean (manager->priv->gsd_mouse_settings, KEY_LOCATE_POINTER, 
FALSE);
                         g_error_free (error);
                 }
 
@@ -984,6 +959,9 @@ set_natural_scroll (GsdMouseManager *manager,
                 return;
         }
 
+        if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                return;
+
         g_debug ("Trying to set %s for \"%s\"",
                  natural_scroll ? "natural (reverse) scroll" : "normal scroll",
                  gdk_device_get_name (device));
@@ -1040,6 +1018,9 @@ set_scroll_wheel_button (GsdMouseManager *manager,
         if (!device_is_trackball (device))
                 return;
 
+        if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                return;
+
         xdevice = open_gdk_device (device);
         if (xdevice == NULL)
                 return;
@@ -1101,24 +1082,42 @@ set_scroll_wheel_button (GsdMouseManager *manager,
         xdevice_close (xdevice);
 }
 
+static gboolean
+get_touchpad_enabled (GsdMouseManager *manager)
+{
+        GDesktopDeviceSendEvents send_events;
+
+        send_events = g_settings_get_enum (manager->priv->touchpad_settings, KEY_SEND_EVENTS);
+
+        if (send_events == G_DESKTOP_DEVICE_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE) {
+                /* FIXME: mouse_is_present() also finds internal ones... */
+                return (!mouse_is_present () && !trackball_is_present ());
+
+        }
+
+        return send_events == G_DESKTOP_DEVICE_SEND_EVENTS_ENABLED ? TRUE : FALSE;
+}
+
 static void
 set_mouse_settings (GsdMouseManager *manager,
                     GdkDevice       *device)
 {
         gboolean mouse_left_handed, touchpad_left_handed;
 
+        if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                return;
+
         mouse_left_handed = g_settings_get_boolean (manager->priv->mouse_settings, KEY_LEFT_HANDED);
         touchpad_left_handed = get_touchpad_handedness (manager, mouse_left_handed);
         set_left_handed (manager, device, mouse_left_handed, touchpad_left_handed);
 
         set_motion (manager, device);
-        set_middle_button (manager, device, g_settings_get_boolean (manager->priv->mouse_settings, 
KEY_MIDDLE_BUTTON_EMULATION));
 
         set_tap_to_click (device, g_settings_get_boolean (manager->priv->touchpad_settings, 
KEY_TAP_TO_CLICK), touchpad_left_handed);
         set_scroll_method (manager, device, g_settings_get_enum (manager->priv->touchpad_settings, 
KEY_SCROLL_METHOD));
-        set_horiz_scroll (device, g_settings_get_boolean (manager->priv->touchpad_settings, 
KEY_PAD_HORIZ_SCROLL));
+        set_horiz_scroll (device, TRUE);
         set_natural_scroll (manager, device, g_settings_get_boolean (manager->priv->touchpad_settings, 
KEY_NATURAL_SCROLL_ENABLED));
-        if (g_settings_get_boolean (manager->priv->touchpad_settings, KEY_TOUCHPAD_ENABLED) == FALSE)
+        if (!get_touchpad_enabled (manager))
                 set_touchpad_disabled (device);
 
         set_scroll_wheel_button (manager, device);
@@ -1150,15 +1149,15 @@ mouse_callback (GSettings       *settings,
                 if (device_is_ignored (manager, device))
                         continue;
 
+                if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                        continue;
+
                 if (g_str_equal (key, KEY_LEFT_HANDED)) {
                         gboolean mouse_left_handed;
                         mouse_left_handed = g_settings_get_boolean (settings, KEY_LEFT_HANDED);
                         set_left_handed (manager, device, mouse_left_handed, get_touchpad_handedness 
(manager, mouse_left_handed));
-                } else if (g_str_equal (key, KEY_MOTION_ACCELERATION) ||
-                           g_str_equal (key, KEY_MOTION_THRESHOLD)) {
+                } else if (g_str_equal (key, KEY_SPEED)) {
                         set_motion (manager, device);
-                } else if (g_str_equal (key, KEY_MIDDLE_BUTTON_EMULATION)) {
-                        set_middle_button (manager, device, g_settings_get_boolean (settings, 
KEY_MIDDLE_BUTTON_EMULATION));
                 }
         }
         g_list_free (devices);
@@ -1171,11 +1170,6 @@ touchpad_callback (GSettings       *settings,
 {
         GList *devices, *l;
 
-        if (g_str_equal (key, KEY_TOUCHPAD_DISABLE_W_TYPING)) {
-                set_disable_w_typing (manager, g_settings_get_boolean (manager->priv->touchpad_settings, 
key));
-                return;
-        }
-
         devices = gdk_device_manager_list_devices (manager->priv->device_manager, GDK_DEVICE_TYPE_SLAVE);
 
         for (l = devices; l != NULL; l = l->next) {
@@ -1184,6 +1178,9 @@ touchpad_callback (GSettings       *settings,
                 if (device_is_ignored (manager, device))
                         continue;
 
+                if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                        continue;
+
                 if (g_str_equal (key, KEY_TAP_TO_CLICK)) {
                         gboolean mouse_left_handed;
                         mouse_left_handed = g_settings_get_boolean (manager->priv->mouse_settings, 
KEY_LEFT_HANDED);
@@ -1191,16 +1188,13 @@ touchpad_callback (GSettings       *settings,
                                           get_touchpad_handedness (manager, mouse_left_handed));
                 } else if (g_str_equal (key, KEY_SCROLL_METHOD)) {
                         set_scroll_method (manager, device, g_settings_get_enum (settings, key));
-                        set_horiz_scroll (device, g_settings_get_boolean (settings, KEY_PAD_HORIZ_SCROLL));
-                } else if (g_str_equal (key, KEY_PAD_HORIZ_SCROLL)) {
-                        set_horiz_scroll (device, g_settings_get_boolean (settings, key));
-                } else if (g_str_equal (key, KEY_TOUCHPAD_ENABLED)) {
-                        if (g_settings_get_boolean (settings, key) == FALSE)
+                        set_horiz_scroll (device, TRUE);
+                } else if (g_str_equal (key, KEY_SEND_EVENTS)) {
+                        if (!get_touchpad_enabled (manager))
                                 set_touchpad_disabled (device);
                         else
                                 set_touchpad_enabled (gdk_x11_device_get_id (device));
-                } else if (g_str_equal (key, KEY_MOTION_ACCELERATION) ||
-                           g_str_equal (key, KEY_MOTION_THRESHOLD)) {
+                } else if (g_str_equal (key, KEY_SPEED)) {
                         set_motion (manager, device);
                 } else if (g_str_equal (key, KEY_LEFT_HANDED)) {
                         gboolean mouse_left_handed;
@@ -1212,8 +1206,8 @@ touchpad_callback (GSettings       *settings,
         }
         g_list_free (devices);
 
-        if (g_str_equal (key, KEY_TOUCHPAD_ENABLED) &&
-            g_settings_get_boolean (settings, key)) {
+        if (g_str_equal (key, KEY_SEND_EVENTS) &&
+            get_touchpad_enabled (manager)) {
                 devices = get_disabled_devices (manager->priv->device_manager);
                 for (l = devices; l != NULL; l = l->next) {
                         int device_id;
@@ -1240,6 +1234,9 @@ trackball_callback (GSettings       *settings,
                 if (device_is_ignored (manager, device))
                         continue;
 
+                if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                        return;
+
                 set_scroll_wheel_button (manager, device);
         }
         g_list_free (devices);
@@ -1249,8 +1246,36 @@ trackball_callback (GSettings       *settings,
 static void
 ensure_touchpad_active (GsdMouseManager *manager)
 {
-        if (mouse_is_present () == FALSE && touchscreen_is_present () == FALSE && trackball_is_present () == 
FALSE && touchpad_is_present ())
-                g_settings_set_boolean (manager->priv->touchpad_settings, KEY_TOUCHPAD_ENABLED, TRUE);
+        GList *devices, *l;
+
+        if (get_touchpad_enabled (manager)) {
+                devices = get_disabled_devices (manager->priv->device_manager);
+                for (l = devices; l != NULL; l = l->next) {
+                        int device_id;
+
+                        device_id = GPOINTER_TO_INT (l->data);
+                        set_touchpad_enabled (device_id);
+                }
+                g_list_free (devices);
+        } else {
+                devices = gdk_device_manager_list_devices (manager->priv->device_manager,
+                                                           GDK_DEVICE_TYPE_SLAVE);
+
+                for (l = devices; l != NULL; l = l->next) {
+                        GdkDevice *device = l->data;
+
+                        if (device_is_ignored (manager, device))
+                                continue;
+                        if (xdevice_is_libinput (gdk_x11_device_get_id (device)))
+                                continue;
+                        if (gdk_device_get_source (device) != GDK_SOURCE_TOUCHPAD)
+                                continue;
+
+                        set_touchpad_disabled (device);
+                }
+
+                g_list_free (devices);
+        }
 }
 
 static void
@@ -1269,7 +1294,10 @@ device_added_cb (GdkDeviceManager *device_manager,
                 }
 
                 /* If a touchpad was to appear... */
-                set_disable_w_typing (manager, g_settings_get_boolean (manager->priv->touchpad_settings, 
KEY_TOUCHPAD_DISABLE_W_TYPING));
+                set_disable_w_typing (manager, TRUE);
+
+                /* If a mouse was to appear... */
+                ensure_touchpad_active (manager);
         }
 }
 
@@ -1290,7 +1318,7 @@ device_removed_cb (GdkDeviceManager *device_manager,
                 run_custom_command (device, COMMAND_DEVICE_REMOVED);
 
                 /* If a touchpad was to disappear... */
-                set_disable_w_typing (manager, g_settings_get_boolean (manager->priv->touchpad_settings, 
KEY_TOUCHPAD_DISABLE_W_TYPING));
+                set_disable_w_typing (manager, TRUE);
 
                 ensure_touchpad_active (manager);
         }
@@ -1326,29 +1354,33 @@ gsd_mouse_manager_idle_cb (GsdMouseManager *manager)
 
         set_devicepresence_handler (manager);
 
-        manager->priv->mouse_settings = g_settings_new (SETTINGS_MOUSE_DIR);
-        g_signal_connect (manager->priv->mouse_settings, "changed",
+        manager->priv->gsd_mouse_settings = g_settings_new (GSD_SETTINGS_MOUSE_SCHEMA);
+        g_signal_connect (manager->priv->gsd_mouse_settings, "changed",
                           G_CALLBACK (mouse_callback), manager);
 
         manager->priv->mouse_a11y_settings = g_settings_new ("org.gnome.desktop.a11y.mouse");
         g_signal_connect (manager->priv->mouse_a11y_settings, "changed",
                           G_CALLBACK (mouse_callback), manager);
 
-        manager->priv->touchpad_settings = g_settings_new (SETTINGS_TOUCHPAD_DIR);
+        manager->priv->mouse_settings = g_settings_new (GSETTINGS_MOUSE_SCHEMA);
+        g_signal_connect (manager->priv->mouse_settings, "changed",
+                          G_CALLBACK (mouse_callback), manager);
+
+        manager->priv->touchpad_settings = g_settings_new (GSETTINGS_TOUCHPAD_SCHEMA);
         g_signal_connect (manager->priv->touchpad_settings, "changed",
                           G_CALLBACK (touchpad_callback), manager);
 
-        manager->priv->trackball_settings = g_settings_new (SETTINGS_TRACKBALL_DIR);
+        manager->priv->trackball_settings = g_settings_new (GSETTINGS_TRACKBALL_SCHEMA);
         g_signal_connect (manager->priv->trackball_settings, "changed",
                           G_CALLBACK (trackball_callback), manager);
 
         manager->priv->syndaemon_spawned = FALSE;
 
-        set_locate_pointer (manager, g_settings_get_boolean (manager->priv->mouse_settings, 
KEY_LOCATE_POINTER));
+        set_locate_pointer (manager, g_settings_get_boolean (manager->priv->gsd_mouse_settings, 
KEY_LOCATE_POINTER));
         set_mousetweaks_daemon (manager,
                                 g_settings_get_boolean (manager->priv->mouse_a11y_settings, 
KEY_DWELL_CLICK_ENABLED),
                                 g_settings_get_boolean (manager->priv->mouse_a11y_settings, 
KEY_SECONDARY_CLICK_ENABLED));
-        set_disable_w_typing (manager, g_settings_get_boolean (manager->priv->touchpad_settings, 
KEY_TOUCHPAD_DISABLE_W_TYPING));
+        set_disable_w_typing (manager, TRUE);
 
         devices = gdk_device_manager_list_devices (manager->priv->device_manager, GDK_DEVICE_TYPE_SLAVE);
         for (l = devices; l != NULL; l = l->next) {
@@ -1370,7 +1402,7 @@ gsd_mouse_manager_idle_cb (GsdMouseManager *manager)
 
         ensure_touchpad_active (manager);
 
-        if (g_settings_get_boolean (manager->priv->touchpad_settings, KEY_TOUCHPAD_ENABLED)) {
+        if (get_touchpad_enabled (manager)) {
                 devices = get_disabled_devices (manager->priv->device_manager);
                 for (l = devices; l != NULL; l = l->next) {
                         int device_id;
@@ -1399,6 +1431,9 @@ gsd_mouse_manager_start (GsdMouseManager *manager,
                 return TRUE;
         }
 
+        if (gnome_settings_is_wayland ())
+                return TRUE;
+
         manager->priv->start_idle_id = g_idle_add ((GSourceFunc) gsd_mouse_manager_idle_cb, manager);
         g_source_set_name_by_id (manager->priv->start_idle_id, "[gnome-settings-daemon] 
gsd_mouse_manager_idle_cb");
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]