From 622d216aa10aa9856c9dadb1cbcaa1a25ce219dd Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 5 Aug 2024 13:20:53 +0200 Subject: [PATCH] (!1654) Xnest: replace XChangeGC() by xcb_change_gc() Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xnest/Cursor.c | 24 +++++++++++++----------- hw/xnest/GC.c | 21 +++++++++++++++------ 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c index 28e289366..17dcb7fdb 100644 --- a/hw/xnest/Cursor.c +++ b/hw/xnest/Cursor.c @@ -16,10 +16,15 @@ is" without express or implied warranty. #include #endif +#include + #include #include #include +#include +#include + #include "screenint.h" #include "input.h" #include "misc.h" @@ -43,19 +48,16 @@ xnestCursorFuncRec xnestCursorFuncs = { NULL }; Bool xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { - unsigned long valuemask; - XGCValues values; + uint32_t valuemask = XCB_GC_FUNCTION | XCB_GC_PLANE_MASK | XCB_GC_FOREGROUND + | XCB_GC_BACKGROUND | XCB_GC_CLIP_MASK; - valuemask = GCFunction | - GCPlaneMask | GCForeground | GCBackground | GCClipMask; + xcb_params_gc_t values = { + .function = XCB_GX_COPY, + .plane_mask = ((uint32_t)~0L), + .foreground = 1L, + }; - values.function = GXcopy; - values.plane_mask = AllPlanes; - values.foreground = 1L; - values.background = 0L; - values.clip_mask = XCB_PIXMAP_NONE; - - XChangeGC(xnestDisplay, xnestBitmapGC, valuemask, &values); + xcb_aux_change_gc(xnestUpstreamInfo.conn, xnestBitmapGC->gid, valuemask, &values); uint32_t const winId = xnestDefaultWindows[pScreen->myNum]; diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c index a1328f96d..30f316450 100644 --- a/hw/xnest/GC.c +++ b/hw/xnest/GC.c @@ -16,10 +16,15 @@ is" without express or implied warranty. #include #endif +#include + #include #include #include +#include +#include + #include "gcstruct.h" #include "windowstr.h" #include "pixmapstr.h" @@ -29,6 +34,7 @@ is" without express or implied warranty. #include "region.h" #include "Xnest.h" +#include "xnest-xcb.h" #include "Display.h" #include "XNGC.h" @@ -95,7 +101,7 @@ xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) void xnestChangeGC(GCPtr pGC, unsigned long mask) { - XGCValues values; + xcb_params_gc_t values; if (mask & GCFunction) values.function = pGC->alu; @@ -138,10 +144,10 @@ xnestChangeGC(GCPtr pGC, unsigned long mask) values.stipple = xnestPixmap(pGC->stipple); if (mask & GCTileStipXOrigin) - values.ts_x_origin = pGC->patOrg.x; + values.tile_stipple_origin_x = pGC->patOrg.x; if (mask & GCTileStipYOrigin) - values.ts_y_origin = pGC->patOrg.y; + values.tile_stipple_origin_y = pGC->patOrg.y; if (mask & GCFont) values.font = xnestFont(pGC->font); @@ -153,10 +159,10 @@ xnestChangeGC(GCPtr pGC, unsigned long mask) values.graphics_exposures = pGC->graphicsExposures; if (mask & GCClipXOrigin) - values.clip_x_origin = pGC->clipOrg.x; + values.clip_originX = pGC->clipOrg.x; if (mask & GCClipYOrigin) - values.clip_y_origin = pGC->clipOrg.y; + values.clip_originY = pGC->clipOrg.y; if (mask & GCClipMask) /* this is handled in change clip */ mask &= ~GCClipMask; @@ -174,7 +180,10 @@ xnestChangeGC(GCPtr pGC, unsigned long mask) values.arc_mode = pGC->arcMode; if (mask) - XChangeGC(xnestDisplay, xnestGC(pGC), mask, &values); + xcb_aux_change_gc(xnestUpstreamInfo.conn, + xnest_upstream_gc(pGC), + mask, + &values); } void