gpointing-device-settings r281 - in trunk/modules: . common gnome-settings-daemon-plugins



Author: hiikezoe
Date: Sat Mar 28 00:35:33 2009
New Revision: 281
URL: http://svn.gnome.org/viewvc/gpointing-device-settings?rev=281&view=rev

Log:
Support touchpad click action partially.

Modified:
   trunk/modules/common/gpds-touchpad-definitions.h
   trunk/modules/common/gpds-touchpad-xinput.c
   trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c
   trunk/modules/gpds-mouse-ui.c
   trunk/modules/gpds-touchpad-ui.c

Modified: trunk/modules/common/gpds-touchpad-definitions.h
==============================================================================
--- trunk/modules/common/gpds-touchpad-definitions.h	(original)
+++ trunk/modules/common/gpds-touchpad-definitions.h	Sat Mar 28 00:35:33 2009
@@ -40,6 +40,9 @@
 #define GPDS_TOUCHPAD_PALM_DETECTION_DEPTH_KEY            "palm_detection_depth"
 #define GPDS_TOUCHPAD_LOCKED_DRAGS_KEY                    "locked_drags"
 #define GPDS_TOUCHPAD_LOCKED_DRAGS_TIMEOUT_KEY            "locked_drags_timeout"
+#define GPDS_TOUCHPAD_CLICK_ACTION_FINGER1_KEY            "click_action_finger1"
+#define GPDS_TOUCHPAD_CLICK_ACTION_FINGER2_KEY            "click_action_finger2"
+#define GPDS_TOUCHPAD_CLICK_ACTION_FINGER3_KEY            "click_action_finger3"
 
 #endif /* __GPDS_TOUCHPAD_GCONF_H__ */
 /*

Modified: trunk/modules/common/gpds-touchpad-xinput.c
==============================================================================
--- trunk/modules/common/gpds-touchpad-xinput.c	(original)
+++ trunk/modules/common/gpds-touchpad-xinput.c	Sat Mar 28 00:35:33 2009
@@ -50,7 +50,7 @@
     {GPDS_TOUCHPAD_LOCKED_DRAGS,               "Synaptics Locked Drags",                G_TYPE_INT,   8, 1},
     {GPDS_TOUCHPAD_LOCKED_DRAGS_TIMEOUT,       "Synaptics Locked Drags Timeout",        G_TYPE_INT,  32, 1},
     {GPDS_TOUCHPAD_TAP_ACTION,                 "Synaptics Tap Action",                  G_TYPE_INT,   8, 1},
-    {GPDS_TOUCHPAD_CLICK_ACTION,               "Synaptics Click Action",                G_TYPE_INT,   8, 1},
+    {GPDS_TOUCHPAD_CLICK_ACTION,               "Synaptics Click Action",                G_TYPE_INT,   8, 3},
     {GPDS_TOUCHPAD_CIRCULAR_SCROLLING,         "Synaptics Circular Scrolling",          G_TYPE_INT,   8, 1},
     {GPDS_TOUCHPAD_CIRCULAR_SCROLLING_DISTANCE,"Synaptics Circular Scrolling Distance", G_TYPE_FLOAT, 0, 1},
     {GPDS_TOUCHPAD_CIRCULAR_SCROLLING_TRIGGER, "Synaptics Circular Scrolling Trigger",  G_TYPE_INT,   8, 1},

Modified: trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c
==============================================================================
--- trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c	(original)
+++ trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c	Sat Mar 28 00:35:33 2009
@@ -116,6 +116,35 @@
                                    3);
 }
 
+static void
+set_click_action (GsdPointingDeviceManager *manager,
+                  GpdsXInput *xinput,
+                  GConfClient *gconf)
+{
+    gint properties[3];
+
+    gsd_pointing_device_manager_get_gconf_int(manager,
+                                              gconf,
+                                              GPDS_TOUCHPAD_CLICK_ACTION_FINGER1_KEY,
+                                              &properties[0]);
+
+    gsd_pointing_device_manager_get_gconf_int(manager,
+                                              gconf,
+                                              GPDS_TOUCHPAD_CLICK_ACTION_FINGER2_KEY,
+                                              &properties[1]);
+
+    gsd_pointing_device_manager_get_gconf_int(manager,
+                                              gconf,
+                                              GPDS_TOUCHPAD_CLICK_ACTION_FINGER3_KEY,
+                                              &properties[2]);
+
+    gpds_xinput_set_int_properties(xinput,
+                                   GPDS_TOUCHPAD_CLICK_ACTION,
+                                   NULL,
+                                   properties,
+                                   3);
+}
+
 static gboolean
 start_manager (GsdPointingDeviceManager *manager)
 {
@@ -147,6 +176,7 @@
     set_circular_scrolling(manager, xinput, gconf);
     set_circular_scrolling_trigger(manager, xinput, gconf);
     set_two_finger_scrolling(manager, xinput, gconf);
+    set_click_action(manager, xinput, gconf);
 
     g_object_unref(gconf);
     g_object_unref(xinput);
@@ -222,6 +252,10 @@
         } else if (!strcmp(key, GPDS_TOUCHPAD_PALM_DETECTION_WIDTH_KEY) ||
                    !strcmp(key, GPDS_TOUCHPAD_PALM_DETECTION_DEPTH_KEY)) {
             set_palm_dimensions(manager, xinput, client);
+        } else if (!strcmp(key, GPDS_TOUCHPAD_CLICK_ACTION_FINGER1_KEY) ||
+                   !strcmp(key, GPDS_TOUCHPAD_CLICK_ACTION_FINGER2_KEY) ||
+                   !strcmp(key, GPDS_TOUCHPAD_CLICK_ACTION_FINGER3_KEY)) {
+            set_click_action(manager, xinput, client);
         }
         break;
     default:

Modified: trunk/modules/gpds-mouse-ui.c
==============================================================================
--- trunk/modules/gpds-mouse-ui.c	(original)
+++ trunk/modules/gpds-mouse-ui.c	Sat Mar 28 00:35:33 2009
@@ -34,8 +34,8 @@
 #define GPDS_TYPE_MOUSE_UI            (gpds_mouse_ui_get_type())
 #define GPDS_MOUSE_UI(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GPDS_TYPE_MOUSE_UI, GpdsMouseUI))
 #define GPDS_MOUSE_UI_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GPDS_TYPE_MOUSE_UI, GpdsMouseUIClass))
-#define G_IS_MOUSE_UI(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GPDS_TYPE_MOUSE_UI))
-#define G_IS_MOUSE_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GPDS_TYPE_MOUSE_UI))
+#define G_IS_MOUSE_UI(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GPDS_TYPE_MOUSE_UI))
+#define G_IS_MOUSE_UI_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GPDS_TYPE_MOUSE_UI))
 #define GPDS_MOUSE_UI_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), GPDS_TYPE_MOUSE_UI, GpdsMouseUIClass))
 
 typedef struct _GpdsMouseUI GpdsMouseUI;

Modified: trunk/modules/gpds-touchpad-ui.c
==============================================================================
--- trunk/modules/gpds-touchpad-ui.c	(original)
+++ trunk/modules/gpds-touchpad-ui.c	Sat Mar 28 00:35:33 2009
@@ -698,6 +698,29 @@
 }
 
 static void
+set_click_action (GpdsUI *ui)
+{
+    gint *values;
+    gulong n_values;
+    gint key;
+
+    if (!gpds_xinput_ui_get_xinput_int_property(GPDS_XINPUT_UI(ui),
+                                                GPDS_TOUCHPAD_CLICK_ACTION,
+                                                &values, &n_values)) {
+        return;
+    }
+
+    if (!gpds_ui_get_gconf_int(ui, GPDS_TOUCHPAD_CLICK_ACTION_FINGER1_KEY, (gint*)&key))
+        key = values[0];
+    if (!gpds_ui_get_gconf_int(ui, GPDS_TOUCHPAD_CLICK_ACTION_FINGER2_KEY, (gint*)&key))
+        key = values[1];
+    if (!gpds_ui_get_gconf_int(ui, GPDS_TOUCHPAD_CLICK_ACTION_FINGER3_KEY, (gint*)&key))
+        key = values[2];
+
+    g_free(values);
+}
+
+static void
 setup_current_values (GpdsUI *ui, GtkBuilder *builder)
 {
     GpdsXInputUI *xinput_ui = GPDS_XINPUT_UI(ui);
@@ -730,6 +753,7 @@
     set_circular_scrolling_trigger_property_from_preference(ui, builder);
     set_two_finger_scrolling_property_from_preference(ui, builder);
     set_touchpad_use_type_property_from_preference(ui);
+    set_click_action(ui);
 }
 
 static gboolean



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