all repos — tint2 @ ac5aefb52b47e4afd96aafa59c51590ae10d9446

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

New config option: taskbar_always_show_all_desktop_tasks (fixes issue #279)
o9000 mrovi9000@gmail.com
commit

ac5aefb52b47e4afd96aafa59c51590ae10d9446

parent

6ae4c0a9a8add160d7108b41e65e181301897261

M src/config.csrc/config.c

@@ -758,6 +758,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_always_show_all_desktop_tasks") == 0) { + always_show_all_desktop_tasks = atoi(value); } else if (strcmp(key, "taskbar_sort_order") == 0) { if (strcmp(value, "center") == 0) { taskbar_sort_method = TASKBAR_SORT_CENTER;
M src/taskbar/task.csrc/taskbar/task.c

@@ -104,7 +104,7 @@ task_instance->win_h = task_template.win_h;

task_instance->current_state = TASK_UNDEFINED; // to update the current state later in set_task_state... if (task_instance->desktop == ALL_DESKTOPS && server.desktop != j) { // fprintf(stderr, "%s %d: win = %ld hiding task: another desktop\n", __FUNCTION__, __LINE__, win); - task_instance->area.on_screen = FALSE; + task_instance->area.on_screen = always_show_all_desktop_tasks; } task_instance->title = task_template.title; if (panels[monitor].g_task.tooltip_enabled)

@@ -562,7 +562,7 @@ gboolean hide = FALSE;

Taskbar *taskbar = (Taskbar *)task1->area.parent; if (task->desktop == ALL_DESKTOPS && server.desktop != taskbar->desktop) { // Hide ALL_DESKTOPS task on non-current desktop - hide = TRUE; + hide = !always_show_all_desktop_tasks; } if (hide_inactive_tasks) { // Show only the active task
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 always_show_all_desktop_tasks; TaskbarSortMethod taskbar_sort_method; Alignment taskbar_alignment;

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

taskbar_distribute_size = FALSE; hide_inactive_tasks = FALSE; hide_task_diff_monitor = FALSE; + always_show_all_desktop_tasks = FALSE; taskbar_sort_method = TASKBAR_NOSORT; taskbar_alignment = ALIGN_LEFT; default_taskbarname();
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 always_show_all_desktop_tasks; extern TaskbarSortMethod taskbar_sort_method; extern Alignment taskbar_alignment;
M src/tint.csrc/tint.c

@@ -978,7 +978,7 @@ l = l->next;

for (; l; l = l->next) { Task *task = l->data; if (task->desktop == ALL_DESKTOPS) { - task->area.on_screen = FALSE; + task->area.on_screen = always_show_all_desktop_tasks; taskbar->area.resize_needed = 1; panel_refresh = TRUE; if (taskbar_mode == MULTI_DESKTOP)
M src/tint2conf/properties.csrc/tint2conf/properties.c

@@ -55,7 +55,7 @@ GtkWidget *taskbar_name_padding_x, *taskbar_name_padding_y, *taskbar_name_inactive_color, *taskbar_name_active_color;

GtkWidget *taskbar_name_font, *taskbar_name_font_set; GtkWidget *taskbar_active_background, *taskbar_inactive_background; GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background; -GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment; +GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment, *taskbar_always_show_all_desktop_tasks; // task GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;

@@ -2909,6 +2909,23 @@ gtk_table_attach(GTK_TABLE(table), taskbar_hide_diff_monitor, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);

col++; gtk_tooltips_set_tip(tooltips, taskbar_hide_diff_monitor, _("If enabled, tasks that are not on the same monitor as the panel will not be displayed. " "This behavior is enabled automatically if the panel monitor is set to 'All'."), NULL); + + + col = 2; + row++; + label = gtk_label_new(_("Always show all desktop tasks")); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0); + gtk_widget_show(label); + gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); + col++; + + taskbar_always_show_all_desktop_tasks = gtk_check_button_new(); + gtk_widget_show(taskbar_always_show_all_desktop_tasks); + gtk_table_attach(GTK_TABLE(table), taskbar_always_show_all_desktop_tasks, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); + col++; + gtk_tooltips_set_tip(tooltips, taskbar_always_show_all_desktop_tasks, _("Has effect only if 'Show a taskbar for each desktop' is enabled. " + "If enabled, tasks that appear on all desktops are shown on all taskbars. " + "Otherwise, they are shown only on the taskbar of the current desktop."), NULL); row++; col = 2;
M src/tint2conf/properties.hsrc/tint2conf/properties.h

@@ -56,7 +56,7 @@ extern GtkWidget *taskbar_name_padding_x, *taskbar_name_padding_y, *taskbar_name_inactive_color, *taskbar_name_active_color;

extern GtkWidget *taskbar_name_font, *taskbar_name_font_set; extern GtkWidget *taskbar_active_background, *taskbar_inactive_background; extern GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background; -extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment; +extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment, *taskbar_always_show_all_desktop_tasks; // task extern GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;
M src/tint2conf/properties_rw.csrc/tint2conf/properties_rw.c

@@ -284,6 +284,7 @@ fprintf(fp, "taskbar_active_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_active_background)));

fprintf(fp, "taskbar_name = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_show_name)) ? 1 : 0); fprintf(fp, "taskbar_hide_inactive_tasks = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_hide_inactive_tasks)) ? 1 : 0); fprintf(fp, "taskbar_hide_different_monitor = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_hide_diff_monitor)) ? 1 : 0); + fprintf(fp, "taskbar_always_show_all_desktop_tasks = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_always_show_all_desktop_tasks)) ? 1 : 0); fprintf(fp, "taskbar_name_padding = %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(taskbar_name_padding_x)),

@@ -1304,6 +1305,9 @@ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_hide_inactive_tasks), atoi(value));

} else if (strcmp(key, "taskbar_hide_different_monitor") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_hide_diff_monitor), atoi(value)); + } + else if (strcmp(key, "taskbar_always_show_all_desktop_tasks") == 0) { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_always_show_all_desktop_tasks), atoi(value)); } else if (strcmp(key, "taskbar_name_padding") == 0) { extract_values(value, &value1, &value2, &value3);