From 04d82b8968b6f5eea263dd6ab8302fff059cad9e Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 22 Feb 2017 09:20:28 -0800 Subject: vwm: use vwm.done to signal quit This moves the console teardown back to vwm.c, trivial cleanup. --- src/vwm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/vwm.c') 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); -- cgit v1.2.3