From 35b4005b7a97563e75b199192896134316740391 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 4 Feb 2008 14:43:20 +0100 Subject: [PATCH] unban() all clients before execing or quitting awesome --- awesome.c | 11 ++++++++++- xutil.c | 10 +++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) 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)); -- 2.11.4.GIT