diff --git a/src/wmfs.c b/src/wmfs.c index 0d22b18..338dcfe 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -237,18 +237,12 @@ scan(void) void uicb_reload(uicb_t cmd) { + quit(); + XCloseDisplay(dpy); - XSetErrorHandler(errorhandlerdummy); + for(; argv_global[0] && argv_global[0] == ' '; argv_global++); - XftFontClose(dpy, font); - infobar_destroy(); - - init(); - scan(); - - XSetErrorHandler(errorhandler); - mainloop(); - raise(SIGTERM); + execlp(argv_global, argv_global, NULL); return; } @@ -384,6 +378,8 @@ main(int argc, char **argv) int i; struct sigaction sig; + argv_global = _strdup(argv[0]); + while ((i = getopt(argc, argv, "hvic:s:")) != -1) { if(i == 'c' || i == 's') diff --git a/src/wmfs.h b/src/wmfs.h index 383582e..58e2db3 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -318,6 +318,7 @@ char *statustext; XRectangle *sgeo; XRectangle *spgeo; Cursor cursor[CurLast]; +char *argv_global; /* Fonts */ XftFont *font;