From c59f2399991499f9650c56676f06640993f826b2 Mon Sep 17 00:00:00 2001 From: o9000 Date: Wed, 21 Jan 2015 01:45:09 +0000 Subject: [PATCH] taskbar: fix task cycling bug in multi_desktop mode git-svn-id: http://tint2.googlecode.com/svn/trunk@662 121b4492-b84c-0410-8b4c-0d4edfb3f3cc --- src/taskbar/task.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/taskbar/task.c b/src/taskbar/task.c index 49f2a4c..57d36c4 100644 --- a/src/taskbar/task.c +++ b/src/taskbar/task.c @@ -416,32 +416,26 @@ void on_change_task (void *obj) // Given a pointer to the active task (active_task) and a pointer // to the task that is currently under the mouse (current_task), -// return a pointer to the active task that is on the same desktop -// as current_task. Normally this is simply active_task, except when -// it is set to appear on all desktops. In that case we search for -// another Task on current_task's taskbar, with the same window as -// active_task. +// returns a pointer to the active task. Task *find_active_task(Task *current_task, Task *active_task) { - if (active_task == 0) + if (active_task == NULL) return current_task; - if (active_task->desktop != ALLDESKTOP) - return active_task; - if (current_task == 0) - return active_task; GSList *l0; Task *tsk; Taskbar* tskbar = current_task->area.parent; l0 = tskbar->area.list; - if (taskbarname_enabled) l0 = l0->next; + if (taskbarname_enabled) + l0 = l0->next; for (; l0 ; l0 = l0->next) { tsk = l0->data; if (tsk->win == active_task->win) return tsk; } - return active_task; + + return current_task; } Task *next_task(Task *tsk)