X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Ftint.c;h=3eebf88dfe2cb5bf3f670b8949abfcd7dc8479ea;hb=5b867835741534d8d28e8d158b8f7de53e55018a;hp=260d93cdecdb610c9e448ca0b8c7570b2d47d285;hpb=95c0cc701139465fa06efd64d9ca55607024acce;p=chaz%2Ftint2 diff --git a/src/tint.c b/src/tint.c index 260d93c..3eebf88 100644 --- a/src/tint.c +++ b/src/tint.c @@ -115,6 +115,10 @@ void init (int argc, char *argv[]) default_icon = imlib_load_image(path); g_free(path); } + + // get monitor and desktop config + get_monitors(); + get_desktops(); } @@ -636,33 +640,8 @@ void event_configure_notify (Window win) { // change in root window (xrandr) if (win == server.root_win) { - int i, old_nb_panel = nb_panel; - get_monitors(); - if (panel_config.monitor >= 0) - nb_panel = 1; - else - nb_panel = server.nb_monitor; - - if (old_nb_panel != nb_panel) { - // changed number of panel - printf("changed number of panel\n"); - //realloc(panel1, nb_panel * sizeof(Panel)); - } - for (i=0 ; i < nb_panel && i < old_nb_panel ; i++) { - Panel *panel = &panel1[i]; - - init_panel_size_and_position(panel); - XMoveResizeWindow(server.dsp, panel->main_win, panel->posx, panel->posy, panel->area.width, panel->area.height); - set_panel_background(panel); - - // force the resize of childs - GSList *l0; - panel->area.resize = 1; - for (l0 = panel->area.list; l0 ; l0 = l0->next) - ((Area*)l0->data)->resize = 1; - } - panel_refresh = 1; + init_panel(); return; } @@ -884,9 +863,13 @@ int main (int argc, char *argv[]) event_timer(); switch (signal_pending) { - case SIGUSR1: + case SIGUSR1: // reload config file signal_pending = 0; - return 0; + init_config(); + config_read_file (config_path); + init_panel(); + cleanup_config(); + break; case SIGINT: case SIGTERM: case SIGHUP: