sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit c1e6133d0486c0d7f0c3f88d712e31b753208614
parent 5e9542f85913e40295fb23f61983cc6c5e4ae626
Author: Kim Nielsen <kgn@one.com>
Date:   Mon, 19 Apr 2021 09:07:46 +0200

Use sendevent to kill window

Diffstat:
Mdwm.suckless.org/patches/notallowed/dwm-notallowed-6.2.diff | 20+++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/dwm.suckless.org/patches/notallowed/dwm-notallowed-6.2.diff b/dwm.suckless.org/patches/notallowed/dwm-notallowed-6.2.diff @@ -1,6 +1,6 @@ diff -up dwm-6.2.orig/config.def.h dwm-6.2/config.def.h --- dwm-6.2.orig/config.def.h 2021-04-17 17:58:27.803010601 +0200 -+++ dwm-6.2/config.def.h 2021-04-18 15:17:55.254072814 +0200 ++++ dwm-6.2/config.def.h 2021-04-19 09:04:26.224804870 +0200 @@ -26,9 +26,9 @@ static const Rule rules[] = { * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title @@ -16,7 +16,7 @@ diff -up dwm-6.2.orig/config.def.h dwm-6.2/config.def.h /* layout(s) */ diff -up dwm-6.2.orig/dwm.c dwm-6.2/dwm.c --- dwm-6.2.orig/dwm.c 2021-04-17 17:58:27.803010601 +0200 -+++ dwm-6.2/dwm.c 2021-04-18 15:26:14.659767016 +0200 ++++ dwm-6.2/dwm.c 2021-04-19 09:03:42.571206643 +0200 @@ -92,7 +92,7 @@ struct Client { int basew, baseh, incw, inch, maxw, maxh, minw, minh; int bw, oldbw; @@ -53,13 +53,23 @@ diff -up dwm-6.2.orig/dwm.c dwm-6.2/dwm.c updatetitle(c); if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { -@@ -1037,6 +1043,11 @@ manage(Window w, XWindowAttributes *wa) +@@ -1037,6 +1043,21 @@ manage(Window w, XWindowAttributes *wa) } else { c->mon = selmon; applyrules(c); + if (c->notallowed) { -+ XKillClient(dpy, c->win); -+ free(c); ++ ++ XMapWindow(dpy, c->win); ++ if (!sendevent(c, wmatom[WMDelete])) { ++ XGrabServer(dpy); ++ XSetErrorHandler(xerrordummy); ++ XSetCloseDownMode(dpy, DestroyAll); ++ XKillClient(dpy, c->win); ++ XSync(dpy, False); ++ XSetErrorHandler(xerror); ++ XUngrabServer(dpy); ++ } ++ + return; + } }