X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=scrotwm.c;h=67ad17a4f6f3a201fd3209f58f8950c797484661;hb=28609b91d0e28949174112d517ce6ce26f1cd656;hp=a8a4f31f2d6ef25a351cdccd6e0abf78761cd4c7;hpb=af77379009105536a2a314a1ebacd89ddbf4f57c;p=spectrwm.git diff --git a/scrotwm.c b/scrotwm.c index a8a4f31..67ad17a 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -168,6 +168,7 @@ Atom aprot; Atom adelete; Atom takefocus; volatile sig_atomic_t running = 1; +volatile sig_atomic_t restart_wm = 0; int outputs = 0; int last_focus_event = FocusOut; int (*xerrorxlib)(Display *, XErrorEvent *); @@ -608,9 +609,11 @@ sighdlr(int sig) break; } break; + case SIGHUP: + restart_wm = 1; + break; case SIGINT: case SIGTERM: - case SIGHUP: case SIGQUIT: running = 0; break; @@ -4924,6 +4927,8 @@ main(int argc, char *argv[]) if (select(xfd + 1, &rd, NULL, NULL, &tv) == -1) if (errno != EINTR) DNPRINTF(SWM_D_MISC, "select failed"); + if (restart_wm == 1) + restart(NULL, NULL); if (running == 0) goto done; if (bar_alarm) {