{
Panel *panel =(Panel*)p;
Taskbar *tskbar;
- int j;
+ int j, count;
if (!taskbarname_enabled) return;
- for (j=0 ; j < panel->nb_desktop ; j++) {
+ GList *list = NULL;
+ gchar *data_ptr, *ptr;
+ data_ptr = server_get_property (server.root_win, server.atom._NET_DESKTOP_NAMES, server.atom.UTF8_STRING, &count);
+ if (data_ptr) {
+ list = g_list_append(list, g_strdup(data_ptr));
+ for (j = 0; j < count-1; j++) {
+ if (*(data_ptr + j) == '\0') {
+ ptr = (gchar*)data_ptr + j + 1;
+ list = g_list_append(list, g_strdup(ptr));
+ }
+ }
+ XFree(data_ptr);
+ }
+
+ GList *l;
+ for (j=0, l=list ; j < panel->nb_desktop ; j++) {
tskbar = &panel->taskbar[j];
memcpy(&tskbar->bar_name.area, &panel->g_taskbar.area_name, sizeof(Area));
tskbar->bar_name.area.parent = tskbar;
tskbar->bar_name.area.bg = panel->g_taskbar.background_name[TASKBAR_ACTIVE];
else
tskbar->bar_name.area.bg = panel->g_taskbar.background_name[TASKBAR_NORMAL];
- tskbar->bar_name.name = g_strdup_printf("%d", j+1);
+
+ if (l) {
+ tskbar->bar_name.name = g_strdup(l->data);
+ l = l->next;
+ }
+ else {
+ // use desktop number if name is missing
+ tskbar->bar_name.name = g_strdup_printf("%d", j+1);
+ }
// append the name at the beginning of taskbar
tskbar->area.list = g_slist_append(tskbar->area.list, &tskbar->bar_name);
return ret;
}
-
-
-