[gnome-settings-daemon] wacom: flag unknown devices created from fallback



commit c4c4637972128eb0ac18c257dbd2e0a39f12487c
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Wed Jun 6 18:04:05 2012 +0200

    wacom: flag unknown devices created from fallback
    
    so we can report that in the UI.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677562

 plugins/wacom/gsd-wacom-device.c |   10 ++++++++++
 plugins/wacom/gsd-wacom-device.h |    1 +
 plugins/wacom/list-wacom.c       |    1 +
 3 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index 060fd57..4f0ed85 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -321,6 +321,7 @@ struct GsdWacomDevicePrivate
 	char *tool_name;
 	gboolean reversible;
 	gboolean is_screen_tablet;
+	gboolean is_fallback;
 	GList *styli;
 	GsdWacomStylus *last_stylus;
 	GList *buttons;
@@ -1220,6 +1221,7 @@ gsd_wacom_device_constructor (GType                     type,
 			 gdk_device_get_name (device->priv->gdk_device),
 			 device->priv->path);
 
+		device->priv->is_fallback = TRUE;
 		wacom_error = libwacom_error_new ();
 		wacom_device = libwacom_new_from_path (db, device->priv->path, TRUE, wacom_error);
 		if (wacom_device == NULL) {
@@ -1459,6 +1461,14 @@ gsd_wacom_device_is_screen_tablet (GsdWacomDevice *device)
 	return device->priv->is_screen_tablet;
 }
 
+gboolean
+gsd_wacom_device_is_fallback (GsdWacomDevice *device)
+{
+	g_return_val_if_fail (GSD_IS_WACOM_DEVICE (device), FALSE);
+
+	return device->priv->is_fallback;
+}
+
 GSettings *
 gsd_wacom_device_get_settings (GsdWacomDevice *device)
 {
diff --git a/plugins/wacom/gsd-wacom-device.h b/plugins/wacom/gsd-wacom-device.h
index 327b488..b59493d 100644
--- a/plugins/wacom/gsd-wacom-device.h
+++ b/plugins/wacom/gsd-wacom-device.h
@@ -137,6 +137,7 @@ const char     * gsd_wacom_device_get_icon_name    (GsdWacomDevice *device);
 const char     * gsd_wacom_device_get_tool_name    (GsdWacomDevice *device);
 gboolean         gsd_wacom_device_reversible       (GsdWacomDevice *device);
 gboolean         gsd_wacom_device_is_screen_tablet (GsdWacomDevice *device);
+gboolean         gsd_wacom_device_is_fallback      (GsdWacomDevice *device);
 GSettings      * gsd_wacom_device_get_settings     (GsdWacomDevice *device);
 void             gsd_wacom_device_set_current_stylus (GsdWacomDevice *device,
 						      int             stylus_id);
diff --git a/plugins/wacom/list-wacom.c b/plugins/wacom/list-wacom.c
index 2008906..6f19633 100644
--- a/plugins/wacom/list-wacom.c
+++ b/plugins/wacom/list-wacom.c
@@ -195,6 +195,7 @@ list_devices (GList *devices)
 			 gsd_wacom_device_type_to_string (gsd_wacom_device_get_device_type (device)));
 		g_print ("\tReversible: %s\n", BOOL_AS_STR (gsd_wacom_device_reversible (device)));
 		g_print ("\tScreen Tablet: %s\n", BOOL_AS_STR (gsd_wacom_device_is_screen_tablet (device)));
+		g_print ("\tUnknown (fallback) device: %s\n", BOOL_AS_STR(gsd_wacom_device_is_fallback (device)));
 
 		loc = get_loc (gsd_wacom_device_get_settings (device));
 		g_print ("\tGeneric settings: %s\n", loc);



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