all repos — tint2 @ 1f42a6b80d209b6ac408a4033e08b8a54251a51b

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

killall -SIGUSR1 tint2 will reload config file. need more fixed.

git-svn-id: http://tint2.googlecode.com/svn/trunk@225 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
lorthiois@bbsoft.fr lorthiois@bbsoft.fr@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
commit

1f42a6b80d209b6ac408a4033e08b8a54251a51b

parent

b6ca6149e54ece36c7d7561ec0db6178863b5895

4 files changed, 20 insertions(+), 18 deletions(-)

jump to
M src/clock/clock.csrc/clock/clock.c

@@ -70,7 +70,7 @@ void init_clock_panel(void *p)

{ Panel *panel =(Panel*)p; Clock *clock = &panel->clock; - int i, time_height, time_height_ink, date_height, date_height_ink; + int time_height, time_height_ink, date_height, date_height_ink; clock->area.parent = p; clock->area.panel = p;
M src/panel.csrc/panel.c

@@ -80,30 +80,32 @@ panel1[i].temp_pmap = 0;

} } - // alloc panels (one monitor or all monitors) + // number of panels old_nb_panel = nb_panel; if (panel_config.monitor >= 0) nb_panel = 1; else nb_panel = server.nb_monitor; - if (nb_panel < old_nb_panel) { - // freed old panels - for (i=nb_panel ; i < old_nb_panel ; i++) { - if (panel1[i].main_win) - XDestroyWindow(server.dsp, panel1[i].main_win); + // freed old panels + for (i=nb_panel ; i < old_nb_panel ; i++) { + if (panel1[i].main_win) { + XDestroyWindow(server.dsp, panel1[i].main_win); + panel1[i].main_win = 0; } - new_panel = realloc(panel1, nb_panel * sizeof(Panel)); } - else if (nb_panel > old_nb_panel) { + + // alloc & init new panel + Window old_win; + if (nb_panel != old_nb_panel) new_panel = realloc(panel1, nb_panel * sizeof(Panel)); - // init new panel - for (i=old_nb_panel ; i < nb_panel ; i++) { - memcpy(&new_panel[i], &panel_config, sizeof(Panel)); - } - } else new_panel = panel1; + for (i=0 ; i < nb_panel ; i++) { + old_win = new_panel[i].main_win; + memcpy(&new_panel[i], &panel_config, sizeof(Panel)); + new_panel[i].main_win = old_win; + } fprintf(stderr, "tint2 : nb monitor %d, nb desktop %d\n", nb_panel, server.nb_desktop); for (i=0 ; i < nb_panel ; i++) {

@@ -145,7 +147,7 @@ }

if (i >= old_nb_panel) { // new panel - printf("new panel %d : %d, %d, %d, %d\n", i, p->posx, p->posy, p->area.width, p->area.height); + //printf("new panel %d : %d, %d, %d, %d\n", i, p->posx, p->posy, p->area.width, p->area.height); // Catch some events long event_mask = ExposureMask|ButtonPressMask|ButtonReleaseMask;

@@ -161,7 +163,7 @@ XMapWindow (server.dsp, p->main_win);

} else { // old panel - printf("old panel %d : %d, %d, %d, %d\n", i, p->posx, p->posy, p->area.width, p->area.height); + //printf("old panel %d : %d, %d, %d, %d\n", i, p->posx, p->posy, p->area.width, p->area.height); XMoveResizeWindow(server.dsp, p->main_win, p->posx, p->posy, p->area.width, p->area.height); set_panel_background(p); }
M src/panel.hsrc/panel.h

@@ -106,7 +106,7 @@ extern Panel *panel1;

extern int nb_panel; // realloc panels according to number of monitor -// it's used on initial config and when new monitor added +// use panel_config as default value void init_panel(); void init_panel_size_and_position(Panel *panel);
M src/tint.csrc/tint.c

@@ -861,7 +861,7 @@

switch (signal_pending) { case SIGUSR1: signal_pending = 0; - printf("SIGUSR1\n"); + init_config(); config_read_file (config_path); init_panel(); break;