mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-07-27 02:01:57 -07:00
patches: Added normal kill.
This commit is contained in:
23
patches/sowm-normal-kill.patch
Normal file
23
patches/sowm-normal-kill.patch
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
Reference in New Issue
Block a user