panel_config.g_taskbar.background[TASKBAR_NORMAL] = &g_array_index(backgrounds, Background, id);
if (panel_config.g_taskbar.background[TASKBAR_ACTIVE] == 0)
panel_config.g_taskbar.background[TASKBAR_ACTIVE] = panel_config.g_taskbar.background[TASKBAR_NORMAL];
- //panel_config.g_taskbar.area.bg = panel_config.g_taskbar.bg;
}
else if (strcmp (key, "taskbar_active_background_id") == 0) {
int id = atoi (value);
}
-void get_title(Task *tsk)
+int get_title(Task *tsk)
{
Panel *panel = tsk->area.panel;
char *title, *name;
- if (!panel->g_task.text && !g_tooltip.enabled) return;
+ if (!panel->g_task.text && !g_tooltip.enabled) return 0;
name = server_get_property (tsk->win, server.atom._NET_WM_VISIBLE_NAME, server.atom.UTF8_STRING, 0);
if (!name || !strlen(name)) {
else title[0] = 0;
strcat(title, name);
if (name) XFree (name);
-
- if (tsk->title)
- free(tsk->title);
+
+ if (tsk->title) {
+ // check unecessary title change
+ if (strcmp(tsk->title, title) == 0) {
+ free(title);
+ return 0;
+ }
+ else
+ free(tsk->title);
+ }
tsk->title = title;
GPtrArray* task_group = task_get_tasks(tsk->win);
set_task_redraw(tsk2);
}
}
- set_task_redraw(tsk);
+ return 1;
}
set_task_redraw(tsk2);
}
}
- set_task_redraw(tsk);
}
void on_change_task (void *obj);
void get_icon (Task *tsk);
-void get_title(Task *tsk);
+int get_title(Task *tsk);
void active_task();
void set_task_state(Task* tsk, int state);
void set_task_redraw(Task* tsk);
// Window title changed
if (at == server.atom._NET_WM_VISIBLE_NAME || at == server.atom._NET_WM_NAME || at == server.atom.WM_NAME) {
- get_title(tsk);
- if (g_tooltip.mapped && (g_tooltip.area == (Area*)tsk)) {
- tooltip_copy_text((Area*)tsk);
- tooltip_update();
+ if (get_title(tsk)) {
+ if (g_tooltip.mapped && (g_tooltip.area == (Area*)tsk)) {
+ tooltip_copy_text((Area*)tsk);
+ tooltip_update();
+ }
+ panel_refresh = 1;
}
- panel_refresh = 1;
}
// Demand attention
else if (at == server.atom._NET_WM_STATE) {