[mutter] backend: Add set_click_method MetaInputSettings vfunc



commit 9b50119d31728fb53c1065aa3155708a9f02ea07
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 16 15:25:59 2015 +0100

    backend: Add set_click_method MetaInputSettings vfunc
    
    This will configure the libinput_config_click_method for touchpads.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746290

 src/backends/meta-input-settings-private.h |    4 +++
 src/backends/meta-input-settings.c         |   29 ++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-input-settings-private.h b/src/backends/meta-input-settings-private.h
index 666a212..18c1edb 100644
--- a/src/backends/meta-input-settings-private.h
+++ b/src/backends/meta-input-settings-private.h
@@ -70,6 +70,10 @@ struct _MetaInputSettingsClass
                               ClutterInputDevice *device,
                               guint               button);
 
+  void (* set_click_method)  (MetaInputSettings            *settings,
+                              ClutterInputDevice           *device,
+                              GDesktopTouchpadClickMethod   mode);
+
   void (* set_keyboard_repeat) (MetaInputSettings *settings,
                                 gboolean           repeat,
                                 guint              delay,
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index dc792e0..4860fa9 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -380,6 +380,32 @@ update_touchpad_scroll_method (MetaInputSettings *input_settings,
 }
 
 static void
+update_touchpad_click_method (MetaInputSettings *input_settings,
+                              ClutterInputDevice *device)
+{
+  MetaInputSettingsClass *input_settings_class;
+  GDesktopTouchpadScrollMethod method;
+  MetaInputSettingsPrivate *priv;
+
+  priv = meta_input_settings_get_instance_private (input_settings);
+  input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
+  method = g_settings_get_enum (priv->touchpad_settings, "click-method");
+
+  if (device)
+    {
+      settings_device_set_uint_setting (input_settings, device,
+                                        input_settings_class->set_click_method,
+                                        method);
+    }
+  else
+    {
+      settings_set_uint_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+                                 (ConfigUintFunc) input_settings_class->set_click_method,
+                                 method);
+    }
+}
+
+static void
 update_touchpad_send_events (MetaInputSettings  *input_settings,
                              ClutterInputDevice *device)
 {
@@ -569,6 +595,8 @@ meta_input_settings_changed_cb (GSettings  *settings,
         update_touchpad_send_events (input_settings, NULL);
       else if (strcmp (key, "scroll-method") == 0)
         update_touchpad_scroll_method (input_settings, NULL);
+      else if (strcmp (key, "click-method") == 0)
+        update_touchpad_click_method (input_settings, NULL);
     }
   else if (settings == priv->trackball_settings)
     {
@@ -705,6 +733,7 @@ meta_input_settings_device_added (ClutterDeviceManager *device_manager,
       update_touchpad_left_handed (input_settings, device);
       update_touchpad_tap_enabled (input_settings, device);
       update_touchpad_scroll_method (input_settings, device);
+      update_touchpad_click_method (input_settings, device);
       update_touchpad_send_events (input_settings, device);
 
       update_device_speed (input_settings, priv->touchpad_settings,


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