all repos — tint2 @ 427afc61b5629e0ae9e28d0685c6d61b28ba1904

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Distribute size correctly between taskbars when center alignment is used and there is only one visible taskbar (Fixes issue #691)
o9000 mrovi9000@gmail.com
commit

427afc61b5629e0ae9e28d0685c6d61b28ba1904

parent

ee92fac10efe7c96b812520eb12a87857f662fd4

1 files changed, 6 insertions(+), 0 deletions(-)

jump to
M src/panel.csrc/panel.c

@@ -528,6 +528,8 @@ break;

} } else if (taskbar_alignment == ALIGN_CENTER) { slack /= 2; + Taskbar *left_taskbar = NULL; + Taskbar *right_taskbar = NULL; for (int i = 0; i < panel->num_desktops; i++) { Taskbar *taskbar = &panel->taskbar[i]; if (!taskbar->area.on_screen)

@@ -537,6 +539,7 @@ taskbar->area.width += slack;

else taskbar->area.height += slack; taskbar->area.alignment = ALIGN_RIGHT; + left_taskbar = taskbar; break; } for (int i = panel->num_desktops - 1; i >= 0; i--) {

@@ -548,8 +551,11 @@ taskbar->area.width += slack;

else taskbar->area.height += slack; taskbar->area.alignment = ALIGN_LEFT; + right_taskbar = taskbar; break; } + if (left_taskbar == right_taskbar) + left_taskbar->area.alignment = ALIGN_CENTER; } } else { // No tasks => expand the first visible taskbar