This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
bc9a9b1
commit e496541
Showing
1 changed file
with
7 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,23 @@ | ||
diff --git a/patches/sowm-normal-kill.patch b/patches/sowm-normal-kill.patch | ||
index 4b11cd4..e69de29 100644 | ||
--- a/patches/sowm-normal-kill.patch | ||
+++ b/patches/sowm-normal-kill.patch | ||
@@ -1,23 +0,0 @@ | ||
-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); | ||
- } | ||
- | ||
- /* | ||
diff --git a/sowm.c b/sowm.c | ||
index 126aca0..cd8af6f 100644 | ||
index d1b4c2a..49d8af2 100644 | ||
--- a/sowm.c | ||
+++ b/sowm.c | ||
@@ -180,7 +180,17 @@ void win_del(Window w) { | ||
@@ -165,7 +165,17 @@ void win_del(Window w) { | ||
} | ||
|
||
void win_kill() { | ||
- if (win_current() ^ root) XKillClient(d, cur); | ||
+ if (win_current() == root) return; | ||
- if (cur) XKillClient(d, cur->w); | ||
+ if (!cur) return; | ||
+ | ||
+ XEvent ev = { .type = ClientMessage }; | ||
+ | ||
+ ev.xclient.window = cur; | ||
+ 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, False, NoEventMask, &ev); | ||
+ XSendEvent(d, cur->w, False, NoEventMask, &ev); | ||
} | ||
|
||
void win_center(const Arg arg) { | ||
void win_center() { |