Xnest: use XCB_CW_* defines instead of CW*

Use XCB's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-08-09 17:51:55 +02:00
parent 20a9ed60f0
commit a24178f25f
2 changed files with 32 additions and 32 deletions

View File

@ -341,7 +341,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
if (xnestDoFullGeneration) { if (xnestDoFullGeneration) {
valuemask = CWBackPixel | CWEventMask | CWColormap; valuemask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK | XCB_CW_COLORMAP;
attributes.background_pixel = xnestWhitePixel; attributes.background_pixel = xnestWhitePixel;
attributes.event_mask = xnestEventMask; attributes.event_mask = xnestEventMask;
attributes.colormap = attributes.colormap =
@ -385,7 +385,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
XMapWindow(xnestDisplay, xnestDefaultWindows[pScreen->myNum]); XMapWindow(xnestDisplay, xnestDefaultWindows[pScreen->myNum]);
valuemask = CWBackPixmap | CWColormap; valuemask = XCB_CW_BACK_PIXMAP | XCB_CW_COLORMAP;
attributes.background_pixmap = xnestScreenSaverPixmap; attributes.background_pixmap = xnestScreenSaverPixmap;
attributes.colormap = attributes.colormap =
DefaultColormap(xnestDisplay, DefaultScreen(xnestDisplay)); DefaultColormap(xnestDisplay, DefaultScreen(xnestDisplay));

View File

@ -83,7 +83,7 @@ xnestCreateWindow(WindowPtr pWin)
visual = CopyFromParent; visual = CopyFromParent;
} }
else { else {
mask = CWEventMask | CWBackingStore; mask = XCB_CW_EVENT_MASK | XCB_CW_BACKING_STORE;
attributes.event_mask = ExposureMask; attributes.event_mask = ExposureMask;
attributes.backing_store = NotUseful; attributes.backing_store = NotUseful;
@ -92,7 +92,7 @@ xnestCreateWindow(WindowPtr pWin)
pWin->optional->visual != wVisual(pWin->parent)) { pWin->optional->visual != wVisual(pWin->parent)) {
visual = visual =
xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin)); xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin));
mask |= CWColormap; mask |= XCB_CW_COLORMAP;
if (pWin->optional->colormap) { if (pWin->optional->colormap) {
dixLookupResourceByType((void **) &pCmap, wColormap(pWin), dixLookupResourceByType((void **) &pCmap, wColormap(pWin),
X11_RESTYPE_COLORMAP, serverClient, X11_RESTYPE_COLORMAP, serverClient,
@ -109,7 +109,7 @@ xnestCreateWindow(WindowPtr pWin)
visual = xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin)); visual = xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin));
dixLookupResourceByType((void **) &pCmap, wColormap(pWin), dixLookupResourceByType((void **) &pCmap, wColormap(pWin),
X11_RESTYPE_COLORMAP, serverClient, DixUseAccess); X11_RESTYPE_COLORMAP, serverClient, DixUseAccess);
mask |= CWColormap; mask |= XCB_CW_COLORMAP;
attributes.colormap = xnestColormap(pCmap); attributes.colormap = xnestColormap(pCmap);
} }
} }
@ -259,7 +259,7 @@ xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
{ {
XSetWindowAttributes attributes; XSetWindowAttributes attributes;
if (mask & CWBackPixmap) if (mask & XCB_CW_BACK_PIXMAP)
switch (pWin->backgroundState) { switch (pWin->backgroundState) {
case None: case None:
attributes.background_pixmap = None; attributes.background_pixmap = None;
@ -274,59 +274,59 @@ xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
break; break;
case BackgroundPixel: case BackgroundPixel:
mask &= ~CWBackPixmap; mask &= ~XCB_CW_BACK_PIXMAP;
break; break;
} }
if (mask & CWBackPixel) { if (mask & XCB_CW_BACK_PIXEL) {
if (pWin->backgroundState == BackgroundPixel) if (pWin->backgroundState == BackgroundPixel)
attributes.background_pixel = xnestPixel(pWin->background.pixel); attributes.background_pixel = xnestPixel(pWin->background.pixel);
else else
mask &= ~CWBackPixel; mask &= ~XCB_CW_BACK_PIXEL;
} }
if (mask & CWBorderPixmap) { if (mask & XCB_CW_BORDER_PIXMAP) {
if (pWin->borderIsPixel) if (pWin->borderIsPixel)
mask &= ~CWBorderPixmap; mask &= ~XCB_CW_BORDER_PIXMAP;
else else
attributes.border_pixmap = xnestPixmap(pWin->border.pixmap); attributes.border_pixmap = xnestPixmap(pWin->border.pixmap);
} }
if (mask & CWBorderPixel) { if (mask & XCB_CW_BORDER_PIXEL) {
if (pWin->borderIsPixel) if (pWin->borderIsPixel)
attributes.border_pixel = xnestPixel(pWin->border.pixel); attributes.border_pixel = xnestPixel(pWin->border.pixel);
else else
mask &= ~CWBorderPixel; mask &= ~XCB_CW_BORDER_PIXEL;
} }
if (mask & CWBitGravity) if (mask & XCB_CW_BIT_GRAVITY)
attributes.bit_gravity = pWin->bitGravity; attributes.bit_gravity = pWin->bitGravity;
if (mask & CWWinGravity) /* dix does this for us */ if (mask & XCB_CW_WIN_GRAVITY) /* dix does this for us */
mask &= ~CWWinGravity; mask &= ~XCB_CW_WIN_GRAVITY;
if (mask & CWBackingStore) /* this is really not useful */ if (mask & XCB_CW_BACKING_STORE) /* this is really not useful */
mask &= ~CWBackingStore; mask &= ~XCB_CW_BACKING_STORE;
if (mask & CWBackingPlanes) /* this is really not useful */ if (mask & XCB_CW_BACKING_PLANES) /* this is really not useful */
mask &= ~CWBackingPlanes; mask &= ~XCB_CW_BACKING_PLANES;
if (mask & CWBackingPixel) /* this is really not useful */ if (mask & XCB_CW_BACKING_PIXEL) /* this is really not useful */
mask &= ~CWBackingPixel; mask &= ~XCB_CW_BACKING_PIXEL;
if (mask & CWOverrideRedirect) if (mask & XCB_CW_OVERRIDE_REDIRECT)
attributes.override_redirect = pWin->overrideRedirect; attributes.override_redirect = pWin->overrideRedirect;
if (mask & CWSaveUnder) /* this is really not useful */ if (mask & XCB_CW_SAVE_UNDER) /* this is really not useful */
mask &= ~CWSaveUnder; mask &= ~XCB_CW_SAVE_UNDER;
if (mask & CWEventMask) /* events are handled elsewhere */ if (mask & XCB_CW_EVENT_MASK) /* events are handled elsewhere */
mask &= ~CWEventMask; mask &= ~XCB_CW_EVENT_MASK;
if (mask & CWDontPropagate) /* events are handled elsewhere */ if (mask & XCB_CW_DONT_PROPAGATE) /* events are handled elsewhere */
mask &= ~CWDontPropagate; mask &= ~XCB_CW_DONT_PROPAGATE;
if (mask & CWColormap) { if (mask & XCB_CW_COLORMAP) {
ColormapPtr pCmap; ColormapPtr pCmap;
dixLookupResourceByType((void **) &pCmap, wColormap(pWin), dixLookupResourceByType((void **) &pCmap, wColormap(pWin),
@ -337,8 +337,8 @@ xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
xnestSetInstalledColormapWindows(pWin->drawable.pScreen); xnestSetInstalledColormapWindows(pWin->drawable.pScreen);
} }
if (mask & CWCursor) /* this is handled in cursor code */ if (mask & XCB_CW_CURSOR) /* this is handled in cursor code */
mask &= ~CWCursor; mask &= ~XCB_CW_CURSOR;
if (mask) if (mask)
XChangeWindowAttributes(xnestDisplay, xnestWindow(pWin), XChangeWindowAttributes(xnestDisplay, xnestWindow(pWin),