[gnome-control-center] wacom: Update from gnome-settings-daemon



commit ee1fc0744d698ae3fdb5687a65c2742ae9de5779
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Feb 28 10:35:19 2012 +0000

    wacom: Update from gnome-settings-daemon

 panels/wacom/gsd-wacom-device.c |   18 ++++++++++++++++--
 panels/wacom/gsd-wacom-device.h |    1 -
 2 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/panels/wacom/gsd-wacom-device.c b/panels/wacom/gsd-wacom-device.c
index f10f04c..0f0ae0b 100644
--- a/panels/wacom/gsd-wacom-device.c
+++ b/panels/wacom/gsd-wacom-device.c
@@ -1336,6 +1336,15 @@ gsd_wacom_device_finalize (GObject *object)
         g_free (p->icon_name);
         p->icon_name = NULL;
 
+        if (p->modes) {
+                g_hash_table_destroy (p->modes);
+                p->modes = NULL;
+        }
+        if (p->num_modes) {
+                g_hash_table_destroy (p->num_modes);
+                p->num_modes = NULL;
+        }
+
 	gdk_window_remove_filter (NULL,
 				  (GdkFilterFunc) filter_events,
 				  device);
@@ -1581,7 +1590,7 @@ find_button_with_index (GsdWacomDevice *device,
 	GsdWacomTabletButton *button;
 	char *str;
 
-	str = g_strdup_printf ("%s-mode-%d", id, index + 1);
+	str = g_strdup_printf ("%s-mode-%d", id, index);
 	button = find_button_with_id (device, str);
 	g_free (str);
 
@@ -1591,9 +1600,10 @@ find_button_with_index (GsdWacomDevice *device,
 GsdWacomTabletButton *
 gsd_wacom_device_get_button (GsdWacomDevice   *device,
 			     int               button,
-			     int               index,
 			     GtkDirectionType *dir)
 {
+	int index;
+
 	if (button <= 26) {
 		char *id;
 		GsdWacomTabletButton *ret;
@@ -1633,15 +1643,19 @@ gsd_wacom_device_get_button (GsdWacomDevice   *device,
 	switch (button) {
 	case 90:
 	case 91:
+		index = GPOINTER_TO_INT (g_hash_table_lookup (device->priv->modes, GINT_TO_POINTER (1)));
 		return find_button_with_index (device, "left-ring", index);
 	case 92:
 	case 93:
+		index = GPOINTER_TO_INT (g_hash_table_lookup (device->priv->modes, GINT_TO_POINTER (2)));
 		return find_button_with_index (device, "right-ring", index);
 	case 94:
 	case 95:
+		index = GPOINTER_TO_INT (g_hash_table_lookup (device->priv->modes, GINT_TO_POINTER (3)));
 		return find_button_with_index (device, "left-strip", index);
 	case 96:
 	case 97:
+		index = GPOINTER_TO_INT (g_hash_table_lookup (device->priv->modes, GINT_TO_POINTER (4)));
 		return find_button_with_index (device, "right-strip", index);
 	default:
 		return NULL;
diff --git a/panels/wacom/gsd-wacom-device.h b/panels/wacom/gsd-wacom-device.h
index f7b239f..0352d01 100644
--- a/panels/wacom/gsd-wacom-device.h
+++ b/panels/wacom/gsd-wacom-device.h
@@ -148,7 +148,6 @@ const char     * gsd_wacom_device_type_to_string    (GsdWacomDeviceType type);
 GList          * gsd_wacom_device_get_buttons       (GsdWacomDevice *device);
 GsdWacomTabletButton *gsd_wacom_device_get_button   (GsdWacomDevice   *device,
 						     int               button,
-						     int               index,
 						     GtkDirectionType *dir);
 int gsd_wacom_device_set_next_mode                  (GsdWacomDevice *device,
 						     int             group_id);



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