Option taskbar_hide_inactive_tasks (issue 458)

git-svn-id: http://tint2.googlecode.com/svn/trunk@732 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
o9000
2015-03-20 21:19:02 +00:00
committed by mrovi9000@gmail.com
parent c583ea42eb
commit f5a18cc4f4
7 changed files with 35 additions and 1 deletions

View File

@@ -541,6 +541,19 @@ void set_task_state(Task *tsk, int state)
tsk1->area.redraw = 1;
if (state == TASK_ACTIVE && g_slist_find(urgent_list, tsk1))
del_urgent(tsk1);
// Show only the active task
if (hide_inactive_tasks) {
if (state != TASK_ACTIVE) {
tsk1->area.on_screen = 0;
} else {
tsk1->area.on_screen = 1;
}
set_task_redraw(tsk1);
Panel *p = (Panel*)tsk->area.panel;
tsk->area.resize = 1;
p->taskbar->area.resize = 1;
p->area.resize = 1;
}
}
panel_refresh = 1;
}

View File

@@ -43,6 +43,7 @@ Task *task_active;
Task *task_drag;
int taskbar_enabled;
int taskbar_distribute_size;
int hide_inactive_tasks;
guint win_hash(gconstpointer key) { return (guint)*((Window*)key); }
gboolean win_compare(gconstpointer a, gconstpointer b) { return (*((Window*)a) == *((Window*)b)); }
@@ -56,6 +57,7 @@ void default_taskbar()
urgent_list = 0;
taskbar_enabled = 0;
taskbar_distribute_size = 0;
hide_inactive_tasks = 0;
default_taskbarname();
}

View File

@@ -17,6 +17,7 @@ extern Task *task_active;
extern Task *task_drag;
extern int taskbar_enabled;
extern int taskbar_distribute_size;
extern int hide_inactive_tasks;
typedef struct {
// always start with area