all repos — tint2 @ 527c91f005ffcd375fe8c15ec2e07c6335b93e86

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

*fix* segfault fixed when removing last desktop and we've been on last desktop


git-svn-id: http://tint2.googlecode.com/svn/trunk@303 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
Andreas.Fink85 Andreas.Fink85@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
commit

527c91f005ffcd375fe8c15ec2e07c6335b93e86

parent

c93bf5e1f3780ca4768e8eb27bde6c23e878be0e

2 files changed, 16 insertions(+), 9 deletions(-)

jump to
M src/taskbar/task.csrc/taskbar/task.c

@@ -75,6 +75,7 @@

Taskbar *tskbar; Task *new_tsk2=0; int i, j; + // QUESTION: Do we need to iterate over nb_panel (we know the monitor, why not taking panel1[monitor]??? 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;
M src/tint.csrc/tint.c

@@ -411,8 +411,11 @@ for (i=0 ; i < nb_panel ; i++) {

Panel *panel = &panel1[i]; if (panel_mode == MULTI_DESKTOP && panel->g_taskbar.use_active) { // redraw both taskbar - panel->taskbar[old_desktop].area.is_active = 0; - panel->taskbar[old_desktop].area.resize = 1; + if (server.nb_desktop > old_desktop) { + // can happen if last desktop is deleted and we've been on the last desktop + panel->taskbar[old_desktop].area.is_active = 0; + panel->taskbar[old_desktop].area.resize = 1; + } panel->taskbar[server.desktop].area.is_active = 1; panel->taskbar[server.desktop].area.resize = 1; panel_refresh = 1;

@@ -421,13 +424,15 @@ // check ALLDESKTOP task => resize taskbar

Taskbar *tskbar; Task *tsk; GSList *l; - tskbar = &panel->taskbar[old_desktop]; - for (l = tskbar->area.list; l ; l = l->next) { - tsk = l->data; - if (tsk->desktop == ALLDESKTOP) { - tsk->area.on_screen = 0; - tskbar->area.resize = 1; - panel_refresh = 1; + if (server.nb_desktop > old_desktop) { + tskbar = &panel->taskbar[old_desktop]; + for (l = tskbar->area.list; l ; l = l->next) { + tsk = l->data; + if (tsk->desktop == ALLDESKTOP) { + tsk->area.on_screen = 0; + tskbar->area.resize = 1; + panel_refresh = 1; + } } } tskbar = &panel->taskbar[server.desktop];

@@ -710,6 +715,7 @@ while (1) {

if (panel_refresh) { panel_refresh = 0; + // QUESTION: do we need this first refresh_systray, because we check refresh_systray once again later... if (refresh_systray) { panel = (Panel*)systray.area.panel; XSetWindowBackgroundPixmap (server.dsp, panel->main_win, None);