summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-23 03:16:45 +0000
committerDana Jansens <danakj@orodu.net>2007-05-23 03:16:45 +0000
commit1cafe0ba4c11baf1f2214c10c1e00ea930d63adc (patch)
treed83996339cc00e06e0ea1957a734f4323fb637d3
parent6f6ab8c442b1626a1cd28868900a00fe4bf8cb08 (diff)
set the desktop names when there are too few from the config file when possible. otherwise use "desktop %d".
if we change the desktop names at all, set the root hint so other apps know about it too and we can all agree
-rw-r--r--openbox/screen.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/openbox/screen.c b/openbox/screen.c
index c92aee18..b9cbdd2c 100644
--- a/openbox/screen.c
+++ b/openbox/screen.c
@@ -900,11 +900,28 @@ void screen_update_desktop_names()
else
i = 0;
if (i < screen_num_desktops) {
+ GSList *it;
+
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; ++i)
- screen_desktop_names[i] = g_strdup_printf("desktop %i", i + 1);
+
+ it = g_slist_nth(config_desktops_names, i);
+
+ for (; i < screen_num_desktops; ++i) {
+ if (it)
+ /* use the names from the config file when possible */
+ screen_desktop_names[i] = g_strdup(it->data);
+ else
+ /* make up a nice name if it's not though */
+ screen_desktop_names[i] = g_strdup_printf("desktop %i", i + 1);
+ if (it) it = g_slist_next(it);
+ }
+
+ /* if we changed any names, then set the root property so we can
+ all agree on the names */
+ PROP_SETSS(RootWindow(ob_display, ob_screen), net_desktop_names,
+ screen_desktop_names);
}
/* resize the pager for these names */