all repos — dmenu @ 153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5

my build of dmenu

Close when the embedding window is destroyed
Quentin Rameau quinq@fifth.space
Mon, 04 Feb 2019 00:29:26 +0100
commit

153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5

parent

65be875f5adf31e9c4762ac8a8d74b1dfdd78584

2 files changed, 7 insertions(+), 2 deletions(-)

jump to
M LICENSELICENSE

@@ -9,7 +9,7 @@ © 2009 Markus Schnalke <meillo@marmaro.de>

© 2009 Evan Gates <evan.gates@gmail.com> © 2010-2012 Connor Lane Smith <cls@lubutu.com> © 2014-2019 Hiltjo Posthuma <hiltjo@codemadness.org> -© 2015-2018 Quentin Rameau <quinq@fifth.space> +© 2015-2019 Quentin Rameau <quinq@fifth.space> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
M dmenu.cdmenu.c

@@ -556,6 +556,11 @@ while (!XNextEvent(dpy, &ev)) {

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 @@

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);