(!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:
		
							parent
							
								
									17333028c5
								
							
						
					
					
						commit
						3dc8aa640c
					
				| 
						 | 
					@ -47,7 +47,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)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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 */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,6 +20,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"
 | 
				
			||||||
| 
						 | 
					@ -186,11 +188,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;
 | 
				
			||||||
| 
						 | 
					@ -202,7 +204,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;
 | 
				
			||||||
| 
						 | 
					@ -219,7 +221,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];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -50,13 +50,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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -60,7 +60,7 @@ xnestFindWindowMatch(WindowPtr pWin, void *ptr)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WindowPtr
 | 
					WindowPtr
 | 
				
			||||||
xnestWindowPtr(Window window)
 | 
					xnestWindowPtr(xcb_window_t window)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    xnestWindowMatch wm;
 | 
					    xnestWindowMatch wm;
 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue