Bump to 0fe460d.

fix BadMatch error when embedding on some windows

When embedded into another window, dmenu will fail with the BadMatch
error if that window have not the same colormap/depth/visual as the
root window.

That happens because dmenu inherits the colormap/depth/visual from
its parent, but draws on a pixmap created based on the root window
using a GC created for the root window (see drw.c).  A BadMatch will
occur when copying the content of the pixmap into dmenu's window.

A solution is to create dmenu's window inside root and then reparent
it if embeded.

See this mail[1] on ports@openbsd.org mailing list for context.

[1]: https://marc.info/?l=openbsd-ports&m=168072150814664&w=2

Ref.
https://git.suckless.org/dmenu/commit/0fe460dbd469a1d5b6a7140d0e1801935e4a923b.html
This commit is contained in:
bakkeby 2023-04-07 14:19:54 +02:00
parent a725f9f6b9
commit 25ea08edd1
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,5 @@
Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this dmenu 5.2 (e42c036,
2022-10-26) project has a different take on patching. It uses preprocessor directives to decide
Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this dmenu 5.2 (0fe460d,
2023-04-05) project has a different take on patching. It uses preprocessor directives to decide
whether or not to include a patch during build time. Essentially this means that this build, for
better or worse, contains both the patched _and_ the original code. The aim being that you can
select which patches to include and the build will contain that code and nothing more.

View File

@ -1741,7 +1741,7 @@ setup(void)
#endif // MOUSE_SUPPORT_PATCH
;
win = XCreateWindow(
dpy, parentwin,
dpy, root,
#if BARPADDING_PATCH && BORDER_PATCH
x + sp, y + vp - (topbar ? 0 : border_width * 2), mw - 2 * sp - border_width * 2, mh, border_width,
#elif BARPADDING_PATCH
@ -1790,6 +1790,7 @@ setup(void)
XMapRaised(dpy, win);
if (embed) {
XReparentWindow(dpy, win, parentwin, x, y);
XSelectInput(dpy, parentwin, FocusChangeMask | SubstructureNotifyMask);
if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
for (i = 0; i < du && dws[i] != win; ++i)