X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Ftaskbar%2Ftaskbar.c;h=60a74060bd5d59682dada024e499cd9e61dbc2c2;hb=b1cdb484a3b06d20e0b9b14ae0c98721ad3fead0;hp=45388921c2b96392a951d5221e315171aa723528;hpb=1aa4d290a90cfc14416f43b205523a6bf401d973;p=chaz%2Ftint2 diff --git a/src/taskbar/taskbar.c b/src/taskbar/taskbar.c index 4538892..60a7406 100644 --- a/src/taskbar/taskbar.c +++ b/src/taskbar/taskbar.c @@ -125,6 +125,7 @@ void init_taskbar_panel(void *p) // task panel->g_task.area.size_mode = SIZE_BY_LAYOUT; panel->g_task.area._draw_foreground = draw_task; + panel->g_task.area._on_change_layout = on_change_task; panel->g_task.area.redraw = 1; panel->g_task.area.on_screen = 1; if ((panel->g_task.config_asb_mask & (1<text_width = pixel_width - panel->g_task.text_posx - panel->g_task.area.bg->border.width - panel->g_task.area.paddingx; + //taskbar->text_width = taskbar->area.width - (2 * panel->g_taskbar.area.paddingy) - panel->g_task.text_posx - panel->g_task.area.bg->border.width - panel->g_task.area.paddingx; + //return ret; + Taskbar *taskbar = (Taskbar*)obj; Panel *panel = (Panel*)taskbar->area.panel; Task *tsk; @@ -272,7 +279,7 @@ int resize_taskbar(void *obj) if (panel_horizontal) { int pixel_width, modulo_width=0; - int taskbar_width; + int taskbar_width, old_width; // new task width for 'desktop' task_count = g_slist_length(taskbar->area.list); @@ -296,18 +303,19 @@ int resize_taskbar(void *obj) for (l = taskbar->area.list; l ; l = l->next) { tsk = l->data; if (!tsk->area.on_screen) continue; - //set_task_redraw(tsk); // always redraw task, because the background could have changed (taskbar_active_id) + old_width = tsk->area.width; tsk->area.width = pixel_width; - if (modulo_width) { tsk->area.width++; modulo_width--; } + if (tsk->area.width != old_width) + tsk->area.on_changed = 1; } } else { int pixel_height, modulo_height=0; - int taskbar_height; + int taskbar_height, old_height; // new task width for 'desktop' task_count = g_slist_length(taskbar->area.list); @@ -331,13 +339,14 @@ int resize_taskbar(void *obj) for (l = taskbar->area.list; l ; l = l->next) { tsk = l->data; if (!tsk->area.on_screen) continue; - //set_task_redraw(tsk); // always redraw task, because the background could have changed (taskbar_active_id) + old_height = tsk->area.height; tsk->area.height = pixel_height; - if (modulo_height) { tsk->area.height++; modulo_height--; } + if (tsk->area.height != old_height) + tsk->area.on_changed = 1; } }