This repository has been archived on 2021-03-07. You can view files and clone it, but cannot push or open issues or pull requests.
sowm/patches/sowm-normal-kill.patch

24 lines
605 B
Diff

diff --git a/sowm.c b/sowm.c
index d1b4c2a..49d8af2 100644
--- a/sowm.c
+++ b/sowm.c
@@ -165,7 +165,17 @@ void win_del(Window w) {
}
void win_kill() {
- if (cur) XKillClient(d, cur->w);
+ if (!cur) return;
+
+ XEvent ev = { .type = ClientMessage };
+
+ ev.xclient.window = cur->w;
+ 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->w, False, NoEventMask, &ev);
}
void win_center() {