(!1654) Xnest: use xcb_window_t instead of Window

Since we're now using xcb for upstream X11 connection, it's cleaner to
use it's type for the window IDs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-09-02 11:48:52 +02:00
parent 7c57c2d89f
commit 562943f1bb
8 changed files with 26 additions and 19 deletions

View File

@ -46,7 +46,7 @@ Bool xnestUserBorderWidth = FALSE;
char *xnestWindowName = NULL; char *xnestWindowName = NULL;
int xnestNumScreens = 0; int xnestNumScreens = 0;
Bool xnestDoDirectColormaps = FALSE; Bool xnestDoDirectColormaps = FALSE;
Window xnestParentWindow = 0; xcb_window_t xnestParentWindow = 0;
int int
ddxProcessArgument(int argc, char *argv[], int i) ddxProcessArgument(int argc, char *argv[], int i)

View File

@ -18,6 +18,8 @@ is" without express or implied warranty.
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xdefs.h> #include <X11/Xdefs.h>
#include <xcb/xcb.h>
extern char *xnestDisplayName; extern char *xnestDisplayName;
extern Bool xnestFullGeneration; extern Bool xnestFullGeneration;
extern int xnestDefaultClass; extern int xnestDefaultClass;
@ -32,6 +34,6 @@ extern Bool xnestUserBorderWidth;
extern char *xnestWindowName; extern char *xnestWindowName;
extern int xnestNumScreens; extern int xnestNumScreens;
extern Bool xnestDoDirectColormaps; extern Bool xnestDoDirectColormaps;
extern Window xnestParentWindow; extern xcb_window_t xnestParentWindow;
#endif /* XNESTARGS_H */ #endif /* XNESTARGS_H */

View File

@ -17,6 +17,8 @@ is" without express or implied warranty.
#include <X11/Xdefs.h> #include <X11/Xdefs.h>
#include <X11/Xproto.h> #include <X11/Xproto.h>
#include <xcb/xcb.h>
#include "dix/colormap_priv.h" #include "dix/colormap_priv.h"
#include "scrnintstr.h" #include "scrnintstr.h"
@ -183,11 +185,11 @@ xnestGetInstalledColormapWindows(WindowPtr pWin, void *ptr)
return WT_WALKCHILDREN; return WT_WALKCHILDREN;
} }
static Window *xnestOldInstalledColormapWindows = NULL; static xcb_window_t *xnestOldInstalledColormapWindows = NULL;
static int xnestNumOldInstalledColormapWindows = 0; static int xnestNumOldInstalledColormapWindows = 0;
static Bool static Bool
xnestSameInstalledColormapWindows(Window *windows, int numWindows) xnestSameInstalledColormapWindows(xcb_window_t *windows, int numWindows)
{ {
if (xnestNumOldInstalledColormapWindows != numWindows) if (xnestNumOldInstalledColormapWindows != numWindows)
return FALSE; return FALSE;
@ -199,7 +201,7 @@ xnestSameInstalledColormapWindows(Window *windows, int numWindows)
return FALSE; return FALSE;
if (memcmp(xnestOldInstalledColormapWindows, windows, if (memcmp(xnestOldInstalledColormapWindows, windows,
numWindows * sizeof(Window))) numWindows * sizeof(xcb_window_t)))
return FALSE; return FALSE;
return TRUE; return TRUE;
@ -216,7 +218,7 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen)
icws.numWindows = 0; icws.numWindows = 0;
WalkTree(pScreen, xnestCountInstalledColormapWindows, (void *) &icws); WalkTree(pScreen, xnestCountInstalledColormapWindows, (void *) &icws);
if (icws.numWindows) { if (icws.numWindows) {
icws.windows = xallocarray(icws.numWindows + 1, sizeof(Window)); icws.windows = xallocarray(icws.numWindows + 1, sizeof(xcb_window_t));
icws.index = 0; icws.index = 0;
WalkTree(pScreen, xnestGetInstalledColormapWindows, (void *) &icws); WalkTree(pScreen, xnestGetInstalledColormapWindows, (void *) &icws);
icws.windows[icws.numWindows] = xnestDefaultWindows[pScreen->myNum]; icws.windows[icws.numWindows] = xnestDefaultWindows[pScreen->myNum];

View File

@ -31,7 +31,7 @@ typedef struct {
int numCmapIDs; int numCmapIDs;
Colormap *cmapIDs; Colormap *cmapIDs;
int numWindows; int numWindows;
Window *windows; xcb_window_t *windows;
int index; int index;
} xnestInstalledColormapWindows; } xnestInstalledColormapWindows;

View File

@ -47,13 +47,13 @@ is" without express or implied warranty.
#include "Args.h" #include "Args.h"
#include "mipointrst.h" #include "mipointrst.h"
Window xnestDefaultWindows[MAXSCREENS]; xcb_window_t xnestDefaultWindows[MAXSCREENS];
Window xnestScreenSaverWindows[MAXSCREENS]; xcb_window_t xnestScreenSaverWindows[MAXSCREENS];
DevPrivateKeyRec xnestScreenCursorFuncKeyRec; DevPrivateKeyRec xnestScreenCursorFuncKeyRec;
DevScreenPrivateKeyRec xnestScreenCursorPrivKeyRec; DevScreenPrivateKeyRec xnestScreenCursorPrivKeyRec;
ScreenPtr ScreenPtr
xnestScreen(Window window) xnestScreen(xcb_window_t window)
{ {
int i; int i;

View File

@ -18,10 +18,12 @@ is" without express or implied warranty.
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xdefs.h> #include <X11/Xdefs.h>
extern Window xnestDefaultWindows[MAXSCREENS]; #include <xcb/xcb.h>
extern Window xnestScreenSaverWindows[MAXSCREENS];
ScreenPtr xnestScreen(Window window); extern xcb_window_t xnestDefaultWindows[MAXSCREENS];
extern xcb_window_t xnestScreenSaverWindows[MAXSCREENS];
ScreenPtr xnestScreen(xcb_window_t window);
Bool xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]); Bool xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]);
Bool xnestCloseScreen(ScreenPtr pScreen); Bool xnestCloseScreen(ScreenPtr pScreen);

