diff options
| author | bakkeby <[email protected]> | 2019-10-05 22:55:46 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2019-10-05 22:55:46 +0200 |
| commit | b6928ab1fb05c6e19c258ac5e16883b2fa84188a (patch) | |
| tree | 64793e2090d73b50a9df1f18d0d5110812835c84 /patch | |
| parent | a8049d86bb9334d2848a80117679bd0605db6db2 (diff) | |
| download | dwm-flexipatch-b6928ab1fb05c6e19c258ac5e16883b2fa84188a.tar.gz dwm-flexipatch-b6928ab1fb05c6e19c258ac5e16883b2fa84188a.zip | |
Adding killunsel patch
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/include.c | 4 | ||||
| -rw-r--r-- | patch/include.h | 4 | ||||
| -rw-r--r-- | patch/killunsel.c | 22 | ||||
| -rw-r--r-- | patch/killunsel.h | 1 |
4 files changed, 31 insertions, 0 deletions
diff --git a/patch/include.c b/patch/include.c index 714e4b4..204f2d8 100644 --- a/patch/include.c +++ b/patch/include.c @@ -52,6 +52,10 @@ #include "holdbar.c" #endif +#if KILLUNSEL_PATCH +#include "killunsel.c" +#endif + #if MAXIMIZE_PATCH #include "maximize.c" #endif diff --git a/patch/include.h b/patch/include.h index 1cae911..38f5485 100644 --- a/patch/include.h +++ b/patch/include.h @@ -52,6 +52,10 @@ #include "holdbar.h" #endif +#if KILLUNSEL_PATCH +#include "killunsel.h" +#endif + #if MAXIMIZE_PATCH #include "maximize.h" #endif diff --git a/patch/killunsel.c b/patch/killunsel.c new file mode 100644 index 0000000..9e06d53 --- /dev/null +++ b/patch/killunsel.c @@ -0,0 +1,22 @@ +void +killunsel(const Arg *arg) +{ + Client *i = NULL; + + if (!selmon->sel) + return; + + for (i = selmon->clients; i; i = i->next) { + if (ISVISIBLE(i) && i != selmon->sel) { + if (!sendevent(i, wmatom[WMDelete])) { + XGrabServer(dpy); + XSetErrorHandler(xerrordummy); + XSetCloseDownMode(dpy, DestroyAll); + XKillClient(dpy, i->win); + XSync(dpy, False); + XSetErrorHandler(xerror); + XUngrabServer(dpy); + } + } + } +}
\ No newline at end of file diff --git a/patch/killunsel.h b/patch/killunsel.h new file mode 100644 index 0000000..4f38a6e --- /dev/null +++ b/patch/killunsel.h @@ -0,0 +1 @@ +static void killunsel(const Arg *arg);
\ No newline at end of file |
