New config option: taskbar sort by LRU/MRU (no config GUI yet) (issue #532)

This commit is contained in:
o9000
2015-12-05 11:07:23 +01:00
parent 3f84d5d14c
commit ea82926b3f
6 changed files with 26 additions and 0 deletions

View File

@@ -552,6 +552,20 @@ void set_task_state(Task *task, TaskState state)
if (!task || state < 0 || state >= TASK_STATE_COUNT)
return;
if (state == TASK_ACTIVE && task->current_state != state) {
clock_gettime(CLOCK_MONOTONIC, &task->last_activation_time);
if (taskbar_sort_method == TASKBAR_SORT_LRU || taskbar_sort_method == TASKBAR_SORT_MRU) {
GPtrArray *task_group = task_get_tasks(task->win);
if (task_group) {
for (int i = 0; i < task_group->len; ++i) {
Task *task1 = g_ptr_array_index(task_group, i);
Taskbar *taskbar = (Taskbar *)task1->area.parent;
sort_tasks(taskbar);
}
}
}
}
if (task->current_state != state || hide_task_diff_monitor) {
GPtrArray *task_group = task_get_tasks(task->win);
if (task_group) {