all repos — tint2 @ 1ff868fdb78adbe0f49682d7aa35f1b53670cfad

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

Do not use negative values for task state since it is used as array index
o9000 mrovi9000@gmail.com
commit

1ff868fdb78adbe0f49682d7aa35f1b53670cfad

parent

09926623969edc862eeb0a456fac7d62e1528076

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

jump to
M src/taskbar/task.csrc/taskbar/task.c

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

task_instance->win_y = task_template.win_y; task_instance->win_w = task_template.win_w; task_instance->win_h = task_template.win_h; - task_instance->current_state = -1; // to update the current state later in set_task_state... + 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;

@@ -549,7 +549,7 @@ }

void set_task_state(Task *task, TaskState state) { - if (!task || state < 0 || state >= TASK_STATE_COUNT) + if (!task || state == TASK_UNDEFINED || state >= TASK_STATE_COUNT) return; if (state == TASK_ACTIVE && task->current_state != state) {
M src/taskbar/task.hsrc/taskbar/task.h

@@ -18,6 +18,7 @@ TASK_NORMAL = 0,

TASK_ACTIVE, TASK_ICONIFIED, TASK_URGENT, + TASK_UNDEFINED, TASK_STATE_COUNT, } TaskState;