all repos — tint2 @ 863ef0259c44a51b13edefe2c15989eb93a355f9

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

Add config option for the hide_if_empty behaviour
Benoit Averty benoit.averty@gmail.com
commit

863ef0259c44a51b13edefe2c15989eb93a355f9

parent

d765190e3d3bd6b13b313c4a2425bd8d4241e8aa

3 files changed, 8 insertions(+), 2 deletions(-)

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

@@ -771,6 +771,8 @@ } else if (strcmp(key, "taskbar_hide_inactive_tasks") == 0) {

hide_inactive_tasks = atoi(value); } else if (strcmp(key, "taskbar_hide_different_monitor") == 0) { hide_task_diff_monitor = atoi(value); + } else if (strcmp(key, "taskbar_hide_if_empty") == 0) { + hide_taskbar_if_empty = atoi(value); } else if (strcmp(key, "taskbar_always_show_all_desktop_tasks") == 0) { always_show_all_desktop_tasks = atoi(value); } else if (strcmp(key, "taskbar_sort_order") == 0) {
M src/taskbar/taskbar.csrc/taskbar/taskbar.c

@@ -41,6 +41,7 @@ gboolean taskbar_enabled;

gboolean taskbar_distribute_size; gboolean hide_inactive_tasks; gboolean hide_task_diff_monitor; +gboolean hide_taskbar_if_empty; gboolean always_show_all_desktop_tasks; TaskbarSortMethod taskbar_sort_method; Alignment taskbar_alignment;

@@ -74,6 +75,7 @@ taskbar_enabled = FALSE;

taskbar_distribute_size = FALSE; hide_inactive_tasks = FALSE; hide_task_diff_monitor = FALSE; + hide_taskbar_if_empty = FALSE; always_show_all_desktop_tasks = FALSE; taskbar_sort_method = TASKBAR_NOSORT; taskbar_alignment = ALIGN_LEFT;

@@ -430,7 +432,7 @@ }

return FALSE; } -gboolean taskbar_is_empty(Taskbar *taskbar) +gboolean taskbar_is_not_empty(Taskbar *taskbar) { GList *l = taskbar->area.children; if (taskbarname_enabled)

@@ -448,7 +450,8 @@ {

if (taskbar->desktop == server.desktop) { // Taskbar for current desktop is always shown show(&taskbar->area); - } else if (taskbar_mode == MULTI_DESKTOP && taskbar_is_empty(taskbar)) { + } + else if (taskbar_mode == MULTI_DESKTOP && (taskbar_is_not_empty(taskbar) || hide_taskbar_if_empty == FALSE)) { // MULTI_DESKTOP : show non-empty taskbars show(&taskbar->area); } else {
M src/taskbar/taskbar.hsrc/taskbar/taskbar.h

@@ -49,6 +49,7 @@ extern gboolean taskbar_enabled;

extern gboolean taskbar_distribute_size; extern gboolean hide_inactive_tasks; extern gboolean hide_task_diff_monitor; +extern gboolean hide_taskbar_if_empty; extern gboolean always_show_all_desktop_tasks; extern TaskbarSortMethod taskbar_sort_method; extern Alignment taskbar_alignment;