diff --git a/awesome.c b/awesome.c index ef9c49c3..6f3519a1 100644 --- a/awesome.c +++ b/awesome.c @@ -219,7 +219,9 @@ main(int argc, char *argv[]) event_handler **handler; struct sockaddr_un *addr; int opt; - static struct option long_options[] = { + Client *c; + static struct option long_options[] = + { {"help", 0, NULL, 'h'}, {"version", 0, NULL, 'v'}, {NULL, 0, NULL, 0} @@ -428,12 +430,19 @@ main(int argc, char *argv[]) } } + if(csfd > 0 && close(csfd)) perror("error closing UNIX domain socket"); if(unlink(addr->sun_path)) perror("error unlinking UNIX domain socket"); p_delete(&addr); + /* remap all clients since some WM won't handle them otherwise */ + for(c = globalconf.clients; c; c = c->next) + client_unban(c); + + XSync(globalconf.display, False); + XCloseDisplay(dpy); return EXIT_SUCCESS; diff --git a/xutil.c b/xutil.c index df74f12c..11319cb5 100644 --- a/xutil.c +++ b/xutil.c @@ -24,8 +24,8 @@ #include #include -#include "structs.h" #include "xutil.h" +#include "client.h" extern AwesomeConf globalconf; @@ -37,7 +37,15 @@ extern AwesomeConf globalconf; void uicb_exec(int screen __attribute__ ((unused)), char *arg) { + Client *c; char path[PATH_MAX]; + + /* remap all clients since some WM won't handle them otherwise */ + for(c = globalconf.clients; c; c = c->next) + client_unban(c); + + XSync(globalconf.display, False); + if(globalconf.display) close(ConnectionNumber(globalconf.display));