Merge pull request #60 from dylanaraps/kill

sowm: normal window close
This commit is contained in:
dylan 2020-04-23 08:21:27 +03:00 committed by GitHub
commit 7e4466e38e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

10
sowm.c
View File

@ -123,7 +123,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) {