about summary refs log tree commit diff stats
diff options
context:
space:
mode:
author2019-02-04 00:29:26 +0100
committer2020-11-26 00:34:30 -0800
commitd6351cf625dc8286f7c8717edc8803237810ad45 (patch)
tree2a568e5286b4f39e76d2f005760213a865fd565c
parent9a689d13c7e78ceabc36e44030b4b99572341b36 (diff)
downloaddmenu-d6351cf625dc8286f7c8717edc8803237810ad45.tar.gz
-rw-r--r--LICENSE2
-rw-r--r--dmenu.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/LICENSE b/LICENSE
index 6ed8ad3..9762166 100644
--- a/LICENSE
+++ b/LICENSE
@@ -9,7 +9,7 @@ MIT/X Consortium License
 © 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"),
diff --git a/dmenu.c b/dmenu.c
index 7174098..08623da 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -746,6 +746,11 @@ run(void)
 		case ButtonPress:
 			buttonpress(&ev);
 			break;
+		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);
@@ -860,7 +865,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);