Add option to hide tasks from different monitors when panel_monitor = x (issue 196)
git-svn-id: http://tint2.googlecode.com/svn/trunk@736 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
committed by
mrovi9000@gmail.com
parent
a2de8d6e53
commit
c900bc24b2
@@ -524,7 +524,7 @@ void set_task_state(Task *tsk, int state)
|
||||
if (tsk == 0 || state < 0 || state >= TASK_STATE_COUNT)
|
||||
return;
|
||||
|
||||
if (tsk->current_state != state) {
|
||||
if (tsk->current_state != state || hide_task_diff_monitor) {
|
||||
GPtrArray* task_group = task_get_tasks(tsk->win);
|
||||
if (task_group) {
|
||||
int i;
|
||||
@@ -538,12 +538,17 @@ void set_task_state(Task *tsk, int state)
|
||||
if (state == TASK_ACTIVE && g_slist_find(urgent_list, tsk1))
|
||||
del_urgent(tsk1);
|
||||
// Show only the active task
|
||||
int hide = 0;
|
||||
if (hide_inactive_tasks) {
|
||||
if (state != TASK_ACTIVE) {
|
||||
tsk1->area.on_screen = 0;
|
||||
} else {
|
||||
tsk1->area.on_screen = 1;
|
||||
hide = 1;
|
||||
}
|
||||
}
|
||||
if (window_get_monitor(tsk->win) != ((Panel*)tsk->area.panel)->monitor) {
|
||||
hide = 1;
|
||||
}
|
||||
if (1 - hide != tsk1->area.on_screen) {
|
||||
tsk1->area.on_screen = 1 - hide;
|
||||
set_task_redraw(tsk1);
|
||||
Panel *p = (Panel*)tsk->area.panel;
|
||||
tsk->area.resize = 1;
|
||||
|
||||
@@ -44,6 +44,7 @@ Task *task_drag;
|
||||
int taskbar_enabled;
|
||||
int taskbar_distribute_size;
|
||||
int hide_inactive_tasks;
|
||||
int hide_task_diff_monitor;
|
||||
|
||||
guint win_hash(gconstpointer key) { return (guint)*((Window*)key); }
|
||||
gboolean win_compare(gconstpointer a, gconstpointer b) { return (*((Window*)a) == *((Window*)b)); }
|
||||
@@ -58,6 +59,7 @@ void default_taskbar()
|
||||
taskbar_enabled = 0;
|
||||
taskbar_distribute_size = 0;
|
||||
hide_inactive_tasks = 0;
|
||||
hide_task_diff_monitor = 0;
|
||||
default_taskbarname();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ extern Task *task_drag;
|
||||
extern int taskbar_enabled;
|
||||
extern int taskbar_distribute_size;
|
||||
extern int hide_inactive_tasks;
|
||||
extern int hide_task_diff_monitor;
|
||||
|
||||
typedef struct {
|
||||
// always start with area
|
||||
|
||||
Reference in New Issue
Block a user