- if (!reconfig)
- /* get the initial size */
- screen_resize();
-
- /* set the names */
- screen_desktop_names = g_new(gchar*,
- g_slist_length(config_desktops_names) + 1);
- for (i = 0, it = config_desktops_names; it; ++i, it = g_slist_next(it))
- screen_desktop_names[i] = it->data; /* dont strdup */
- screen_desktop_names[i] = NULL;
- PROP_SETSS(RootWindow(ob_display, ob_screen),
- net_desktop_names, screen_desktop_names);
- g_free(screen_desktop_names); /* dont free the individual strings */
- screen_desktop_names = NULL;
+ if (reconfig) {
+ /* update the pager popup's width */
+ pager_popup_text_width_to_strings(desktop_cycle_popup,
+ screen_desktop_names,
+ screen_num_desktops);
+ return;
+ }
+
+ /* get the initial size */
+ screen_resize();
+
+ /* have names already been set for the desktops? */
+ if (PROP_GETSS(RootWindow(ob_display, ob_screen),
+ net_desktop_names, utf8, &names))
+ {
+ g_strfreev(names);
+ namesexist = TRUE;
+ }
+
+ /* if names don't exist and we have session names, set those.
+ do this stuff BEFORE setting the number of desktops, because that
+ will create default names for them
+ */
+ if (!namesexist && session_desktop_names != NULL) {
+ guint i, numnames;
+ GSList *it;
+
+ /* get the desktop names */
+ numnames = g_slist_length(session_desktop_names);
+ names = g_new(gchar*, numnames + 1);
+ names[numnames] = NULL;
+ for (i = 0, it = session_desktop_names; it; ++i, it = g_slist_next(it))
+ names[i] = g_strdup(it->data);
+
+ /* set the root window property */
+ PROP_SETSS(RootWindow(ob_display, ob_screen), net_desktop_names,names);
+
+ g_strfreev(names);
+ }