fix BadMatch error when embedding on some windowsmaster
commita0274bc20e11d8672bb2953fdd1d3010c0e708c5
authorLucas de Sena <lucas@seninha.org>
Fri, 9 Aug 2024 11:33:47 +0000 (9 13:33 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Fri, 9 Aug 2024 11:34:56 +0000 (9 13:34 +0200)
treec2368d6273853e48c62103155b1a9a69d9d13d5e
parent5dbcca49263be094fc38159c297458ae323ef647
fix BadMatch error when embedding on some windows

When embedded, st fails with BadMatch error if the embedder's window has
non-default colormap/depth/visual.  This commit fixes that by creating
st's window inside root and then reparent it into embedder.

The reference window for dc.gc is also changed to match root's visuals.

A similar commit had been made for dmenu[1].
See this issue[2] on github for context.

[1]: https://git.suckless.org/dmenu/commit/0fe460dbd469a1d5b6a7140d0e1801935e4a923b.html
[2]: https://github.com/phillbush/xfiles/issues/47
x.c