View File

@ -57,7 +57,7 @@ xnestFindWindowMatch(WindowPtr pWin, void *ptr)
} }
WindowPtr WindowPtr
xnestWindowPtr(Window window) xnestWindowPtr(xcb_window_t window)
{ {
xnestWindowMatch wm; xnestWindowMatch wm;
int i; int i;

View File

@ -16,23 +16,24 @@ is" without express or implied warranty.
#define XNESTWINDOW_H #define XNESTWINDOW_H
#include <X11/Xdefs.h> #include <X11/Xdefs.h>
#include <xcb/xcb.h>
typedef struct { typedef struct {
Window window; xcb_window_t window;
Window parent; xcb_window_t parent;
int x; int x;
int y; int y;
unsigned int width; unsigned int width;
unsigned int height; unsigned int height;
unsigned int border_width; unsigned int border_width;
Window sibling_above; xcb_window_t sibling_above;
RegionPtr bounding_shape; RegionPtr bounding_shape;
RegionPtr clip_shape; RegionPtr clip_shape;
} xnestPrivWin; } xnestPrivWin;
typedef struct { typedef struct {
WindowPtr pWin; WindowPtr pWin;
Window window; xcb_window_t window;
} xnestWindowMatch; } xnestWindowMatch;
extern DevPrivateKeyRec xnestWindowPrivateKeyRec; extern DevPrivateKeyRec xnestWindowPrivateKeyRec;
@ -55,7 +56,7 @@ extern DevPrivateKeyRec xnestWindowPrivateKeyRec;
#define xnestWindowSiblingBelow(pWin) \ #define xnestWindowSiblingBelow(pWin) \
((pWin)->nextSib ? xnestWindow((pWin)->nextSib) : XCB_WINDOW_NONE) ((pWin)->nextSib ? xnestWindow((pWin)->nextSib) : XCB_WINDOW_NONE)
WindowPtr xnestWindowPtr(Window window); WindowPtr xnestWindowPtr(xcb_window_t window);
Bool xnestCreateWindow(WindowPtr pWin); Bool xnestCreateWindow(WindowPtr pWin);
Bool xnestDestroyWindow(WindowPtr pWin); Bool xnestDestroyWindow(WindowPtr pWin);
Bool xnestPositionWindow(WindowPtr pWin, int x, int y); Bool xnestPositionWindow(WindowPtr pWin, int x, int y);