From 0f2f8e3a109bfe5a62daca2cde26e1d84fcd36d9 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Sat, 21 Mar 2026 17:05:20 -0700 Subject: [PATCH] rootless: Fix Glyphs damage bounding box origin and coordinate space The glyph bounding box in RootlessGlyphs is computed in drawable-relative (window-local) coordinates, but RootlessDamageBox expects global (screen) coordinates. Without translating by drawable.x/y, the damage region often fell outside the window's borderClip and was silently discarded by RootlessDamageRegion. RootlessGlyphs accumulated glyph positions starting from (xSrc, ySrc) instead of (0, 0). The xSrc/ySrc parameters are the source picture reference point, not destination offsets. Every standard Glyphs implementation (fbGlyphs, miGlyphs) starts position accumulation from (0, 0) and builds up destination coordinates by adding each GlyphList's xOff/yOff deltas. Starting from xSrc shifted the entire damage bounding box by (xSrc, ySrc), causing it to miss the actual rendered region. For typical text rendering where xSrc equals the destination x position, this doubled the offset, placing the damage box well outside the window's borderClip and causing RootlessDamageRegion to silently discard it. Fixes [1/2]: https://github.com/XQuartz/XQuartz/issues/323 Signed-off-by: Jeremy Huddleston Sequoia --- miext/rootless/rootlessScreen.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 79fe3507b..ca7c3e311 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -297,8 +297,8 @@ RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, //SCREEN_WRAP(ps, Glyphs); if (dstWin && IsFramedWindow(dstWin)) { - x = xSrc; - y = ySrc; + x = 0; + y = 0; while (nlist--) { x += list->xOff; @@ -341,6 +341,11 @@ RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, y += glyph->info.yOff; } + /* RootlessDamageBox expects global (screen) coordinates */ + box.x1 += dstWin->drawable.x; + box.y1 += dstWin->drawable.y; + box.x2 += dstWin->drawable.x; + box.y2 += dstWin->drawable.y; RootlessDamageBox(dstWin, &box); } list++;