Compare commits

..

No commits in common. "main" and "master" have entirely different histories.
main ... master

2 changed files with 17 additions and 18 deletions

View file

@ -165,7 +165,7 @@ void handle_event_property_notify(XEvent *e)
l = l->next;
for (; l; l = l->next) {
Task *task = l->data;
if (task->current_state == TASK_ICONIFIED) {
if (task->desktop == ALL_DESKTOPS) {
task->area.on_screen = TRUE;
taskbar->area.resize_needed = 1;
if (taskbar_mode == MULTI_DESKTOP)

View file

@ -124,6 +124,8 @@ Task *add_task(Window win)
GPtrArray *task_buttons = g_ptr_array_new();
for (int j = 0; j < panels[monitor].num_desktops; j++) {
if (task_template.desktop != ALL_DESKTOPS && task_template.desktop != j)
continue;
Taskbar *taskbar = &panels[monitor].taskbar[j];
Task *task_instance = calloc(1, sizeof(Task));
@ -141,6 +143,9 @@ Task *add_task(Window win)
task_instance->win_w = task_template.win_w;
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) {
task_instance->area.on_screen = always_show_all_desktop_tasks;
}
task_instance->title = task_template.title;
task_instance->application = task_template.application;
if (panels[monitor].g_task.tooltip_enabled) {
@ -738,22 +743,18 @@ void set_task_state(Task *task, TaskState state)
schedule_redraw(&task1->area);
if (state == TASK_ACTIVE && g_slist_find(urgent_list, task1))
del_urgent(task1);
gboolean hide = TRUE;
/* don't need this logic */
/* Taskbar *taskbar = (Taskbar *)task1->area.parent;
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 = !always_show_all_desktop_tasks;
}*/
/*if (hide_inactive_tasks) {
// Show only the active task*/
if (state == TASK_ICONIFIED) {
hide = FALSE;
}
if (hide_inactive_tasks) {
// Show only the active task
if (state != TASK_ACTIVE) {
hide = TRUE;
}
/*nor this logic*/
/*}
}
if (hide_task_diff_desktop) {
if (taskbar->desktop != server.desktop)
hide = TRUE;
@ -761,9 +762,9 @@ void set_task_state(Task *task, TaskState state)
if (get_window_monitor(task->win) != ((Panel *)task->area.panel)->monitor &&
(hide_task_diff_monitor || num_panels > 1)) {
hide = TRUE;
}*/
}
if ((!hide) != task1->area.on_screen) {
task1->area.on_screen = task1->current_state == TASK_ICONIFIED;
task1->area.on_screen = !hide;
schedule_redraw(&task1->area);
Panel *p = (Panel *)task->area.panel;
task->area.resize_needed = TRUE;
@ -843,10 +844,8 @@ void task_handle_mouse_event(Task *task, MouseAction action)
case TOGGLE_ICONIFY:
if (active_task && task->win == active_task->win)
XIconifyWindow(server.display, task->win, server.screen);
else {
change_window_desktop(task->win, server.desktop);
else
activate_window(task->win);
}
break;
case SHADE:
toggle_window_shade(task->win);