diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-05-07 06:33:43 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-05-07 06:33:43 +0000 |
| commit | 82b2f0aa7a1723632e8d3cf7dc772e4bdb66868a (patch) | |
| tree | fd0462371bc35919c778b157b31cb0aa7849af48 /openbox/screen.c | |
| parent | 15007a62c2b2bd9b55ad2c96f1cd7a45c79a0afc (diff) | |
popups fixes. if the text for the popup is empty now, there wont be extra padding for it. desktop name fixes.
Diffstat (limited to 'openbox/screen.c')
| -rw-r--r-- | openbox/screen.c | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/openbox/screen.c b/openbox/screen.c index da68d2dc..1faf521e 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -299,41 +299,29 @@ gboolean screen_annex(const gchar *program_name) void screen_startup(gboolean reconfig) { - guint i, numnames; + if (!reconfig) { + guint i, numnames; + gchar **names; + GSList *it; - if (!reconfig) /* get the initial size */ screen_resize(); - desktop_cycle_popup = pager_popup_new(FALSE); - pager_popup_height(desktop_cycle_popup, POPUP_HEIGHT); + /* 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); -#if 0 - /* 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 -#endif - i = 0; - 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; + /* set the root window property */ + PROP_SETSS(RootWindow(ob_display, ob_screen), net_desktop_names,names); - for (it = g_slist_nth(config_desktops_names, i); it; - it = g_slist_next(it), ++i) - { - screen_desktop_names[i] = g_strdup(it->data); - } + g_strfreev(names); } - /* 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; + + desktop_cycle_popup = pager_popup_new(FALSE); + pager_popup_height(desktop_cycle_popup, POPUP_HEIGHT); if (!reconfig) screen_num_desktops = 0; |
