Xnest: replace XChangeGC() by xcb_change_gc()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-08-05 13:20:53 +02:00
parent e71cf9c53a
commit ebbaf44e9f
2 changed files with 28 additions and 17 deletions

View File

@ -13,10 +13,15 @@ is" without express or implied warranty.
*/ */
#include <dix-config.h> #include <dix-config.h>
#include <stdint.h>
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xdefs.h> #include <X11/Xdefs.h>
#include <X11/Xproto.h> #include <X11/Xproto.h>
#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include "screenint.h" #include "screenint.h"
#include "input.h" #include "input.h"
#include "misc.h" #include "misc.h"
@ -40,19 +45,16 @@ xnestCursorFuncRec xnestCursorFuncs = { NULL };
Bool Bool
xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{ {
unsigned long valuemask; uint32_t valuemask = XCB_GC_FUNCTION | XCB_GC_PLANE_MASK | XCB_GC_FOREGROUND
XGCValues values; | XCB_GC_BACKGROUND | XCB_GC_CLIP_MASK;
valuemask = GCFunction | xcb_params_gc_t values = {
GCPlaneMask | GCForeground | GCBackground | GCClipMask; .function = XCB_GX_COPY,
.plane_mask = ((uint32_t)~0L),
.foreground = 1L,
};
values.function = GXcopy; xcb_aux_change_gc(xnestUpstreamInfo.conn, xnestBitmapGC->gid, valuemask, &values);
values.plane_mask = AllPlanes;
values.foreground = 1L;
values.background = 0L;
values.clip_mask = XCB_PIXMAP_NONE;
XChangeGC(xnestDisplay, xnestBitmapGC, valuemask, &values);
uint32_t const winId = xnestDefaultWindows[pScreen->myNum]; uint32_t const winId = xnestDefaultWindows[pScreen->myNum];

View File

@ -13,10 +13,15 @@ is" without express or implied warranty.
*/ */
#include <dix-config.h> #include <dix-config.h>
#include <stdint.h>
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xdefs.h> #include <X11/Xdefs.h>
#include <X11/Xproto.h> #include <X11/Xproto.h>
#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include "gcstruct.h" #include "gcstruct.h"
#include "windowstr.h" #include "windowstr.h"
#include "pixmapstr.h" #include "pixmapstr.h"
@ -26,6 +31,7 @@ is" without express or implied warranty.
#include "region.h" #include "region.h"
#include "Xnest.h" #include "Xnest.h"
#include "xnest-xcb.h"
#include "Display.h" #include "Display.h"
#include "XNGC.h" #include "XNGC.h"
@ -92,7 +98,7 @@ xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
void void
xnestChangeGC(GCPtr pGC, unsigned long mask) xnestChangeGC(GCPtr pGC, unsigned long mask)
{ {
XGCValues values; xcb_params_gc_t values;
if (mask & GCFunction) if (mask & GCFunction)
values.function = pGC->alu; values.function = pGC->alu;
@ -135,10 +141,10 @@ xnestChangeGC(GCPtr pGC, unsigned long mask)
values.stipple = xnestPixmap(pGC->stipple); values.stipple = xnestPixmap(pGC->stipple);
if (mask & GCTileStipXOrigin) if (mask & GCTileStipXOrigin)
values.ts_x_origin = pGC->patOrg.x; values.tile_stipple_origin_x = pGC->patOrg.x;
if (mask & GCTileStipYOrigin) if (mask & GCTileStipYOrigin)
values.ts_y_origin = pGC->patOrg.y; values.tile_stipple_origin_y = pGC->patOrg.y;
if (mask & GCFont) if (mask & GCFont)
values.font = xnestFont(pGC->font); values.font = xnestFont(pGC->font);
@ -150,10 +156,10 @@ xnestChangeGC(GCPtr pGC, unsigned long mask)
values.graphics_exposures = pGC->graphicsExposures; values.graphics_exposures = pGC->graphicsExposures;
if (mask & GCClipXOrigin) if (mask & GCClipXOrigin)
values.clip_x_origin = pGC->clipOrg.x; values.clip_originX = pGC->clipOrg.x;
if (mask & GCClipYOrigin) 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 */ if (mask & GCClipMask) /* this is handled in change clip */
mask &= ~GCClipMask; mask &= ~GCClipMask;
@ -171,7 +177,10 @@ xnestChangeGC(GCPtr pGC, unsigned long mask)
values.arc_mode = pGC->arcMode; values.arc_mode = pGC->arcMode;
if (mask) if (mask)
XChangeGC(xnestDisplay, xnestGC(pGC), mask, &values); xcb_aux_change_gc(xnestUpstreamInfo.conn,
xnest_upstream_gc(pGC),
mask,
&values);
} }
void void