hack some stuff to get only minimized windows, across all desktops

This commit is contained in:
Iris Lightshard 2023-03-07 23:05:46 -07:00
parent f3aa2ef0c6
commit 496f26afd9
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
2 changed files with 18 additions and 17 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->desktop == ALL_DESKTOPS) {
if (task->current_state == TASK_ICONIFIED) {
task->area.on_screen = TRUE;
taskbar->area.resize_needed = 1;
if (taskbar_mode == MULTI_DESKTOP)

View file

@ -124,8 +124,6 @@ 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));
@ -143,9 +141,6 @@ 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) {
@ -743,18 +738,22 @@ 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 = FALSE;
Taskbar *taskbar = (Taskbar *)task1->area.parent;
gboolean hide = TRUE;
/* don't need this logic */
/* 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_ACTIVE) {
hide = TRUE;
}*/
/*if (hide_inactive_tasks) {
// Show only the active task*/
if (state == TASK_ICONIFIED) {
hide = FALSE;
}
}
/*nor this logic*/
/*}
if (hide_task_diff_desktop) {
if (taskbar->desktop != server.desktop)
hide = TRUE;
@ -762,9 +761,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 = !hide;
task1->area.on_screen = task1->current_state == TASK_ICONIFIED;
schedule_redraw(&task1->area);
Panel *p = (Panel *)task->area.panel;
task->area.resize_needed = TRUE;
@ -844,8 +843,10 @@ 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
else {
change_window_desktop(task->win, server.desktop);
activate_window(task->win);
}
break;
case SHADE:
toggle_window_shade(task->win);