mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-05-19 01:20:23 -07:00
24 lines
605 B
Diff
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() {
|