about summary refs log tree commit diff stats
diff options
context:
space:
mode:
author2020-11-26 07:27:44 -0500
committer2020-11-26 07:27:44 -0500
commit3a6bc67fbd6df190b002d33f600a6465cad9cfb8 (patch)
treefd94b43dd94385b8849a015125ec02729c8ce2f3
parent9a689d13c7e78ceabc36e44030b4b99572341b36 (diff)
parentfdb4cea2039c9fce5fd8bc5a74f657db02a8be83 (diff)
downloaddmenu-3a6bc67fbd6df190b002d33f600a6465cad9cfb8.tar.gz
-rw-r--r--LICENSE4
-rw-r--r--config.mk2
-rw-r--r--dmenu.c19
-rwxr-xr-x[-rw-r--r--]dmenu_path0
-rw-r--r--drw.c1
5 files changed, 16 insertions, 10 deletions
diff --git a/LICENSE b/LICENSE
index 6ed8ad3..3afd28e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -8,8 +8,8 @@ MIT/X Consortium License
 © 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>
+© 2014-2020 Hiltjo Posthuma <hiltjo@codemadness.org>
+© 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/config.mk b/config.mk
index 260eeae..8531fb9 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
 # dmenu version
-VERSION = 4.9
+VERSION = 5.0
 
 # paths
 PREFIX = /usr/local
diff --git a/dmenu.c b/dmenu.c
index 7174098..bde0869 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -740,12 +740,17 @@ run(void)
 	XEvent ev;
 
 	while (!XNextEvent(dpy, &ev)) {
-		if (XFilterEvent(&ev, None))
+		if (XFilterEvent(&ev, win))
 			continue;
 		switch(ev.type) {
 		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);
@@ -852,15 +857,17 @@ setup(void)
 	                    CWOverrideRedirect | CWBackPixel | CWColormap |  CWEventMask | CWBorderPixel, &swa);
 	XSetClassHint(dpy, win, &ch);
 
-	/* open input methods */
-	xim = XOpenIM(dpy, NULL, NULL, NULL);
+
+	/* input methods */
+	if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL)
+		die("XOpenIM failed: could not open input device");
+
 	xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
 	                XNClientWindow, win, XNFocusWindow, win, NULL);
 
 	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);
@@ -953,8 +960,6 @@ main(int argc, char *argv[])
 
 	if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
 		fputs("warning: no locale support\n", stderr);
-	if (!XSetLocaleModifiers(""))
-		fputs("warning: no locale modifiers support\n", stderr);
 	if (!(dpy = XOpenDisplay(NULL)))
 		die("cannot open display");
 	screen = DefaultScreen(dpy);
diff --git a/dmenu_path b/dmenu_path
index 3a7cda7..3a7cda7 100644..100755
--- a/dmenu_path
+++ b/dmenu_path
diff --git a/drw.c b/drw.c
index 9880f38..7694955 100644
--- a/drw.c
+++ b/drw.c
@@ -98,6 +98,7 @@ drw_free(Drw *drw)
 {
 	XFreePixmap(drw->dpy, drw->drawable);
 	XFreeGC(drw->dpy, drw->gc);
+	drw_fontset_free(drw->fonts);
 	free(drw);
 }