summaryrefslogtreecommitdiffhomepage
path: root/dwm.c
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2021-10-25 15:43:14 +0200
committerbakkeby <[email protected]>2021-10-25 15:43:14 +0200
commitec6a64a64fd957ce10b04834f30cf3270c849309 (patch)
treeaeee676694adee4569f65a57a62c18e7323f8f2a /dwm.c
parent297412adf48474877f803d283052c94fbfc793e4 (diff)
downloaddwm-flexipatch-ec6a64a64fd957ce10b04834f30cf3270c849309.tar.gz
dwm-flexipatch-ec6a64a64fd957ce10b04834f30cf3270c849309.zip
onlyquitonempty + cool_autostart: adding proposed compatibility improvements ref. #194
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/dwm.c b/dwm.c
index 8457fce..2bd28e6 100644
--- a/dwm.c
+++ b/dwm.c
@@ -2750,15 +2750,10 @@ quit(const Arg *arg)
XQueryTree(dpy, root, junk, junk, &junk, &n);
- #if COOL_AUTOSTART_PATCH
- if (n - autostart_len <= quit_empty_window_count)
- #else
if (n <= quit_empty_window_count)
- #endif // COOL_AUTOSTART_PATCH
{
#if RESTARTSIG_PATCH
- if (arg->i)
- restart = 1;
+ restart = arg->i;
#endif // RESTARTSIG_PATCH
running = 0;
}
@@ -2766,17 +2761,16 @@ quit(const Arg *arg)
printf("[dwm] not exiting (n=%d)\n", n);
free(junk);
- #else
+ #else // !ONLYQUITONEMPTY_PATCH
#if RESTARTSIG_PATCH
- if (arg->i)
- restart = 1;
+ restart = arg->i;
#endif // RESTARTSIG_PATCH
running = 0;
#endif // ONLYQUITONEMPTY_PATCH
#if COOL_AUTOSTART_PATCH
/* kill child processes */
- for (i = 0; i < autostart_len; i++) {
+ for (i = 0; i < autostart_len && !running; i++) {
if (0 < autostart_pids[i]) {
kill(autostart_pids[i], SIGTERM);
waitpid(autostart_pids[i], NULL, 0);