pinentry-dmenu

a pinentry program based on dmenu
git clone anongit@rnpnr.xyz:pinentry-dmenu.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 1daeffd2f5964058f22c3d08f0e2dcad1568e87a
Parent: 41dfe60518ae2edd64506f0ec8541c431252c76b
Author: Quentin Rameau
Date:   Mon,  4 Feb 2019 00:29:26 +0100

Close when the embedding window is destroyed

Diffstat:
Mpinentry-dmenu.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pinentry-dmenu.c b/pinentry-dmenu.c @@ -362,7 +362,7 @@ setup(void) XSetInputFocus(dpy, win, RevertToParent, CurrentTime); if (embedded) { - 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) { @@ -580,6 +580,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);