From: Marco Peereboom Date: Sat, 3 Jul 2010 22:41:34 +0000 (+0000) Subject: Make HUP actually restart the wm. Comes in handy when you hang it; X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=6c4ac3470b94e75d3f3af31b31cf6656fee16493;p=spectrwm.git Make HUP actually restart the wm. Comes in handy when you hang it; what's bad is that I know how to do it... --- 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) {