diff options
author | Quentin Rameau <quinq@fifth.space> | 2019-02-04 00:29:26 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2019-02-04 19:49:34 +0100 |
commit | 153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5 (patch) | |
tree | d54f40d8d846756d33128db749b831afecde1bac /dmenu.c | |
parent | 65be875f5adf31e9c4762ac8a8d74b1dfdd78584 (diff) | |
download | dmenu-153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5.tar.gz dmenu-153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5.tar.bz2 dmenu-153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5.zip |
Close when the embedding window is destroyed
Diffstat (limited to 'dmenu.c')
-rw-r--r-- | dmenu.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -556,6 +556,11 @@ run(void) if (XFilterEvent(&ev, None)) continue; switch(ev.type) { + case DestroyNotify: + if (ev.xdestroywindow.window != win) + break; + cleanup(); + exit(1); case Expose: if (ev.xexpose.count == 0) drw_map(drw, win, 0, 0, mw, mh); @@ -667,7 +672,7 @@ setup(void) XMapRaised(dpy, win); XSetInputFocus(dpy, win, RevertToParent, CurrentTime); if (embed) { - XSelectInput(dpy, parentwin, FocusChangeMask); + XSelectInput(dpy, parentwin, FocusChangeMask | SubstructureNotifyMask); if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) { for (i = 0; i < du && dws[i] != win; ++i) XSelectInput(dpy, dws[i], FocusChangeMask); |