- /* get the names */
- if (PROP_GETSS(RootWindow(ob_display, ob_screen),
- net_desktop_names, utf8, &screen_desktop_names))
- for (i = 0; screen_desktop_names[i]; ++i);
- else
- i = 0;
- for (it = g_slist_nth(config_desktops_names, i); it;
- it = g_slist_next(it), ++i)
- {
- screen_desktop_names = g_renew(gchar*, screen_desktop_names, i + 2);
- screen_desktop_names[i+1] = NULL;
- screen_desktop_names[i] = g_strdup(it->data);
- }
- /* then set the names */
- PROP_SETSS(RootWindow(ob_display, ob_screen),
- net_desktop_names, screen_desktop_names);
- g_strfreev(screen_desktop_names);
- screen_desktop_names = NULL;
+ /* get the initial size */
+ screen_resize();
+
+ /* get the desktop names */
+ numnames = g_slist_length(config_desktops_names);
+ names = g_new(gchar*, numnames + 1);
+ names[numnames] = NULL;
+ for (i = 0, it = config_desktops_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);