summaryrefslogtreecommitdiff
path: root/src/vwm.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-02-22 09:20:28 -0800
committerVito Caputo <vcaputo@gnugeneration.com>2017-02-22 09:20:28 -0800
commit04d82b8968b6f5eea263dd6ab8302fff059cad9e (patch)
treef75524ee9fedb77aa8381288b65f3dcc716f5903 /src/vwm.c
parent5b50e2a3affddb5693b91846b6c621590b8d21b2 (diff)
vwm: use vwm.done to signal quit
This moves the console teardown back to vwm.c, trivial cleanup.
Diffstat (limited to 'src/vwm.c')
-rw-r--r--src/vwm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vwm.c b/src/vwm.c
index c2e5126..d0dc47e 100644
--- a/src/vwm.c
+++ b/src/vwm.c
@@ -69,11 +69,11 @@ static int errhandler(Display *display, XErrorEvent *err)
int main(int argc, char *argv[])
{
int err = 0;
- int done = 0;
XEvent event;
Cursor pointer;
struct pollfd pfd;
char *console_args[] = {"xterm", "-class", CONSOLE_WM_CLASS, "-e", "/bin/sh", "-c", "screen -D -RR " CONSOLE_SESSION_STRING, NULL};
+ char *quit_console_args[] = {"/bin/sh", "-c", "screen -dr " CONSOLE_SESSION_STRING " -X quit", NULL};
#define reterr_if(_cond, _fmt, _args...) \
err++;\
@@ -168,7 +168,7 @@ int main(int argc, char *argv[])
pfd.revents = 0;
pfd.fd = ConnectionNumber(vwm.display);
- while (!done) {
+ while (!vwm.done) {
do {
int delay;
@@ -283,6 +283,9 @@ int main(int argc, char *argv[])
vwm_composite_paint_all(&vwm);
}
+ /* tear down console */
+ vwm_launch(&vwm, quit_console_args, VWM_LAUNCH_MODE_FG);
+
/* close connection to server */
XFlush(vwm.display);
XCloseDisplay(vwm.display);
© All Rights Reserved