summary refs log tree commit diff
path: root/pkgs/applications/misc/dmenu
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2019-07-14 13:45:42 +0000
committerOrivej Desh <orivej@gmx.fr>2019-07-14 13:45:42 +0000
commit1f16d0496ce86d4c903e2e4ed6cbe4e952a7196f (patch)
treeba714389c53c74daf074056ab65613a9013233d9 /pkgs/applications/misc/dmenu
parenta62fa2f17fbfe0395fb9b67cee0a8451ef46211a (diff)
downloadnixpkgs-1f16d0496ce86d4c903e2e4ed6cbe4e952a7196f.tar
nixpkgs-1f16d0496ce86d4c903e2e4ed6cbe4e952a7196f.tar.gz
nixpkgs-1f16d0496ce86d4c903e2e4ed6cbe4e952a7196f.tar.bz2
nixpkgs-1f16d0496ce86d4c903e2e4ed6cbe4e952a7196f.tar.lz
nixpkgs-1f16d0496ce86d4c903e2e4ed6cbe4e952a7196f.tar.xz
nixpkgs-1f16d0496ce86d4c903e2e4ed6cbe4e952a7196f.tar.zst
nixpkgs-1f16d0496ce86d4c903e2e4ed6cbe4e952a7196f.zip
dmenu: fix crash with XMODIFIERS
Fixes #59625
Diffstat (limited to 'pkgs/applications/misc/dmenu')
-rw-r--r--pkgs/applications/misc/dmenu/default.nix2
-rw-r--r--pkgs/applications/misc/dmenu/xim.patch31
2 files changed, 32 insertions, 1 deletions
diff --git a/pkgs/applications/misc/dmenu/default.nix b/pkgs/applications/misc/dmenu/default.nix
index e6b62817b90..26a297481d0 100644
--- a/pkgs/applications/misc/dmenu/default.nix
+++ b/pkgs/applications/misc/dmenu/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libX11, libXinerama, libXft, zlib, patches ? null }:
+{ stdenv, fetchurl, libX11, libXinerama, libXft, zlib, patches ? [ ./xim.patch ] }:
 
 stdenv.mkDerivation rec {
   name = "dmenu-4.9";
diff --git a/pkgs/applications/misc/dmenu/xim.patch b/pkgs/applications/misc/dmenu/xim.patch
new file mode 100644
index 00000000000..f77d48324da
--- /dev/null
+++ b/pkgs/applications/misc/dmenu/xim.patch
@@ -0,0 +1,31 @@
+Revert https://git.suckless.org/dmenu/commit/377bd37e212b1ec4c03a481245603c6560d0be22.html
+
+Upstream has reverted it after v4.9 in https://git.suckless.org/dmenu/commit/db6093f6ec1bb884f7540f2512935b5254750b30.html
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -552,7 +552,7 @@ run(void)
+ 	XEvent ev;
+ 
+ 	while (!XNextEvent(dpy, &ev)) {
+-		if (XFilterEvent(&ev, None))
++		if (XFilterEvent(&ev, win))
+ 			continue;
+ 		switch(ev.type) {
+ 		case Expose:
+@@ -664,7 +664,6 @@ setup(void)
+ 	                XNClientWindow, win, XNFocusWindow, win, NULL);
+ 
+ 	XMapRaised(dpy, win);
+-	XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
+ 	if (embed) {
+ 		XSelectInput(dpy, parentwin, FocusChangeMask);
+ 		if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
+@@ -730,8 +729,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);