[gnome-settings-daemon] wacom: Warn when devices use the fallback definition
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: Warn when devices use the fallback definition
- Date: Tue, 28 May 2013 10:47:08 +0000 (UTC)
commit 66e822badbc256fc48716215d15d50544476e1d7
Author: Joaquim Rocha <jrocha redhat com>
Date: Tue May 28 11:08:03 2013 +0200
wacom: Warn when devices use the fallback definition
It just warns once per device.
https://bugzilla.gnome.org/show_bug.cgi?id=668611
plugins/wacom/gsd-wacom-manager.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index 51fa57c..1cd842c 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -88,6 +88,7 @@ struct GsdWacomManagerPrivate
guint device_removed_id;
GHashTable *devices; /* key = GdkDevice, value = GsdWacomDevice */
GnomeRRScreen *rr_screen;
+ GHashTable *warned_devices;
/* button capture */
GdkScreen *screen;
@@ -1005,8 +1006,25 @@ device_added_cb (GdkDeviceManager *device_manager,
{
GsdWacomDevice *device;
GSettings *settings;
+ const gchar *device_name;
device = gsd_wacom_device_new (gdk_device);
+ device_name = gsd_wacom_device_get_name (device);
+
+ if (gsd_wacom_device_is_fallback (device) &&
+ gsd_wacom_device_get_device_type (device) != WACOM_TYPE_TOUCH &&
+ device_name != NULL) {
+ GHashTable *warned_devices;
+
+ warned_devices = manager->priv->warned_devices;
+
+ if (!g_hash_table_contains (warned_devices, device_name)) {
+ g_warning ("No definition for '%s' found in the tablet database. Using a fallback
one.",
+ device_name);
+ g_hash_table_insert (warned_devices, g_strdup (device_name), NULL);
+ }
+ }
+
if (gsd_wacom_device_get_device_type (device) == WACOM_TYPE_INVALID) {
g_object_unref (device);
return;
@@ -1389,6 +1407,8 @@ gsd_wacom_manager_idle_cb (GsdWacomManager *manager)
gnome_settings_profile_start (NULL);
+ manager->priv->warned_devices = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+
manager->priv->devices = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
set_devicepresence_handler (manager);
@@ -1724,6 +1744,11 @@ gsd_wacom_manager_finalize (GObject *object)
g_return_if_fail (wacom_manager->priv != NULL);
+ if (wacom_manager->priv->warned_devices) {
+ g_hash_table_destroy (wacom_manager->priv->warned_devices);
+ wacom_manager->priv->warned_devices = NULL;
+ }
+
if (wacom_manager->priv->devices) {
g_hash_table_destroy (wacom_manager->priv->devices);
wacom_manager->priv->devices = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]