less disturbing omnipresent task by dmitry medvinsky

git-svn-id: http://tint2.googlecode.com/svn/trunk@192 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
lorthiois@bbsoft.fr 2009-09-20 19:57:16 +00:00
parent d222fdabae
commit a4ccce2cd3
3 changed files with 58 additions and 35 deletions

View file

@ -61,10 +61,16 @@ Task *add_task (Window win)
Taskbar *tskbar;
Task *new_tsk2=0;
int i, j;
for (i=0 ; i < nb_panel ; i++) {
for (j=0 ; j < panel1[i].nb_desktop ; j++) {
if (new_tsk.desktop != ALLDESKTOP && new_tsk.desktop != j) continue;
if (nb_panel > 1 && panel1[i].monitor != monitor) continue;
for (i = 0; i < nb_panel; i++) {
if (nb_panel > 1 && panel1[i].monitor != monitor) continue;
for (j = 0; j < panel1[i].nb_desktop; j++) {
if ((new_tsk.desktop != ALLDESKTOP && new_tsk.desktop != j)
|| (panel_mode == MULTI_DESKTOP && new_tsk.desktop == ALLDESKTOP && server.desktop != j))
continue;
// for (i=0 ; i < nb_panel ; i++) {
// for (j=0 ; j < panel1[i].nb_desktop ; j++) {
// if (new_tsk.desktop != ALLDESKTOP && new_tsk.desktop != j) continue;
// if (nb_panel > 1 && panel1[i].monitor != monitor) continue;
tskbar = &panel1[i].taskbar[j];
new_tsk2 = malloc(sizeof(Task));

View file

@ -394,35 +394,52 @@ void event_property_notify (XEvent *e)
// Change desktop
else if (at == server.atom._NET_CURRENT_DESKTOP) {
server.desktop = server_get_current_desktop ();
for (i=0 ; i < nb_panel ; i++) {
for (i = 0; i < nb_panel; i++) {
Panel *panel = &panel1[i];
if (panel_mode == MULTI_DESKTOP && panel->g_taskbar.use_active) {
// redraw taskbar
panel_refresh = 1;
Taskbar *tskbar;
if (panel_mode == MULTI_DESKTOP) {
Taskbar *tskbar, *tskbar_active;
GSList *l;
Task *tsk;
GSList *l;
for (j=0 ; j < panel->nb_desktop ; j++) {
tskbar = &panel->taskbar[j];
if (tskbar->area.is_active) {
tskbar->area.is_active = 0;
tskbar->area.redraw = 1;
for (l = tskbar->area.list; l ; l = l->next) {
tsk = l->data;
tsk->area.redraw = 1;
}
}
if (j == server.desktop) {
tskbar->area.is_active = 1;
tskbar->area.redraw = 1;
for (l = tskbar->area.list; l ; l = l->next) {
tsk = l->data;
tsk->area.redraw = 1;
}
}
char redraw_tasks;
tskbar_active = &panel->taskbar[server.desktop];
if (panel->g_taskbar.use_active) {
tskbar_active->area.is_active = 1;
tskbar_active->area.redraw = 1;
}
}
}
for (j = 0; j < panel->nb_desktop; j++) {
tskbar = &panel->taskbar[j];
// need to redraw tasks only on taskbar, which was active, or which became active
redraw_tasks = 0;
if (panel->g_taskbar.use_active && tskbar->area.is_active && tskbar != tskbar_active) {
tskbar->area.is_active = 0;
tskbar->area.redraw = 1;
redraw_tasks = 1;
} else if (panel->g_taskbar.use_active && tskbar == tskbar_active) {
redraw_tasks = 1;
}
for (l = tskbar->area.list; l;) {
tsk = l->data;
l = l->next;
if (redraw_tasks) tsk->area.redraw = 1;
if (tsk->desktop == ALLDESKTOP && tskbar != tskbar_active) {
// move omnipresent tasks to current taskbar
tskbar->area.list = g_slist_remove(tskbar->area.list, tsk);
tskbar->area.resize = 1;
tsk->area.parent = tskbar_active;
tskbar_active->area.list = g_slist_append(tskbar_active->area.list, tsk);
tskbar_active->area.resize = 1;
}
}
}
panel_refresh = 1;
}
}
if (panel_mode != MULTI_DESKTOP) {
visible_object();
}

View file

@ -75,7 +75,7 @@ static const char *fallback_ui_file =
" <menuitem action='ThemeAdd'/>"
" <menuitem action='ThemeSaveAs'/>"
" <separator/>"
// " <menuitem action='ThemeProperties'/>"
" <menuitem action='ThemeProperties'/>"
" <menuitem action='ThemeRename'/>"
" <separator/>"
" <menuitem action='ThemeDelete'/>"
@ -91,9 +91,9 @@ static const char *fallback_ui_file =
" </menu>"
" </menubar>"
" <toolbar name='ToolBar'>"
// " <toolitem action='ViewRefreshAll'/>"
// " <separator/>"
// " <toolitem action='ThemeProperties'/>"
" <toolitem action='ViewRefreshAll'/>"
" <separator/>"
" <toolitem action='ThemeProperties'/>"
" <toolitem action='ViewApply'/>"
" </toolbar>"
"</ui>";
@ -233,7 +233,7 @@ static void menuAdd (GtkWindow *parent)
if (gtk_dialog_run (GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
GSList *l, *list = gtk_file_chooser_get_filenames(chooser);
// remember this folder the next time we use this dialog
// TODO: remember this folder the next time we use this dialog
//char *folder = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(dialog));
//pref_string_set( PREF_KEY_OPEN_DIALOG_FOLDER, folder );
//g_free( folder );