[wiki] [sites] Use sendevent to kill window || Kim Nielsen

From: <git_AT_suckless.org>
Date: Mon, 19 Apr 2021 09:08:22 +0200

commit c1e6133d0486c0d7f0c3f88d712e31b753208614
Author: Kim Nielsen <kgn_AT_one.com>
Date: Mon Apr 19 09:07:46 2021 +0200

    Use sendevent to kill window

diff --git a/dwm.suckless.org/patches/notallowed/dwm-notallowed-6.2.diff b/dwm.suckless.org/patches/notallowed/dwm-notallowed-6.2.diff
index 2e1363b8..2ab6aed5 100644
--- a/dwm.suckless.org/patches/notallowed/dwm-notallowed-6.2.diff
+++ b/dwm.suckless.org/patches/notallowed/dwm-notallowed-6.2.diff
_AT_@ -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
 _AT_@ -26,9 +26,9 @@ static const Rule rules[] = {
           * WM_CLASS(STRING) = instance, class
           * WM_NAME(STRING) = title
_AT_@ -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
 _AT_@ -92,7 +92,7 @@ struct Client {
          int basew, baseh, incw, inch, maxw, maxh, minw, minh;
          int bw, oldbw;
_AT_@ -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))) {
-_AT_@ -1037,6 +1043,11 @@ manage(Window w, XWindowAttributes *wa)
+_AT_@ -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;
 + }
          }
Received on Mon Apr 19 2021 - 09:08:22 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 19 2021 - 09:12:56 CEST