]> Dogcows Code - chaz/tint2/blobdiff - src/taskbar/task.c
*change* make tooltip more generous, and preparation for setting a tooltip on the...
[chaz/tint2] / src / taskbar / task.c
index 4e85c9450e8e47ef99c6e2d996db4994955c2013..0d69e1536d8e52ed623a1c59f2a122ce7ac5113a 100644 (file)
 
 static int urgent_timer = 0;
 
+const char* task_get_tooltip(void* obj)
+{
+       Task* t = obj;
+       return t->title;
+}
+
+
 Task *add_task (Window win)
 {
        if (!win) return 0;
@@ -82,6 +89,7 @@ Task *add_task (Window win)
                                new_tsk2->area.on_screen = 0;
                        }
                        new_tsk2->title = new_tsk.title;
+                       new_tsk2->area._get_tooltip_text = task_get_tooltip;
                        new_tsk2->icon = new_tsk.icon;
                        new_tsk2->icon_active = new_tsk.icon_active;
                        new_tsk2->icon_width = new_tsk.icon_width;
@@ -102,12 +110,6 @@ void remove_task (Task *tsk)
        Window win = tsk->win;
        int desktop = tsk->desktop;
 
-       if (g_tooltip.task == tsk) {
-               tooltip_hide();
-               alarm(0);
-               g_tooltip.task = 0;
-       }
-
        // free title and icon just for the first task
        // even with task_on_all_desktop and with task_on_all_panel
        //printf("remove_task %s %d\n", tsk->title, tsk->desktop);
@@ -159,12 +161,6 @@ void get_title(Task *tsk)
 
        if (!panel->g_task.text && !g_tooltip.enabled) return;
 
-       if (g_tooltip.task == tsk) {
-               tooltip_hide();
-               alarm(0);
-               g_tooltip.task = 0;
-       }
-
        name = server_get_property (tsk->win, server.atom._NET_WM_VISIBLE_NAME, server.atom.UTF8_STRING, 0);
        if (!name || !strlen(name)) {
                name = server_get_property (tsk->win, server.atom._NET_WM_NAME, server.atom.UTF8_STRING, 0);
This page took 0.022782 seconds and 4 git commands to generate.