liberty-xui: improve clipping on X11
Alpine 3.24 Success
OpenBSD 7.8 Success

We used to clip text but not widget backgrounds,
resulting in an odd undesirable mix.
This commit is contained in:
2026-07-29 22:09:38 +02:00
parent 0af42f975c
commit 2453d4d0b1
+8
View File
@@ -1352,9 +1352,17 @@ x11_render_widget (struct widget *w, const XRectangle *clip)
// Children may set their own clips, so reset before each sibling.
// We need to go through Xft, or XftTextRenderUtf8() might skip glyphs.
if (clip)
{
XftDrawSetClipRectangles (g_xui.xft_draw, 0, 0, clip, 1);
XRenderSetPictureClipRectangles (g_xui.dpy,
g_xui.x11_pixmap_picture, 0, 0, clip, 1);
}
else
{
XftDrawSetClip (g_xui.xft_draw, None);
XRenderChangePicture (g_xui.dpy, g_xui.x11_pixmap_picture, CPClipMask,
&(XRenderPictureAttributes) { .clip_mask = None });
}
if (w->on_render)
w->on_render (w);