From 63627a9b9becf4e69f07179cc8f7ef92b926e518 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 1 Aug 2024 12:44:51 +0200 Subject: [PATCH] Xnest: replace XFillRectangles() by xcb_poly_fill_rectangle() Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xnest/GCOps.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c index 2588a8e4d..ec6841cdd 100644 --- a/hw/xnest/GCOps.c +++ b/hw/xnest/GCOps.c @@ -288,8 +288,13 @@ void xnestPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles, xRectangle *pRectangles) { - XFillRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - (XRectangle *) pRectangles, nRectangles); + /* xRectangle and xcb_rectangle_t are defined in the same way, both matching + the protocol layout, so we can directly typecast them */ + xcb_poly_fill_rectangle(xnestUpstreamInfo.conn, + xnestDrawable(pDrawable), + xnest_upstream_gc(pGC), + nRectangles, + (xcb_rectangle_t*)pRectangles); } void @@ -373,8 +378,16 @@ xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst, XSetStipple(xnestDisplay, xnestGC(pGC), xnestPixmap(pBitmap)); XSetTSOrigin(xnestDisplay, xnestGC(pGC), x, y); XSetFillStyle(xnestDisplay, xnestGC(pGC), FillStippled); - XFillRectangle(xnestDisplay, xnestDrawable(pDst), - xnestGC(pGC), x, y, width, height); + + xcb_rectangle_t rect = { + .x = x, .y = y, .width = width, .height = height, + }; + xcb_poly_fill_rectangle(xnestUpstreamInfo.conn, + xnestDrawable(pDst), + xnest_upstream_gc(pGC), + 1, + &rect); + XSetFillStyle(xnestDisplay, xnestGC(pGC), FillSolid); } else