- switch (signal_pending) {
- case SIGUSR1: // reload config file
- signal_pending = 0;
- init_config();
- config_read_file (config_path);
- init_panel();
- cleanup_config();
- break;
- case SIGINT:
- case SIGTERM:
- case SIGHUP:
- cleanup ();
- return 0;
+ if (signal_pending) {
+ cleanup();
+ if (signal_pending == SIGUSR1) {
+ // restart tint2
+ // SIGUSR1 used when : user's signal, composite manager stop/start or xrandr
+ FD_CLR (x11_fd, &fdset);
+ goto start;
+ }
+ else {
+ // SIGINT, SIGTERM, SIGHUP
+ return 0;
+ }