[mutter] backends/x11: Implement set_click_method configuration option



commit 3a2920d4bc13fbff6ee8da4de691d258ed6412cd
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 16 15:28:42 2015 +0100

    backends/x11: Implement set_click_method configuration option
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746290

 src/backends/x11/meta-input-settings-x11.c |   29 ++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 4437aed..b1060a9 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -185,6 +185,34 @@ meta_input_settings_x11_set_scroll_button (MetaInputSettings  *settings,
 }
 
 static void
+meta_input_settings_x11_set_click_method (MetaInputSettings           *settings,
+                                          ClutterInputDevice          *device,
+                                          GDesktopTouchpadClickMethod  mode)
+{
+  guchar values[2] = { 0 }; /* buttonareas, clickfinger */
+
+  switch (mode)
+    {
+    case G_DESKTOP_TOUCHPAD_CLICK_METHOD_NONE:
+      break;
+    case G_DESKTOP_TOUCHPAD_CLICK_METHOD_AREAS:
+      values[0] = 1;
+      break;
+    case G_DESKTOP_TOUCHPAD_CLICK_METHOD_DEFAULT:
+      /* XXX: We can't be much smarter yet, x11 doesn't expose default settings */
+    case G_DESKTOP_TOUCHPAD_CLICK_METHOD_FINGERS:
+      values[1] = 1;
+      break;
+    default:
+      g_assert_not_reached ();
+      return;
+  }
+
+  change_property (device, "libinput Click Method Enabled",
+                   XA_INTEGER, 8, &values, 2);
+}
+
+static void
 meta_input_settings_x11_set_keyboard_repeat (MetaInputSettings *settings,
                                              gboolean           enabled,
                                              guint              delay,
@@ -217,6 +245,7 @@ meta_input_settings_x11_class_init (MetaInputSettingsX11Class *klass)
   input_settings_class->set_invert_scroll = meta_input_settings_x11_set_invert_scroll;
   input_settings_class->set_scroll_method = meta_input_settings_x11_set_scroll_method;
   input_settings_class->set_scroll_button = meta_input_settings_x11_set_scroll_button;
+  input_settings_class->set_click_method = meta_input_settings_x11_set_click_method;
   input_settings_class->set_keyboard_repeat = meta_input_settings_x11_set_keyboard_repeat;
 }
 


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