[metacity/bug625781] When we're first reading in the workspace names, set any which don't get assigned a name of their ow



commit 04d5891337bb09f64e51d4be5f5c48b2ea60c547
Author: Thomas Thurman <tthurman gnome org>
Date:   Tue Aug 3 08:35:08 2010 -0400

    When we're first reading in the workspace names, set any which don't get assigned a name of their own to a default value. Fixes: 625781

 src/core/prefs.c           |   13 +++++++++----
 src/metacity.schemas.in.in |   22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+), 4 deletions(-)
---
diff --git a/src/core/prefs.c b/src/core/prefs.c
index af6e304..fdedef4 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -1929,6 +1929,10 @@ init_commands (void)
 static void
 init_workspace_names (void)
 {
+  int i;
+  for (i = 0; i < MAX_REASONABLE_WORKSPACES; i++)
+    workspace_names[i] = NULL;
+
 #ifdef HAVE_GCONF
   GSList *list, *l;
   const char *str_val;
@@ -1947,14 +1951,15 @@ init_workspace_names (void)
       gconf_entry_free (entry);
     }
   g_slist_free (list);
-#else
-  int i;
+#endif /* HAVE_GCONF */
+
+  /* initialise any we didn't see */
   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
diff --git a/src/metacity.schemas.in.in b/src/metacity.schemas.in.in
index 97cd280..466b6dd 100644
--- a/src/metacity.schemas.in.in
+++ b/src/metacity.schemas.in.in
@@ -391,6 +391,28 @@
       <applyto>/apps/metacity/workspace_names/name_14</applyto>
       <applyto>/apps/metacity/workspace_names/name_15</applyto>
       <applyto>/apps/metacity/workspace_names/name_16</applyto>
+      <applyto>/apps/metacity/workspace_names/name_17</applyto>
+      <applyto>/apps/metacity/workspace_names/name_18</applyto>
+      <applyto>/apps/metacity/workspace_names/name_19</applyto>
+      <applyto>/apps/metacity/workspace_names/name_20</applyto>
+      <applyto>/apps/metacity/workspace_names/name_21</applyto>
+      <applyto>/apps/metacity/workspace_names/name_22</applyto>
+      <applyto>/apps/metacity/workspace_names/name_23</applyto>
+      <applyto>/apps/metacity/workspace_names/name_24</applyto>
+      <applyto>/apps/metacity/workspace_names/name_25</applyto>
+      <applyto>/apps/metacity/workspace_names/name_26</applyto>
+      <applyto>/apps/metacity/workspace_names/name_27</applyto>
+      <applyto>/apps/metacity/workspace_names/name_28</applyto>
+      <applyto>/apps/metacity/workspace_names/name_29</applyto>
+      <applyto>/apps/metacity/workspace_names/name_30</applyto>
+      <applyto>/apps/metacity/workspace_names/name_31</applyto>
+      <applyto>/apps/metacity/workspace_names/name_32</applyto>
+      <applyto>/apps/metacity/workspace_names/name_33</applyto>
+      <applyto>/apps/metacity/workspace_names/name_34</applyto>
+      <applyto>/apps/metacity/workspace_names/name_35</applyto>
+      <applyto>/apps/metacity/workspace_names/name_36</applyto>
+      <owner>metacity</owner>
+
       <owner>metacity</owner>
       <type>string</type>
       <default></default>



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