sowm: simpler kill

This commit is contained in:
Dylan Araps 2020-02-20 18:02:11 +02:00
parent e491a637fe
commit 3ed647f467
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 9 additions and 1 deletions

10
sowm.c
View File

@ -122,7 +122,15 @@ void win_del(Window w) {
}
void win_kill(const Arg arg) {
if (cur) XKillClient(d, cur->w);
if (!cur) return;
XSendEvent(d, cur->w, False, NoEventMask, &(XEvent){
.type = ClientMessage,
.xclient.window = cur->w,
.xclient.message_type = XInternAtom(d, "WM_PROTOCOLS", True),
.xclient.data.l[0] = XInternAtom(d, "WM_DELETE_WINDOW", True),
.xclient.data.l[1] = CurrentTime
});
}
void win_center(const Arg arg) {