commit 153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5 from: Quentin Rameau via: Hiltjo Posthuma date: Mon Feb 4 18:49:34 2019 UTC Close when the embedding window is destroyed commit - 65be875f5adf31e9c4762ac8a8d74b1dfdd78584 commit + 153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5 blob - 6ed8ad37458a12101c51751730cff4faed4690fd blob + 976216673a445db425942b78d5e225f6dfc7b2a4 --- LICENSE +++ LICENSE @@ -9,7 +9,7 @@ MIT/X Consortium License © 2009 Evan Gates © 2010-2012 Connor Lane Smith © 2014-2019 Hiltjo Posthuma -© 2015-2018 Quentin Rameau +© 2015-2019 Quentin Rameau Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), blob - 6b8f51b564551a8ffbeae5979ed9891f41b05064 blob + f8031497c8e116a9c6e045857d679e75445fd033 --- dmenu.c +++ dmenu.c @@ -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);