Hello community, here is the log from the commit of package dmenu for openSUSE:Factory checked in at 2020-02-25 16:07:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/dmenu (Old) and /work/SRC/openSUSE:Factory/.dmenu.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "dmenu" Tue Feb 25 16:07:53 2020 rev:13 rq:779047 version:4.9 Changes: -------- --- /work/SRC/openSUSE:Factory/dmenu/dmenu.changes 2020-02-24 15:57:27.052127084 +0100 +++ /work/SRC/openSUSE:Factory/.dmenu.new.26092/dmenu.changes 2020-02-25 16:08:20.168682370 +0100 @@ -1,0 +2,7 @@ +Mon Feb 24 13:16:36 UTC 2020 - Tomas Cech <[email protected]> + +- add 0001-Close-when-the-embedding-window-is-destroyed.patch +- add 0002-fix-crash-when-XOpenIM-returns-NULL.patch + - fix crash on input + +------------------------------------------------------------------- New: ---- 0001-Close-when-the-embedding-window-is-destroyed.patch 0002-fix-crash-when-XOpenIM-returns-NULL.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dmenu.spec ++++++ --- /var/tmp/diff_new_pack.FQRbFz/_old 2020-02-25 16:08:21.072681605 +0100 +++ /var/tmp/diff_new_pack.FQRbFz/_new 2020-02-25 16:08:21.072681605 +0100 @@ -25,6 +25,8 @@ URL: https://tools.suckless.org/dmenu/ Source: http://dl.suckless.org/tools/%{name}-%{version}.tar.gz Patch0: dmenu-optflags.patch +Patch1: 0001-Close-when-the-embedding-window-is-destroyed.patch +Patch2: 0002-fix-crash-when-XOpenIM-returns-NULL.patch BuildRequires: pkgconfig BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(x11) ++++++ 0001-Close-when-the-embedding-window-is-destroyed.patch ++++++ >From 153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5 Mon Sep 17 00:00:00 2001 From: Quentin Rameau <[email protected]> Date: Mon, 4 Feb 2019 00:29:26 +0100 Subject: [PATCH 1/2] Close when the embedding window is destroyed --- LICENSE | 2 +- dmenu.c | 7 ++++++- 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 <[email protected]> © 2010-2012 Connor Lane Smith <[email protected]> © 2014-2019 Hiltjo Posthuma <[email protected]> -© 2015-2018 Quentin Rameau <[email protected]> +© 2015-2019 Quentin Rameau <[email protected]> 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 6b8f51b..f803149 100644 --- a/dmenu.c +++ b/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); -- 2.25.1 ++++++ 0002-fix-crash-when-XOpenIM-returns-NULL.patch ++++++ >From f5036b90efd9423d805923a0bc73cd54e30e72ab Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma <[email protected]> Date: Tue, 12 Feb 2019 19:10:43 +0100 Subject: [PATCH 2/2] fix crash when XOpenIM returns NULL for example when IME variables are set, but the program is not started (yet). --- dmenu.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dmenu.c b/dmenu.c index f803149..ae56f4f 100644 --- a/dmenu.c +++ b/dmenu.c @@ -664,8 +664,17 @@ setup(void) CWOverrideRedirect | CWBackPixel | CWEventMask, &swa); XSetClassHint(dpy, win, &ch); - /* open input methods */ - xim = XOpenIM(dpy, NULL, NULL, NULL); + + /* input methods */ + if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) { + XSetLocaleModifiers("@im=local"); + if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) { + XSetLocaleModifiers("@im="); + if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) + die("XOpenIM failed. Could not open input device.\n"); + } + } + xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, win, XNFocusWindow, win, NULL); -- 2.25.1
