we werent dropping it in screen, we were dropping it in prop
Dana Jansens danakj@orodu.net
2 files changed,
17 insertions(+),
12 deletions(-)
M
openbox/prop.c
→
openbox/prop.c
@@ -328,7 +328,7 @@
if (get_all(win, prop, prop_atoms.string, 8, (guchar**)&raw, &num)) { p = raw; - while (p < raw + num - 1) { + while (p < raw + num) { ++count; strs = g_slist_append(strs, p); p += strlen(p) + 1; /* next string */@@ -377,7 +377,7 @@
if (get_all(win, prop, prop_atoms.utf8, 8, (guchar**)&raw, &num)) { p = raw; - while (p < raw + num - 1) { + while (p < raw + num) { ++count; strs = g_slist_append(strs, p); p += strlen(p) + 1; /* next string */
M
openbox/screen.c
→
openbox/screen.c
@@ -299,8 +299,7 @@ }
void screen_startup(gboolean reconfig) { - GSList *it; - guint i; + guint i, numnames; if (!reconfig) /* get the initial size */@@ -317,12 +316,18 @@ for (i = 0; screen_desktop_names[i]; ++i);
else #endif 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] = g_strdup(it->data); - screen_desktop_names[i+1] = NULL; + numnames = g_slist_length(config_desktops_names); + if (numnames > i) { + GSList *it; + + screen_desktop_names = g_renew(gchar*,screen_desktop_names,numnames+1); + screen_desktop_names[numnames] = NULL; + + for (it = g_slist_nth(config_desktops_names, i); it; + it = g_slist_next(it), ++i) + { + screen_desktop_names[i] = g_strdup(it->data); + } } /* then set the names */ PROP_SETSS(RootWindow(ob_display, ob_screen),@@ -883,11 +888,11 @@ net_desktop_names, utf8, &screen_desktop_names))
for (i = 0; screen_desktop_names[i] && i < screen_num_desktops; ++i); else i = 0; - if (i < screen_num_desktops - 1) { + if (i < screen_num_desktops) { screen_desktop_names = g_renew(gchar*, screen_desktop_names, screen_num_desktops + 1); screen_desktop_names[screen_num_desktops] = NULL; - for (; i < screen_num_desktops - 1; ++i) + for (; i < screen_num_desktops; ++i) screen_desktop_names[i] = g_strdup_printf("desktop %i", i + 1); }