we werent dropping it in screen, we were dropping it in prop

This commit is contained in:
Dana Jansens 2007-05-07 05:58:02 +00:00
parent 8d81088eb9
commit 5e8dfcfe54
2 changed files with 17 additions and 12 deletions

View file

@ -328,7 +328,7 @@ gboolean prop_get_strings_locale(Window win, Atom prop, gchar ***ret)
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 @@ gboolean prop_get_strings_utf8(Window win, Atom prop, gchar ***ret)
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 */

View file

@ -299,8 +299,7 @@ gboolean screen_annex(const gchar *program_name)
void screen_startup(gboolean reconfig)
{
GSList *it;
guint i;
guint i, numnames;
if (!reconfig)
/* get the initial size */
@ -317,12 +316,18 @@ void screen_startup(gboolean reconfig)
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 @@ void screen_update_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);
}