From cd37b0ad39245eab38665534f703132c65b015f9 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 15 Oct 2019 20:01:41 +0300 Subject: [PATCH] patches: Added normal kill. --- patches/sowm-normal-kill.patch | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 patches/sowm-normal-kill.patch diff --git a/patches/sowm-normal-kill.patch b/patches/sowm-normal-kill.patch new file mode 100644 index 0000000..53b3769 --- /dev/null +++ b/patches/sowm-normal-kill.patch @@ -0,0 +1,23 @@ +diff --git a/sowm.c b/sowm.c +index 0d74d4b..ff70968 100644 +--- a/sowm.c ++++ b/sowm.c +@@ -326,7 +326,17 @@ void win_del(Window w) { + "Shoot first and don't ask questions later?.." + */ + void win_kill() { +- if (win_current() != root) XKillClient(d, cur); ++ if (win_current() == root) return; ++ ++ XEvent ev = { .type = ClientMessage }; ++ ++ ev.xclient.window = cur; ++ ev.xclient.format = 32; ++ ev.xclient.message_type = XInternAtom(d, "WM_PROTOCOLS", True); ++ ev.xclient.data.l[0] = XInternAtom(d, "WM_DELETE_WINDOW", True); ++ ev.xclient.data.l[1] = CurrentTime; ++ ++ XSendEvent(d, cur, False, NoEventMask, &ev); + } + + /*