[mutter] Make sure all workspaces have a non-empty, non-null name



commit 94d47dc25e91ddcd9fd9d87995bd2355f93499fe
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon Apr 12 13:14:46 2010 -0400

    Make sure all workspaces have a non-empty, non-null name
    
    The change to using gconf_client_all_entries() in commit 2d57b1b4
    meant that workspaces without a GConf key for their name were not
    getting a name at all. Fix this by doing a post-processing loop
    to set workspace names that were not otherwise set.
    
    Alternate to patch from Tomas Frydrych
    https://bugzilla.gnome.org/show_bug.cgi?id=613136

 src/core/prefs.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 3435fbb..2b92633 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -2004,6 +2004,8 @@ init_commands (void)
 static void
 init_workspace_names (void)
 {
+  int i;
+
 #ifdef HAVE_GCONF
   GSList *list, *l;
   const char *str_val;
@@ -2022,14 +2024,14 @@ init_workspace_names (void)
       gconf_entry_free (entry);
     }
   g_slist_free (list);
-#else
-  int i;
+#endif /* HAVE_GCONF */
+
   for (i = 0; i < MAX_REASONABLE_WORKSPACES; i++)
-    workspace_names[i] = g_strdup_printf (_("Workspace %d"), i + 1);
+    if (workspace_names[i] == NULL)
+      workspace_names[i] = g_strdup_printf (_("Workspace %d"), i + 1);
 
   meta_topic (META_DEBUG_PREFS,
               "Initialized workspace names\n");
-#endif /* HAVE_GCONF */
 }
 
 static gboolean



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