- // change pos_x and width for all tasks
- x = taskbar->area.posx + taskbar->area.pix.border.width + taskbar->area.paddingxlr;
- for (l = taskbar->area.list; l ; l = l->next) {
- tsk = l->data;
- tsk->area.posx = x;
- tsk->area.width = pixel_width;
- tsk->area.redraw = 1;
- if (modulo_width) {
- tsk->area.width++;
- modulo_width--;
- }
-
- x += tsk->area.width + panel->g_taskbar.paddingx;
- }
+ // change pos_x and width for all tasks
+ x = taskbar->area.posx + taskbar->area.pix.border.width + taskbar->area.paddingxlr;
+ for (l = taskbar->area.list; l ; l = l->next) {
+ tsk = l->data;
+ tsk->area.posx = x;
+ tsk->area.width = pixel_width;
+ tsk->area.redraw = 1;
+ if (modulo_width) {
+ tsk->area.width++;
+ modulo_width--;
+ }
+
+ x += tsk->area.width + panel->g_taskbar.paddingx;
+ }
+ }
+ else {
+ int pixel_height, modulo_height=0;
+ int y, taskbar_height;
+
+ // new task width for 'desktop'
+ task_count = g_slist_length(taskbar->area.list);
+ if (!task_count) pixel_height = panel->g_task.maximum_height;
+ else {
+ taskbar_height = taskbar->area.height - (2 * panel->g_taskbar.pix.border.width) - (2 * panel->g_taskbar.paddingxlr);
+ if (task_count>1) taskbar_height -= ((task_count-1) * panel->g_taskbar.paddingx);
+
+ pixel_height = taskbar_height / task_count;
+ if (pixel_height > panel->g_task.maximum_height)
+ pixel_height = panel->g_task.maximum_height;
+ else
+ modulo_height = taskbar_height % task_count;
+ }
+
+ if ((taskbar->task_width == pixel_height) && (taskbar->task_modulo == modulo_height)) {
+ }
+ else {
+ taskbar->task_width = pixel_height;
+ taskbar->task_modulo = modulo_height;
+ taskbar->text_width = taskbar->area.width - (2 * panel->g_taskbar.paddingy) - panel->g_task.text_posx - panel->g_task.area.pix.border.width - panel->g_task.area.paddingx;
+ }
+
+ // change pos_y and height for all tasks
+ y = taskbar->area.posy + taskbar->area.pix.border.width + taskbar->area.paddingxlr;
+ for (l = taskbar->area.list; l ; l = l->next) {
+ tsk = l->data;
+ tsk->area.posy = y;
+ tsk->area.height = pixel_height;
+ tsk->area.redraw = 1;
+ if (modulo_height) {
+ tsk->area.height++;
+ modulo_height--;
+ }
+
+ y += tsk->area.height + panel->g_taskbar.paddingx;
+ }
+ }