summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2013-03-30 19:44:45 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2013-04-08 14:17:15 +0100
commit2f5419211350bbb4a00abcdf7e3f6b4bda054825 (patch)
treecbb8fa2bbb7f93f57298feae557b5522e930b501
parent352e39d3b6e4e4d5512dc746b63428905e043ce1 (diff)
Work-around problems with using Xlib client macros in the server in a 64-bit build.
sizeof(XID) is always 4 in the server, but is 8 in a 64-bit client and coverted to a 32-bit protocol value (it's 4 in a 32-bit client) (See the _XSERVER64 define) This affects the size of members of the _XPrivDisplay type used by some macros in Xlib.h and so means those macros will not give correct answers when we try to use them in server code. Switch to using the equivalent functions, which work correctly, as the code in libX11 is not affected by the types used in the server. A better solution would be to xcb-ize all this code, which also avoids server/client namespace and header clashes.
-rw-r--r--hw/xwin/winclipboardthread.c10
-rw-r--r--hw/xwin/winclipboardwndproc.c2
-rw-r--r--hw/xwin/winmultiwindowwm.c8
3 files changed, 10 insertions, 10 deletions
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index e50ce9fd4..41d281ac6 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -187,7 +187,7 @@ winClipboardProc(void *pvNotUsed)
"successfully opened the display.\n");
/* Get our connection number */
- iConnectionNumber = ConnectionNumber(pDisplay);
+ iConnectionNumber = XConnectionNumber(pDisplay);
#ifdef HAS_DEVWINDOWS
/* Open a file descriptor for the windows message queue */
@@ -209,12 +209,12 @@ winClipboardProc(void *pvNotUsed)
/* Create a messaging window */
iWindow = XCreateSimpleWindow(pDisplay,
- DefaultRootWindow(pDisplay),
+ XDefaultRootWindow(pDisplay),
1, 1,
500, 500,
0,
- BlackPixel(pDisplay, 0),
- BlackPixel(pDisplay, 0));
+ XBlackPixel(pDisplay, 0),
+ XBlackPixel(pDisplay, 0));
if (iWindow == 0) {
ErrorF("winClipboardProc - Could not create an X window.\n");
goto winClipboardProc_Done;
@@ -407,7 +407,7 @@ winClipboardProc(void *pvNotUsed)
XSync(pDisplay, TRUE);
/* Select event types to watch */
- XSelectInput(pDisplay, DefaultRootWindow(pDisplay), None);
+ XSelectInput(pDisplay, XDefaultRootWindow(pDisplay), None);
/* Close our X display */
if (pDisplay) {
diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
index 49434f73d..f2746626d 100644
--- a/hw/xwin/winclipboardwndproc.c
+++ b/hw/xwin/winclipboardwndproc.c
@@ -84,7 +84,7 @@ winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay,
iTimeoutSec);
/* Get our connection number */
- iConnNumber = ConnectionNumber(pDisplay);
+ iConnNumber = XConnectionNumber(pDisplay);
/* Loop for X events */
while (1) {
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index da9a0ec37..b57b814ab 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -1079,7 +1079,7 @@ winMultiWindowXMsgProc(void *pArg)
xis->max_width = xis->max_height = 48;
xis->width_inc = xis->height_inc = 16;
XSetIconSizes(pProcArg->pDisplay,
- RootWindow(pProcArg->pDisplay, pProcArg->dwScreen),
+ XRootWindow(pProcArg->pDisplay, pProcArg->dwScreen),
xis, 1);
XFree(xis);
}
@@ -1459,7 +1459,7 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
if (cursor) {
XDefineCursor(pWMInfo->pDisplay,
- DefaultRootWindow(pWMInfo->pDisplay), cursor);
+ XDefaultRootWindow(pWMInfo->pDisplay), cursor);
XFreeCursor(pWMInfo->pDisplay, cursor);
}
}
@@ -1603,7 +1603,7 @@ CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen,
*/
redirectError = FALSE;
XSetErrorHandler(winRedirectErrorHandler);
- XSelectInput(pDisplay, RootWindow(pDisplay, dwScreen),
+ XSelectInput(pDisplay, XRootWindow(pDisplay, dwScreen),
ResizeRedirectMask | SubstructureRedirectMask |
ButtonPressMask);
XSync(pDisplay, 0);
@@ -1615,7 +1615,7 @@ CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen,
If other WMs are not allowed, also select one of the events which only one client
at a time is allowed to select, so other window managers won't start...
*/
- XSelectInput(pDisplay, RootWindow(pDisplay, dwScreen),
+ XSelectInput(pDisplay, XRootWindow(pDisplay, dwScreen),
SubstructureNotifyMask | (!fAllowOtherWM ? ButtonPressMask :
0));
XSync(pDisplay, 0);