desktop name
git-svn-id: http://tint2.googlecode.com/svn/trunk@600 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
edc5db91c6
commit
d32b4ed908
1 changed files with 26 additions and 6 deletions
|
@ -49,11 +49,26 @@ void init_taskbarname_panel(void *p)
|
||||||
{
|
{
|
||||||
Panel *panel =(Panel*)p;
|
Panel *panel =(Panel*)p;
|
||||||
Taskbar *tskbar;
|
Taskbar *tskbar;
|
||||||
int j;
|
int j, count;
|
||||||
|
|
||||||
if (!taskbarname_enabled) return;
|
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];
|
tskbar = &panel->taskbar[j];
|
||||||
memcpy(&tskbar->bar_name.area, &panel->g_taskbar.area_name, sizeof(Area));
|
memcpy(&tskbar->bar_name.area, &panel->g_taskbar.area_name, sizeof(Area));
|
||||||
tskbar->bar_name.area.parent = tskbar;
|
tskbar->bar_name.area.parent = tskbar;
|
||||||
|
@ -61,7 +76,15 @@ void init_taskbarname_panel(void *p)
|
||||||
tskbar->bar_name.area.bg = panel->g_taskbar.background_name[TASKBAR_ACTIVE];
|
tskbar->bar_name.area.bg = panel->g_taskbar.background_name[TASKBAR_ACTIVE];
|
||||||
else
|
else
|
||||||
tskbar->bar_name.area.bg = panel->g_taskbar.background_name[TASKBAR_NORMAL];
|
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
|
// append the name at the beginning of taskbar
|
||||||
tskbar->area.list = g_slist_append(tskbar->area.list, &tskbar->bar_name);
|
tskbar->area.list = g_slist_append(tskbar->area.list, &tskbar->bar_name);
|
||||||
|
@ -147,6 +170,3 @@ int resize_taskbarname(void *obj)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue