[gnome-settings-daemon] wacom: Avoid a warning at login



commit 670433bff4da5ec0d3738411fa0c06de18db0073
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jul 19 20:02:36 2012 -0400

    wacom: Avoid a warning at login
    
    The wacom plugin calls init_screens before creating the devices
    hash table in gsd_wacom_manager_idle_cb. init_screens connects to
    the ::changed signal on GnomeRRScreens, and the signal handler
    assumes that the devices hash table has been created. When we
    are logging in, the ::changed signal is emitted before the idle
    callback has a chance to run, causing a critical warning out
    of g_hash_table_get_values.
    
    Avoid that by ignoring the ::changed signal if the devices hash
    table is not created yet.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=680291

 plugins/wacom/gsd-wacom-manager.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index 2e88479..17854cf 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -1191,6 +1191,14 @@ on_screen_changed_cb (GnomeRRScreen *rr_screen,
 {
 	GList *devices, *l;
 
+        /*
+         * A ::changed signal may be received at startup before
+         * the devices get added, in this case simply ignore the
+         * notification
+         */
+        if (manager->priv->devices == NULL)
+                return;
+
         g_debug ("Screen configuration changed");
 	devices = g_hash_table_get_values (manager->priv->devices);
 	for (l = devices; l != NULL; l = l->next) {



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