xserver: Branch 'master' - 16 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Sep 9 15:15:26 PDT 2013


 Makefile.am                     |    2 
 configure.ac                    |    1 
 hw/xquartz/Makefile.am          |    4 
 hw/xquartz/pseudoramiX.c        |  516 ----------------------------------------
 hw/xquartz/pseudoramiX.h        |   10 
 hw/xwin/InitInput.c             |    1 
 hw/xwin/InitOutput.c            |    4 
 hw/xwin/Makefile.am             |    1 
 hw/xwin/winauth.c               |    7 
 hw/xwin/winclipboard.h          |    3 
 hw/xwin/winclipboardwndproc.c   |   11 
 hw/xwin/winclipboardwrappers.c  |    2 
 hw/xwin/wincursor.c             |   43 +--
 hw/xwin/winglobals.c            |    1 
 hw/xwin/winglobals.h            |    3 
 hw/xwin/winmultiwindowwm.c      |   20 -
 hw/xwin/winmultiwindowwndproc.c |    8 
 hw/xwin/winprefs.c              |   22 -
 hw/xwin/winprefs.h              |    8 
 hw/xwin/winsetsp.c              |   52 ++--
 hw/xwin/wintrayicon.c           |    2 
 pseudoramiX/Makefile.am         |    7 
 pseudoramiX/pseudoramiX.c       |  516 ++++++++++++++++++++++++++++++++++++++++
 pseudoramiX/pseudoramiX.h       |   10 
 24 files changed, 623 insertions(+), 631 deletions(-)

New commits:
commit 47ff382d1fce25a8b097d45b79489e891f1f1228
Merge: 6f89ae3 3752a81
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Sep 9 15:13:42 2013 -0700

    Merge remote-tracking branch 'jturney/master'

commit 3752a815800626ae93f64a856f5889aa6636344e
Author: Marc Haesen <marha at users.sourceforge.net>
Date:   Sat Aug 10 17:38:38 2013 +0100

    hw/xwin: Remove unnecessary and incorrect HWND casts
    
    Signed-off-by: Marc Haesen <marha at users.sourceforge.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 6851368..1dd8ba5 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -1061,15 +1061,13 @@ winMultiWindowXMsgProc(void *pArg)
                 (pProcArg->pDisplay, pProcArg->dwScreen, TRUE)) {
                 if (!g_fAnotherWMRunning) {
                     g_fAnotherWMRunning = TRUE;
-                    SendMessage(*(HWND *) pProcArg->hwndScreen, WM_UNMANAGE, 0,
-                                0);
+                    SendMessage(pProcArg->hwndScreen, WM_UNMANAGE, 0, 0);
                 }
             }
             else {
                 if (g_fAnotherWMRunning) {
                     g_fAnotherWMRunning = FALSE;
-                    SendMessage(*(HWND *) pProcArg->hwndScreen, WM_MANAGE, 0,
-                                0);
+                    SendMessage(pProcArg->hwndScreen, WM_MANAGE, 0, 0);
                 }
             }
             Sleep(500);
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index a888f08..abb87ee 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -825,7 +825,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         }
         /* Prevent the mouse wheel from stalling when another window is minimized */
         if (HIWORD(wParam) == 0 && LOWORD(wParam) == WA_ACTIVE &&
-            (HWND) lParam != NULL && (HWND) lParam != (HWND) GetParent(hwnd))
+            (HWND) lParam != NULL && (HWND) lParam != GetParent(hwnd))
             SetFocus(hwnd);
         return 0;
 
commit 34932cef6cc800fbdf2f375506057ed8cd1e07f6
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Apr 1 13:43:00 2013 +0100

    hw/xwin: Fix compilation of winauth.c with -Werror=implicit-function-declaration
    
    /jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c: In function ‘MitGenerateCookie’:
    /jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c:87:5: error: implicit declaration of function ‘MitAddCookie’ [-Werror=implicit-function-declaration]
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c
index 25d1fbd..a6a7366 100644
--- a/hw/xwin/winauth.c
+++ b/hw/xwin/winauth.c
@@ -36,6 +36,7 @@
 
 /* Includes for authorization */
 #include "securitysrv.h"
+#include "os/osdep.h"
 
 /*
  * Constants
@@ -56,8 +57,7 @@ static char *g_pAuthData = NULL;
  */
 
 #ifndef XCSECURITY
-static
-    void
+void
 GenerateRandomData(int len, char *buf)
 {
     int fd;
@@ -70,9 +70,8 @@ GenerateRandomData(int len, char *buf)
 static char cookie[16];         /* 128 bits */
 
 XID
-    static
 MitGenerateCookie(unsigned data_length,
-                  char *data,
+                  const char *data,
                   XID id, unsigned *data_length_return, char **data_return)
 {
     int i = 0;
commit 2a08554a0bf80b862c15676c31ecd463b616518c
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jun 17 23:54:01 2013 +0100

    hw/xwin: Remove unused extern g_fUseUnicode from winclipboardwndproc.c
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
index 32712aa..90dc9e0 100644
--- a/hw/xwin/winclipboardwndproc.c
+++ b/hw/xwin/winclipboardwndproc.c
@@ -48,7 +48,6 @@
  * References to external symbols
  */
 
-extern Bool g_fUseUnicode;
 extern void *g_pClipboardDisplay;
 extern Window g_iClipboardWindow;
 extern Atom g_atomLastOwnedSelection;
commit 69401f38a697c941ea58351028f4cd4b810f9188
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jun 17 18:37:26 2013 +0100

    hw/xwin: Remove unneeded forward declaration of winProcessXEventsTimeout()
    
    Remove unneeded forward declaration of winProcessXEventsTimeout(), the actual
    definition immediately follows.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
index e19f678..32712aa 100644
--- a/hw/xwin/winclipboardwndproc.c
+++ b/hw/xwin/winclipboardwndproc.c
@@ -53,16 +53,6 @@ extern void *g_pClipboardDisplay;
 extern Window g_iClipboardWindow;
 extern Atom g_atomLastOwnedSelection;
 
-/* 
- * Local function prototypes
- */
-
-static int
-
-
-winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay,
-                         Bool fUseUnicode, int iTimeoutSec);
-
 /*
  * Process X events up to specified timeout
  */
commit 9c45a1ad44f12ac25e1c3b7a18a3bceb85a2cf38
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jun 17 16:58:47 2013 +0100

    hw/xwin: Remove prototype for non-existent winDeinitClipboard()
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h
index aa7fd44..cb77695 100644
--- a/hw/xwin/winclipboard.h
+++ b/hw/xwin/winclipboard.h
@@ -106,9 +106,6 @@ void
 
 void *winClipboardProc(void *);
 
-void
- winDeinitClipboard(void);
-
 /*
  * winclipboardwndproc.c
  */
commit acc46fc217352b94f77a6b5b14808ea89875a2a1
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jun 17 00:40:13 2013 +0100

    hw/xwin: Remove unused externs from winclipboardwrappers.c
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/winclipboardwrappers.c b/hw/xwin/winclipboardwrappers.c
index 008088b..bfd6bff 100644
--- a/hw/xwin/winclipboardwrappers.c
+++ b/hw/xwin/winclipboardwrappers.c
@@ -56,8 +56,6 @@ DISPATCH_PROC(winProcSetSelectionOwner);
  * References to external symbols
  */
 
-extern unsigned int g_uiAuthDataLen;
-extern char *g_pAuthData;
 extern Bool g_fClipboardLaunched;
 extern Bool g_fClipboardStarted;
 extern Bool g_fClipboard;
commit fcc7767f8cd6c318861b1060ef6a3936750a0dd2
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jun 10 17:31:12 2013 +0100

    hw/xwin: Remove unused winProcQueryTreeOrig variable
    
    Unused since 47c7b6d3e626497747ae2780f259a15b8e6c846f "Remove no-longer needed
    tricks used to prevent the clipboard client from being killed"
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index 395b533..36346b7 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -39,7 +39,6 @@
 
 #ifdef XWIN_CLIPBOARD
 int winProcEstablishConnection(ClientPtr /* client */ );
-int winProcQueryTree(ClientPtr /* client */ );
 int winProcSetSelectionOwner(ClientPtr /* client */ );
 #endif
 
diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c
index b3ca295..d281322 100644
--- a/hw/xwin/winglobals.c
+++ b/hw/xwin/winglobals.c
@@ -85,7 +85,6 @@ pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER;
  * Wrapped DIX functions
  */
 winDispatchProcPtr winProcEstablishConnectionOrig = NULL;
-winDispatchProcPtr winProcQueryTreeOrig = NULL;
 winDispatchProcPtr winProcSetSelectionOwnerOrig = NULL;
 
 /*
diff --git a/hw/xwin/winglobals.h b/hw/xwin/winglobals.h
index 4faba9e..58a919c 100644
--- a/hw/xwin/winglobals.h
+++ b/hw/xwin/winglobals.h
@@ -71,7 +71,6 @@ typedef int (*winDispatchProcPtr) (ClientPtr);
  * Wrapped DIX functions
  */
 extern winDispatchProcPtr winProcEstablishConnectionOrig;
-extern winDispatchProcPtr winProcQueryTreeOrig;
 extern winDispatchProcPtr winProcSetSelectionOwnerOrig;
 #endif
 
commit 8fa882a980abea6f05b4b59447a187aea2c793a1
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Aug 10 12:41:07 2013 +0100

    hw/xwin: Fix ARGB cursor conversion on x86_64
    
    Fix erroneous use of unsigned long * for lpBits in winXCursorToHCURSOR() which
    leads to ARGB cursors being vertically streched on x86_64 by interleaving blank
    rows of pixels.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index 285e1bc..a35336a 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -162,7 +162,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
     HDC hDC;
     BITMAPV4HEADER bi;
     BITMAPINFO *pbmi;
-    unsigned long *lpBits;
+    uint32_t *lpBits;
 
     WIN_DEBUG_MSG("winLoadCursor: Win32: %dx%d X11: %dx%d hotspot: %d,%d\n",
                   pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy,
@@ -256,15 +256,14 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
         bi.bV4AlphaMask = 0xFF000000;
 
         lpBits =
-            (unsigned long *) calloc(pScreenPriv->cursor.sm_cx *
-                                     pScreenPriv->cursor.sm_cy,
-                                     sizeof(unsigned long));
+            (uint32_t *) calloc(pScreenPriv->cursor.sm_cx *
+                                pScreenPriv->cursor.sm_cy,
+                                sizeof(uint32_t));
 
         if (lpBits) {
             int y;
             for (y = 0; y < nCY; y++) {
-                unsigned long *src, *dst;
-
+                void *src, *dst;
                 src = &(pCursor->bits->argb[y * pCursor->bits->width]);
                 dst = &(lpBits[y * pScreenPriv->cursor.sm_cx]);
                 memcpy(dst, src, 4 * nCX);
@@ -304,8 +303,8 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
         pbmiColors[2].rgbReserved = 0;
 
         lpBits =
-            (unsigned long *) calloc(pScreenPriv->cursor.sm_cx *
-                                     pScreenPriv->cursor.sm_cy, sizeof(char));
+            (uint32_t *) calloc(pScreenPriv->cursor.sm_cx *
+                                pScreenPriv->cursor.sm_cy, sizeof(char));
 
         pCur = (unsigned char *) lpBits;
         if (lpBits) {
commit 4bfb2dce5eea4923eaf86eca33b96087b28235f5
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Apr 7 23:59:44 2013 +0100

    hw/xwin: Fix an issue in winSetSpansNativeGDI() identifed by -Warray-bounds
    
    The BITMAPINFO local only has room for a single RBGQUAD in bmiColors, but we
    access two (black and white for a mono-color DIB).  Fix by changing to a dynamic
    allocation big enough for a BITMAPINFO and a RGBQUAD.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/winsetsp.c b/hw/xwin/winsetsp.c
index f102f9f..11108cb 100644
--- a/hw/xwin/winsetsp.c
+++ b/hw/xwin/winsetsp.c
@@ -46,7 +46,7 @@ winSetSpansNativeGDI(DrawablePtr pDrawable,
     PixmapPtr pPixmap = NULL;
     winPrivPixmapPtr pPixmapPriv = NULL;
     HBITMAP hbmpOrig = NULL;
-    BITMAPINFO bmi;
+    BITMAPINFO *pbmi;
     HRGN hrgn = NULL, combined = NULL;
     int nbox;
     BoxPtr pbox;
@@ -57,6 +57,8 @@ winSetSpansNativeGDI(DrawablePtr pDrawable,
     if (!nbox)
         return;
 
+    pbmi = malloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD));
+
     combined = CreateRectRgn(pbox->x1, pbox->y1, pbox->x2, pbox->y2);
     nbox--;
     pbox++;
@@ -86,19 +88,20 @@ winSetSpansNativeGDI(DrawablePtr pDrawable,
                        "failed on pPixmapPriv->hBitmap\n");
 
         while (iSpans--) {
-            ZeroMemory(&bmi, sizeof(BITMAPINFO));
-            bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-            bmi.bmiHeader.biWidth = *piWidths;
-            bmi.bmiHeader.biHeight = 1;
-            bmi.bmiHeader.biPlanes = 1;
-            bmi.bmiHeader.biBitCount = pDrawable->depth;
-            bmi.bmiHeader.biCompression = BI_RGB;
+            ZeroMemory(pbmi, sizeof(BITMAPINFO));
+            pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+            pbmi->bmiHeader.biWidth = *piWidths;
+            pbmi->bmiHeader.biHeight = 1;
+            pbmi->bmiHeader.biPlanes = 1;
+            pbmi->bmiHeader.biBitCount = pDrawable->depth;
+            pbmi->bmiHeader.biCompression = BI_RGB;
 
             /* Setup color table for mono DIBs */
             if (pDrawable->depth == 1) {
-                bmi.bmiColors[1].rgbBlue = 255;
-                bmi.bmiColors[1].rgbGreen = 255;
-                bmi.bmiColors[1].rgbRed = 255;
+                RGBQUAD *bmiColors = &(pbmi->bmiColors[0]);
+                bmiColors[1].rgbBlue = 255;
+                bmiColors[1].rgbGreen = 255;
+                bmiColors[1].rgbRed = 255;
             }
 
             StretchDIBits(pGCPriv->hdcMem,
@@ -107,7 +110,7 @@ winSetSpansNativeGDI(DrawablePtr pDrawable,
                           0, 0,
                           *piWidths, 1,
                           pSrcs,
-                          (BITMAPINFO *) &bmi,
+                          (BITMAPINFO *) pbmi,
                           DIB_RGB_COLORS, g_copyROP[pGC->alu]);
 
             pSrcs += PixmapBytePad(*piWidths, pDrawable->depth);
@@ -129,19 +132,20 @@ winSetSpansNativeGDI(DrawablePtr pDrawable,
         combined = NULL;
 
         while (iSpans--) {
-            ZeroMemory(&bmi, sizeof(BITMAPINFO));
-            bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-            bmi.bmiHeader.biWidth = *piWidths;
-            bmi.bmiHeader.biHeight = 1;
-            bmi.bmiHeader.biPlanes = 1;
-            bmi.bmiHeader.biBitCount = pDrawable->depth;
-            bmi.bmiHeader.biCompression = BI_RGB;
+            ZeroMemory(pbmi, sizeof(BITMAPINFO));
+            pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+            pbmi->bmiHeader.biWidth = *piWidths;
+            pbmi->bmiHeader.biHeight = 1;
+            pbmi->bmiHeader.biPlanes = 1;
+            pbmi->bmiHeader.biBitCount = pDrawable->depth;
+            pbmi->bmiHeader.biCompression = BI_RGB;
 
             /* Setup color table for mono DIBs */
             if (pDrawable->depth == 1) {
-                bmi.bmiColors[1].rgbBlue = 255;
-                bmi.bmiColors[1].rgbGreen = 255;
-                bmi.bmiColors[1].rgbRed = 255;
+                RGBQUAD *bmiColors = &(pbmi->bmiColors[0]);
+                bmiColors[1].rgbBlue = 255;
+                bmiColors[1].rgbGreen = 255;
+                bmiColors[1].rgbRed = 255;
             }
 
             StretchDIBits(pGCPriv->hdc,
@@ -150,7 +154,7 @@ winSetSpansNativeGDI(DrawablePtr pDrawable,
                           0, 0,
                           *piWidths, 1,
                           pSrcs,
-                          (BITMAPINFO *) &bmi,
+                          (BITMAPINFO *) pbmi,
                           DIB_RGB_COLORS, g_copyROP[pGC->alu]);
 
             pSrcs += PixmapBytePad(*piWidths, pDrawable->depth);
@@ -166,4 +170,6 @@ winSetSpansNativeGDI(DrawablePtr pDrawable,
         FatalError("\nwinSetSpansNativeGDI - Unknown drawable type\n\n");
         break;
     }
+
+    free(pbmi);
 }
commit 784c006adb22c6693ad30dd0b1b05369cfaa7b5e
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Aug 10 11:55:23 2013 +0100

    hw/xwin: Fix -Warray-bounds warning in winXCursorToHCURSOR()
    
    Rewrite winXCursorToHCURSOR() so access to BITMAPINFO bmiColors member doesn't
    trigger an -Warray-bounds warning.
    
    Note that the underlying storage is allocated as a BITMAPV4HEADER, so has
    sufficent room for the extra RGBQUADs bmiColors after the BITMAPINFO bmiHeader.
    
    wincursor.c: In function 'winSetCursor':
    wincursor.c:293:24: error: array subscript is above array bounds [-Werror=array-bounds]
    wincursor.c:294:24: error: array subscript is above array bounds [-Werror=array-bounds]
    wincursor.c:295:24: error: array subscript is above array bounds [-Werror=array-bounds]
    wincursor.c:296:24: error: array subscript is above array bounds [-Werror=array-bounds]
    wincursor.c:297:24: error: array subscript is above array bounds [-Werror=array-bounds]
    wincursor.c:298:24: error: array subscript is above array bounds [-Werror=array-bounds]
    wincursor.c:299:24: error: array subscript is above array bounds [-Werror=array-bounds]
    wincursor.c:300:24: error: array subscript is above array bounds [-Werror=array-bounds]
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index 2962d06..285e1bc 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -273,9 +273,12 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
     }                           /* End if-truecolor-icon */
 
     if (!lpBits) {
+        RGBQUAD *pbmiColors;
         /* Bicolor, use a palettized DIB */
         WIN_DEBUG_MSG("winLoadCursor: Trying two color cursor\n");
         pbmi = (BITMAPINFO *) &bi;
+        pbmiColors = &(pbmi->bmiColors[0]);
+
         memset(pbmi, 0, sizeof(BITMAPINFOHEADER));
         pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
         pbmi->bmiHeader.biWidth = pScreenPriv->cursor.sm_cx;
@@ -286,18 +289,19 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
         pbmi->bmiHeader.biSizeImage = 0;
         pbmi->bmiHeader.biClrUsed = 3;
         pbmi->bmiHeader.biClrImportant = 3;
-        pbmi->bmiColors[0].rgbRed = 0;  /* Empty */
-        pbmi->bmiColors[0].rgbGreen = 0;
-        pbmi->bmiColors[0].rgbBlue = 0;
-        pbmi->bmiColors[0].rgbReserved = 0;
-        pbmi->bmiColors[1].rgbRed = pCursor->backRed >> 8;      /* Background */
-        pbmi->bmiColors[1].rgbGreen = pCursor->backGreen >> 8;
-        pbmi->bmiColors[1].rgbBlue = pCursor->backBlue >> 8;
-        pbmi->bmiColors[1].rgbReserved = 0;
-        pbmi->bmiColors[2].rgbRed = pCursor->foreRed >> 8;      /* Foreground */
-        pbmi->bmiColors[2].rgbGreen = pCursor->foreGreen >> 8;
-        pbmi->bmiColors[2].rgbBlue = pCursor->foreBlue >> 8;
-        pbmi->bmiColors[2].rgbReserved = 0;
+
+        pbmiColors[0].rgbRed = 0;  /* Empty */
+        pbmiColors[0].rgbGreen = 0;
+        pbmiColors[0].rgbBlue = 0;
+        pbmiColors[0].rgbReserved = 0;
+        pbmiColors[1].rgbRed = pCursor->backRed >> 8;      /* Background */
+        pbmiColors[1].rgbGreen = pCursor->backGreen >> 8;
+        pbmiColors[1].rgbBlue = pCursor->backBlue >> 8;
+        pbmiColors[1].rgbReserved = 0;
+        pbmiColors[2].rgbRed = pCursor->foreRed >> 8;      /* Foreground */
+        pbmiColors[2].rgbGreen = pCursor->foreGreen >> 8;
+        pbmiColors[2].rgbBlue = pCursor->foreBlue >> 8;
+        pbmiColors[2].rgbReserved = 0;
 
         lpBits =
             (unsigned long *) calloc(pScreenPriv->cursor.sm_cx *
commit 41d03c9ccce665b919b180bbb819b78c750aa325
Author: Marc Haesen <marha at users.sourceforge.net>
Date:   Fri Aug 2 18:19:22 2013 +0100

    hw/xwin: Correct size of _WINDOWSWM_NATIVE_HWND property on x86_64
    
    Use the correct size of a HWND on x86_64 in XChangeProperty() and
    XGetWindowProperty() calls for the _WINDOWSWM_NATIVE_HWND property.
    
    Signed-off-by: Marc Haesen <marha at users.sourceforge.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 3c44f05..6851368 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -488,7 +488,7 @@ getHwnd(WMInfoPtr pWMInfo, Window iWindow)
                            iWindow,
                            pWMInfo->atmPrivMap,
                            0,
-                           1,
+                           sizeof(HWND)/4,
                            False,
                            XA_INTEGER,
                            &atmType,
@@ -747,10 +747,10 @@ winMultiWindowWMProc(void *pArg)
             ErrorF("\tWM_WM_MAP\n");
 #endif
             /* Put a note as to the HWND associated with this Window */
-            XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER,     //pWMInfo->atmPrivMap,
+            XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER,
                             32,
                             PropModeReplace,
-                            (unsigned char *) &(pNode->msg.hwndWindow), 1);
+                            (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4);
             UpdateName(pWMInfo, pNode->msg.iWindow);
             UpdateIcon(pWMInfo, pNode->msg.iWindow);
             break;
@@ -759,10 +759,10 @@ winMultiWindowWMProc(void *pArg)
 #if CYGMULTIWINDOW_DEBUG
             ErrorF("\tWM_WM_MAP2\n");
 #endif
-            XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER,     //pWMInfo->atmPrivMap,
+            XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER,
                             32,
                             PropModeReplace,
-                            (unsigned char *) &(pNode->msg.hwndWindow), 1);
+                            (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4);
             break;
 
         case WM_WM_MAP3:
@@ -770,10 +770,10 @@ winMultiWindowWMProc(void *pArg)
             ErrorF("\tWM_WM_MAP3\n");
 #endif
             /* Put a note as to the HWND associated with this Window */
-            XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER,     //pWMInfo->atmPrivMap,
+            XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER,
                             32,
                             PropModeReplace,
-                            (unsigned char *) &(pNode->msg.hwndWindow), 1);
+                            (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4);
             UpdateName(pWMInfo, pNode->msg.iWindow);
             UpdateIcon(pWMInfo, pNode->msg.iWindow);
             UpdateStyle(pWMInfo, pNode->msg.iWindow);
commit 390cfec10ef7d52391f890c7593ac82a7d77d856
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Aug 9 16:48:12 2013 +0100

    hw/xwin: Correct winprefs.c function signatures for x64.
    
    Correct SetupRootMenu(), SetupSysMenu(), HandleCustomWM_INITMENU() and
    HandleCustomWM_COMMAND() function signatures which use unsigned long parameters,
    where just a specific HWND or HMENU handle type should have been used.
    
    Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 9292e73..a888f08 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -420,14 +420,14 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         /*
          * Add whatever the setup file wants to for this window
          */
-        SetupSysMenu((unsigned long) hwnd);
+        SetupSysMenu(hwnd);
         return 0;
 
     case WM_SYSCOMMAND:
         /*
          * Any window menu items go through here
          */
-        if (HandleCustomWM_COMMAND((unsigned long) hwnd, LOWORD(wParam))) {
+        if (HandleCustomWM_COMMAND(hwnd, LOWORD(wParam))) {
             /* Don't pass customized menus to DefWindowProc */
             return 0;
         }
@@ -443,7 +443,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
     case WM_INITMENU:
         /* Checks/Unchecks any menu items before they are displayed */
-        HandleCustomWM_INITMENU((unsigned long) hwnd, wParam);
+        HandleCustomWM_INITMENU(hwnd, (HMENU)wParam);
         break;
 
     case WM_ERASEBKGND:
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index 8936aae..f386fac 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -188,7 +188,7 @@ ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam)
         }
 
         /* Update the system menu for this window */
-        SetupSysMenu((unsigned long) hwnd);
+        SetupSysMenu(hwnd);
 
         /* That was easy... */
     }
@@ -275,15 +275,11 @@ ReloadPrefs(void)
  * Check/uncheck the ALWAYSONTOP items in this menu
  */
 void
-HandleCustomWM_INITMENU(unsigned long hwndIn, unsigned long hmenuIn)
+HandleCustomWM_INITMENU(HWND hwnd, HMENU hmenu)
 {
-    HWND hwnd;
-    HMENU hmenu;
     DWORD dwExStyle;
     int i, j;
 
-    hwnd = (HWND) hwndIn;
-    hmenu = (HMENU) hmenuIn;
     if (!hwnd || !hmenu)
         return;
 
@@ -305,15 +301,12 @@ HandleCustomWM_INITMENU(unsigned long hwndIn, unsigned long hmenuIn)
  * Return TRUE if command is proccessed, FALSE otherwise.
  */
 Bool
-HandleCustomWM_COMMAND(unsigned long hwndIn, int command)
+HandleCustomWM_COMMAND(HWND hwnd, int command)
 {
-    HWND hwnd;
     int i, j;
     MENUPARSED *m;
     DWORD dwExStyle;
 
-    hwnd = (HWND) hwndIn;
-
     if (!command)
         return FALSE;
 
@@ -412,15 +405,13 @@ HandleCustomWM_COMMAND(unsigned long hwndIn, int command)
  * Add the default or a custom menu depending on the class match
  */
 void
-SetupSysMenu(unsigned long hwndIn)
+SetupSysMenu(HWND hwnd)
 {
-    HWND hwnd;
     HMENU sys;
     int i;
     WindowPtr pWin;
     char *res_name, *res_class;
 
-    hwnd = (HWND) hwndIn;
     if (!hwnd)
         return;
 
@@ -465,11 +456,8 @@ SetupSysMenu(unsigned long hwndIn)
  * Possibly add a menu to the toolbar icon
  */
 void
-SetupRootMenu(unsigned long hmenuRoot)
+SetupRootMenu(HMENU root)
 {
-    HMENU root;
-
-    root = (HMENU) hmenuRoot;
     if (!root)
         return;
 
diff --git a/hw/xwin/winprefs.h b/hw/xwin/winprefs.h
index a4a6e7e..8f4eb08 100644
--- a/hw/xwin/winprefs.h
+++ b/hw/xwin/winprefs.h
@@ -150,16 +150,16 @@ void
  LoadPreferences(void);
 
 void
- SetupRootMenu(unsigned long hmenuRoot);
+ SetupRootMenu(HMENU root);
 
 void
- SetupSysMenu(unsigned long hwndIn);
+ SetupSysMenu(HWND hwnd);
 
 void
- HandleCustomWM_INITMENU(unsigned long hwndIn, unsigned long hmenuIn);
+ HandleCustomWM_INITMENU(HWND hwnd, HMENU hmenu);
 
 Bool
- HandleCustomWM_COMMAND(unsigned long hwndIn, int command);
+ HandleCustomWM_COMMAND(HWND hwnd, int command);
 
 int
  winIconIsOverride(HICON hicon);
diff --git a/hw/xwin/wintrayicon.c b/hw/xwin/wintrayicon.c
index f168b88..e0aa7e5 100644
--- a/hw/xwin/wintrayicon.c
+++ b/hw/xwin/wintrayicon.c
@@ -170,7 +170,7 @@ winHandleIconMessage(HWND hwnd, UINT message,
             RemoveMenu(hmenuTray, ID_APP_HIDE_ROOT, MF_BYCOMMAND);
         }
 
-        SetupRootMenu((unsigned long) hmenuTray);
+        SetupRootMenu(hmenuTray);
 
         /*
          * NOTE: This three-step procedure is required for
commit e716baedc4d8e52a60f43ef21aba771b340d8c8b
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Mar 31 14:42:45 2012 +0100

    Move pseudoramiX code where it can be shared between Xwin and Xquartz
    
    Move pseudoramiX code to a separate top-level directory.  Link Xwin and Xquartz
    with libPseudoramiX
    
    I'm not sure moving this to a top-level directory is appropriate, but I'm not
    sure where else it fits.
    
    Future work: pseudoramiX can probably be consolidated with the rrxinerama code
    (which I think provides fake xinerama data when real XINERAMA is disabled and we
    only have one screen)
    
    v2: fix distcheck
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/Makefile.am b/Makefile.am
index 9a62853..7be4271 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,6 +27,7 @@ SUBDIRS = \
 	Xext \
 	miext \
 	os \
+	pseudoramiX \
 	randr \
 	render  \
 	Xi \
@@ -77,6 +78,7 @@ DIST_SUBDIRS = \
 	Xext \
 	miext \
 	os \
+	pseudoramiX \
 	randr \
 	render  \
 	Xi \
diff --git a/configure.ac b/configure.ac
index d27ca23..225b70f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2256,6 +2256,7 @@ miext/damage/Makefile
 miext/shadow/Makefile
 miext/rootless/Makefile
 os/Makefile
+pseudoramiX/Makefile
 randr/Makefile
 render/Makefile
 xkb/Makefile
diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index a7cc012..2e894d7 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -28,7 +28,6 @@ libXquartz_la_SOURCES = \
 	darwinEvents.c \
 	darwinXinput.c \
 	keysym2ucs.c \
-	pseudoramiX.c \
 	quartz.c \
 	quartzCocoa.m \
 	quartzKeyboard.c \
@@ -36,6 +35,8 @@ libXquartz_la_SOURCES = \
 	quartzRandR.c \
 	console_redirect.c
 
+libXquartz_la_LIBADD = $(top_builddir)/pseudoramiX/libPseudoramiX.la
+
 EXTRA_DIST = \
 	X11Application.h \
 	X11Controller.h \
@@ -44,7 +45,6 @@ EXTRA_DIST = \
 	darwinfb.h \
 	darwinEvents.h \
 	keysym2ucs.h \
-	pseudoramiX.h \
 	quartz.h \
 	quartzCommon.h \
 	quartzKeyboard.h \
diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c
deleted file mode 100644
index 23dbc73..0000000
--- a/hw/xquartz/pseudoramiX.c
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * Minimal implementation of PanoramiX/Xinerama
- *
- * This is used in rootless mode where the underlying window server
- * already provides an abstracted view of multiple screens as one
- * large screen area.
- *
- * This code is largely based on panoramiX.c, which contains the
- * following copyright notice:
- */
-/*****************************************************************
-   Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
-   Permission is hereby granted, free of charge, to any person obtaining a copy
-   of this software and associated documentation files (the "Software"), to deal
-   in the Software without restriction, including without limitation the rights
-   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-   copies of the Software.
-
-   The above copyright notice and this permission notice shall be included in
-   all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-   DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
-   BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-   IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-   Except as contained in this notice, the name of Digital Equipment Corporation
-   shall not be used in advertising or otherwise to promote the sale, use or other
-   dealings in this Software without prior written authorization from Digital
-   Equipment Corporation.
- ******************************************************************/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "pseudoramiX.h"
-#include "extnsionst.h"
-#include "extinit.h"
-#include "dixstruct.h"
-#include "window.h"
-#include <X11/extensions/panoramiXproto.h>
-#include "globals.h"
-
-#define TRACE PseudoramiXTrace("TRACE " __FILE__ ":%s",__FUNCTION__)
-#define DEBUG_LOG PseudoramiXDebug
-
-Bool noPseudoramiXExtension = FALSE;
-
-extern int
-ProcPanoramiXQueryVersion(ClientPtr client);
-
-static void
-PseudoramiXResetProc(ExtensionEntry *extEntry);
-
-static int
-ProcPseudoramiXQueryVersion(ClientPtr client);
-static int
-ProcPseudoramiXGetState(ClientPtr client);
-static int
-ProcPseudoramiXGetScreenCount(ClientPtr client);
-static int
-ProcPseudoramiXGetScreenSize(ClientPtr client);
-static int
-ProcPseudoramiXIsActive(ClientPtr client);
-static int
-ProcPseudoramiXQueryScreens(ClientPtr client);
-static int
-ProcPseudoramiXDispatch(ClientPtr client);
-
-static int
-SProcPseudoramiXQueryVersion(ClientPtr client);
-static int
-SProcPseudoramiXGetState(ClientPtr client);
-static int
-SProcPseudoramiXGetScreenCount(ClientPtr client);
-static int
-SProcPseudoramiXGetScreenSize(ClientPtr client);
-static int
-SProcPseudoramiXIsActive(ClientPtr client);
-static int
-SProcPseudoramiXQueryScreens(ClientPtr client);
-static int
-SProcPseudoramiXDispatch(ClientPtr client);
-
-typedef struct {
-    int x;
-    int y;
-    int w;
-    int h;
-} PseudoramiXScreenRec;
-
-static PseudoramiXScreenRec *pseudoramiXScreens = NULL;
-static int pseudoramiXScreensAllocated = 0;
-static int pseudoramiXNumScreens = 0;
-static unsigned long pseudoramiXGeneration = 0;
-
-static void
-PseudoramiXTrace(const char *format, ...)
-{
-    va_list ap;
-
-    va_start(ap, format);
-    LogVMessageVerb(X_NONE, 10, format, ap);
-    va_end(ap);
-}
-
-static void
-PseudoramiXDebug(const char *format, ...)
-{
-    va_list ap;
-
-    va_start(ap, format);
-    LogVMessageVerb(X_NONE, 3, format, ap);
-    va_end(ap);
-}
-
-// Add a PseudoramiX screen.
-// The rest of the X server will know nothing about this screen.
-// Can be called before or after extension init.
-// Screens must be re-added once per generation.
-void
-PseudoramiXAddScreen(int x, int y, int w, int h)
-{
-    PseudoramiXScreenRec *s;
-
-    if (noPseudoramiXExtension) return;
-
-    if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) {
-        pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1;
-        pseudoramiXScreens = realloc(pseudoramiXScreens,
-                                     pseudoramiXScreensAllocated *
-                                     sizeof(PseudoramiXScreenRec));
-    }
-
-    DEBUG_LOG("x: %d, y: %d, w: %d, h: %d\n", x, y, w, h);
-
-    s = &pseudoramiXScreens[pseudoramiXNumScreens++];
-    s->x = x;
-    s->y = y;
-    s->w = w;
-    s->h = h;
-}
-
-// Initialize PseudoramiX.
-// Copied from PanoramiXExtensionInit
-void
-PseudoramiXExtensionInit(void)
-{
-    Bool success = FALSE;
-    ExtensionEntry      *extEntry;
-
-    if (noPseudoramiXExtension) return;
-
-    TRACE;
-
-    /* Even with only one screen we need to enable PseudoramiX to allow
-       dynamic screen configuration changes. */
-#if 0
-    if (pseudoramiXNumScreens == 1) {
-        // Only one screen - disable Xinerama extension.
-        noPseudoramiXExtension = TRUE;
-        return;
-    }
-#endif
-
-    if (pseudoramiXGeneration != serverGeneration) {
-        extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
-                                ProcPseudoramiXDispatch,
-                                SProcPseudoramiXDispatch,
-                                PseudoramiXResetProc,
-                                StandardMinorOpcode);
-        if (!extEntry) {
-            ErrorF("PseudoramiXExtensionInit(): AddExtension failed\n");
-        }
-        else {
-            pseudoramiXGeneration = serverGeneration;
-            success = TRUE;
-        }
-    }
-
-    if (!success) {
-        ErrorF("%s Extension (PseudoramiX) failed to initialize\n",
-               PANORAMIX_PROTOCOL_NAME);
-        return;
-    }
-}
-
-void
-PseudoramiXResetScreens(void)
-{
-    TRACE;
-
-    pseudoramiXNumScreens = 0;
-}
-
-static void
-PseudoramiXResetProc(ExtensionEntry *extEntry)
-{
-    TRACE;
-
-    PseudoramiXResetScreens();
-}
-
-// was PanoramiX
-static int
-ProcPseudoramiXQueryVersion(ClientPtr client)
-{
-    TRACE;
-
-    return ProcPanoramiXQueryVersion(client);
-}
-
-// was PanoramiX
-static int
-ProcPseudoramiXGetState(ClientPtr client)
-{
-    REQUEST(xPanoramiXGetStateReq);
-    WindowPtr pWin;
-    xPanoramiXGetStateReply rep;
-    register int rc;
-
-    TRACE;
-
-    REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
-    if (rc != Success)
-        return rc;
-
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.state = !noPseudoramiXExtension;
-    rep.window = stuff->window;
-    if (client->swapped) {
-        swaps(&rep.sequenceNumber);
-        swapl(&rep.length);
-        swapl(&rep.window);
-    }
-    WriteToClient(client, sizeof(xPanoramiXGetStateReply),&rep);
-    return Success;
-}
-
-// was PanoramiX
-static int
-ProcPseudoramiXGetScreenCount(ClientPtr client)
-{
-    REQUEST(xPanoramiXGetScreenCountReq);
-    WindowPtr pWin;
-    xPanoramiXGetScreenCountReply rep;
-    register int rc;
-
-    TRACE;
-
-    REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
-    if (rc != Success)
-        return rc;
-
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.ScreenCount = pseudoramiXNumScreens;
-    rep.window = stuff->window;
-    if (client->swapped) {
-        swaps(&rep.sequenceNumber);
-        swapl(&rep.length);
-        swapl(&rep.window);
-    }
-    WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply),&rep);
-    return Success;
-}
-
-// was PanoramiX
-static int
-ProcPseudoramiXGetScreenSize(ClientPtr client)
-{
-    REQUEST(xPanoramiXGetScreenSizeReq);
-    WindowPtr pWin;
-    xPanoramiXGetScreenSizeReply rep;
-    register int rc;
-
-    TRACE;
-
-    if (stuff->screen >= pseudoramiXNumScreens)
-      return BadMatch;
-
-    REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
-    if (rc != Success)
-        return rc;
-
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    /* screen dimensions */
-    rep.width = pseudoramiXScreens[stuff->screen].w;
-    // was screenInfo.screens[stuff->screen]->width;
-    rep.height = pseudoramiXScreens[stuff->screen].h;
-    // was screenInfo.screens[stuff->screen]->height;
-    rep.window = stuff->window;
-    rep.screen = stuff->screen;
-    if (client->swapped) {
-        swaps(&rep.sequenceNumber);
-        swapl(&rep.length);
-        swapl(&rep.width);
-        swapl(&rep.height);
-        swapl(&rep.window);
-        swapl(&rep.screen);
-    }
-    WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply),&rep);
-    return Success;
-}
-
-// was Xinerama
-static int
-ProcPseudoramiXIsActive(ClientPtr client)
-{
-    /* REQUEST(xXineramaIsActiveReq); */
-    xXineramaIsActiveReply rep;
-
-    TRACE;
-
-    REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
-
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.state = !noPseudoramiXExtension;
-    if (client->swapped) {
-        swaps(&rep.sequenceNumber);
-        swapl(&rep.length);
-        swapl(&rep.state);
-    }
-    WriteToClient(client, sizeof(xXineramaIsActiveReply),&rep);
-    return Success;
-}
-
-// was Xinerama
-static int
-ProcPseudoramiXQueryScreens(ClientPtr client)
-{
-    /* REQUEST(xXineramaQueryScreensReq); */
-    xXineramaQueryScreensReply rep;
-
-    DEBUG_LOG("noPseudoramiXExtension=%d, pseudoramiXNumScreens=%d\n",
-              noPseudoramiXExtension,
-              pseudoramiXNumScreens);
-
-    REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
-
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens;
-    rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
-    if (client->swapped) {
-        swaps(&rep.sequenceNumber);
-        swapl(&rep.length);
-        swapl(&rep.number);
-    }
-    WriteToClient(client, sizeof(xXineramaQueryScreensReply),&rep);
-
-    if (!noPseudoramiXExtension) {
-        xXineramaScreenInfo scratch;
-        int i;
-
-        for (i = 0; i < pseudoramiXNumScreens; i++) {
-            scratch.x_org = pseudoramiXScreens[i].x;
-            scratch.y_org = pseudoramiXScreens[i].y;
-            scratch.width = pseudoramiXScreens[i].w;
-            scratch.height = pseudoramiXScreens[i].h;
-
-            if (client->swapped) {
-                swaps(&scratch.x_org);
-                swaps(&scratch.y_org);
-                swaps(&scratch.width);
-                swaps(&scratch.height);
-            }
-            WriteToClient(client, sz_XineramaScreenInfo,&scratch);
-        }
-    }
-
-    return Success;
-}
-
-// was PanoramiX
-static int
-ProcPseudoramiXDispatch(ClientPtr client)
-{
-    REQUEST(xReq);
-    TRACE;
-    switch (stuff->data) {
-    case X_PanoramiXQueryVersion:
-        return ProcPseudoramiXQueryVersion(client);
-
-    case X_PanoramiXGetState:
-        return ProcPseudoramiXGetState(client);
-
-    case X_PanoramiXGetScreenCount:
-        return ProcPseudoramiXGetScreenCount(client);
-
-    case X_PanoramiXGetScreenSize:
-        return ProcPseudoramiXGetScreenSize(client);
-
-    case X_XineramaIsActive:
-        return ProcPseudoramiXIsActive(client);
-
-    case X_XineramaQueryScreens:
-        return ProcPseudoramiXQueryScreens(client);
-    }
-    return BadRequest;
-}
-
-static int
-SProcPseudoramiXQueryVersion(ClientPtr client)
-{
-    REQUEST(xPanoramiXQueryVersionReq);
-
-    TRACE;
-
-    swaps(&stuff->length);
-    REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
-    return ProcPseudoramiXQueryVersion(client);
-}
-
-static int
-SProcPseudoramiXGetState(ClientPtr client)
-{
-    REQUEST(xPanoramiXGetStateReq);
-
-    TRACE;
-
-    swaps(&stuff->length);
-    REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
-    return ProcPseudoramiXGetState(client);
-}
-
-static int
-SProcPseudoramiXGetScreenCount(ClientPtr client)
-{
-    REQUEST(xPanoramiXGetScreenCountReq);
-
-    TRACE;
-
-    swaps(&stuff->length);
-    REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
-    return ProcPseudoramiXGetScreenCount(client);
-}
-
-static int
-SProcPseudoramiXGetScreenSize(ClientPtr client)
-{
-    REQUEST(xPanoramiXGetScreenSizeReq);
-
-    TRACE;
-
-    swaps(&stuff->length);
-    REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
-    return ProcPseudoramiXGetScreenSize(client);
-}
-
-static int
-SProcPseudoramiXIsActive(ClientPtr client)
-{
-    REQUEST(xXineramaIsActiveReq);
-
-    TRACE;
-
-    swaps(&stuff->length);
-    REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
-    return ProcPseudoramiXIsActive(client);
-}
-
-static int
-SProcPseudoramiXQueryScreens(ClientPtr client)
-{
-    REQUEST(xXineramaQueryScreensReq);
-
-    TRACE;
-
-    swaps(&stuff->length);
-    REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
-    return ProcPseudoramiXQueryScreens(client);
-}
-
-static int
-SProcPseudoramiXDispatch(ClientPtr client)
-{
-    REQUEST(xReq);
-
-    TRACE;
-
-    switch (stuff->data) {
-    case X_PanoramiXQueryVersion:
-        return SProcPseudoramiXQueryVersion(client);
-
-    case X_PanoramiXGetState:
-        return SProcPseudoramiXGetState(client);
-
-    case X_PanoramiXGetScreenCount:
-        return SProcPseudoramiXGetScreenCount(client);
-
-    case X_PanoramiXGetScreenSize:
-        return SProcPseudoramiXGetScreenSize(client);
-
-    case X_XineramaIsActive:
-        return SProcPseudoramiXIsActive(client);
-
-    case X_XineramaQueryScreens:
-        return SProcPseudoramiXQueryScreens(client);
-    }
-    return BadRequest;
-}
diff --git a/hw/xquartz/pseudoramiX.h b/hw/xquartz/pseudoramiX.h
deleted file mode 100644
index f063919..0000000
--- a/hw/xquartz/pseudoramiX.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * Minimal implementation of PanoramiX/Xinerama
- */
-
-extern int noPseudoramiXExtension;
-
-void
-PseudoramiXAddScreen(int x, int y, int w, int h);
-void
-PseudoramiXResetScreens(void);
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 831e7dc..c700695 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -153,6 +153,7 @@ XWin_SOURCES = $(SRCS)
 AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless
 
 XWIN_SYS_LIBS += -ldxguid
+XWIN_LIBS += 	$(top_builddir)/pseudoramiX/libPseudoramiX.la
 
 XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS)
 XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS)
diff --git a/pseudoramiX/Makefile.am b/pseudoramiX/Makefile.am
new file mode 100644
index 0000000..17b664b
--- /dev/null
+++ b/pseudoramiX/Makefile.am
@@ -0,0 +1,7 @@
+# Fake Xinerama extension
+
+AM_CFLAGS = $(DIX_CFLAGS)
+
+noinst_LTLIBRARIES = libPseudoramiX.la
+
+libPseudoramiX_la_SOURCES = pseudoramiX.c pseudoramiX.h
diff --git a/pseudoramiX/pseudoramiX.c b/pseudoramiX/pseudoramiX.c
new file mode 100644
index 0000000..23dbc73
--- /dev/null
+++ b/pseudoramiX/pseudoramiX.c
@@ -0,0 +1,516 @@
+/*
+ * Minimal implementation of PanoramiX/Xinerama
+ *
+ * This is used in rootless mode where the underlying window server
+ * already provides an abstracted view of multiple screens as one
+ * large screen area.
+ *
+ * This code is largely based on panoramiX.c, which contains the
+ * following copyright notice:
+ */
+/*****************************************************************
+   Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
+   Permission is hereby granted, free of charge, to any person obtaining a copy
+   of this software and associated documentation files (the "Software"), to deal
+   in the Software without restriction, including without limitation the rights
+   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+   copies of the Software.
+
+   The above copyright notice and this permission notice shall be included in
+   all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+   DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+   BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
+   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+   IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+   Except as contained in this notice, the name of Digital Equipment Corporation
+   shall not be used in advertising or otherwise to promote the sale, use or other
+   dealings in this Software without prior written authorization from Digital
+   Equipment Corporation.
+ ******************************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "pseudoramiX.h"
+#include "extnsionst.h"
+#include "extinit.h"
+#include "dixstruct.h"
+#include "window.h"
+#include <X11/extensions/panoramiXproto.h>
+#include "globals.h"
+
+#define TRACE PseudoramiXTrace("TRACE " __FILE__ ":%s",__FUNCTION__)
+#define DEBUG_LOG PseudoramiXDebug
+
+Bool noPseudoramiXExtension = FALSE;
+
+extern int
+ProcPanoramiXQueryVersion(ClientPtr client);
+
+static void
+PseudoramiXResetProc(ExtensionEntry *extEntry);
+
+static int
+ProcPseudoramiXQueryVersion(ClientPtr client);
+static int
+ProcPseudoramiXGetState(ClientPtr client);
+static int
+ProcPseudoramiXGetScreenCount(ClientPtr client);
+static int
+ProcPseudoramiXGetScreenSize(ClientPtr client);
+static int
+ProcPseudoramiXIsActive(ClientPtr client);
+static int
+ProcPseudoramiXQueryScreens(ClientPtr client);
+static int
+ProcPseudoramiXDispatch(ClientPtr client);
+
+static int
+SProcPseudoramiXQueryVersion(ClientPtr client);
+static int
+SProcPseudoramiXGetState(ClientPtr client);
+static int
+SProcPseudoramiXGetScreenCount(ClientPtr client);
+static int
+SProcPseudoramiXGetScreenSize(ClientPtr client);
+static int
+SProcPseudoramiXIsActive(ClientPtr client);
+static int
+SProcPseudoramiXQueryScreens(ClientPtr client);
+static int
+SProcPseudoramiXDispatch(ClientPtr client);
+
+typedef struct {
+    int x;
+    int y;
+    int w;
+    int h;
+} PseudoramiXScreenRec;
+
+static PseudoramiXScreenRec *pseudoramiXScreens = NULL;
+static int pseudoramiXScreensAllocated = 0;
+static int pseudoramiXNumScreens = 0;
+static unsigned long pseudoramiXGeneration = 0;
+
+static void
+PseudoramiXTrace(const char *format, ...)
+{
+    va_list ap;
+
+    va_start(ap, format);
+    LogVMessageVerb(X_NONE, 10, format, ap);
+    va_end(ap);
+}
+
+static void
+PseudoramiXDebug(const char *format, ...)
+{
+    va_list ap;
+
+    va_start(ap, format);
+    LogVMessageVerb(X_NONE, 3, format, ap);
+    va_end(ap);
+}
+
+// Add a PseudoramiX screen.
+// The rest of the X server will know nothing about this screen.
+// Can be called before or after extension init.
+// Screens must be re-added once per generation.
+void
+PseudoramiXAddScreen(int x, int y, int w, int h)
+{
+    PseudoramiXScreenRec *s;
+
+    if (noPseudoramiXExtension) return;
+
+    if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) {
+        pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1;
+        pseudoramiXScreens = realloc(pseudoramiXScreens,
+                                     pseudoramiXScreensAllocated *
+                                     sizeof(PseudoramiXScreenRec));
+    }
+
+    DEBUG_LOG("x: %d, y: %d, w: %d, h: %d\n", x, y, w, h);
+
+    s = &pseudoramiXScreens[pseudoramiXNumScreens++];
+    s->x = x;
+    s->y = y;
+    s->w = w;
+    s->h = h;
+}
+
+// Initialize PseudoramiX.
+// Copied from PanoramiXExtensionInit
+void
+PseudoramiXExtensionInit(void)
+{
+    Bool success = FALSE;
+    ExtensionEntry      *extEntry;
+
+    if (noPseudoramiXExtension) return;
+
+    TRACE;
+
+    /* Even with only one screen we need to enable PseudoramiX to allow
+       dynamic screen configuration changes. */
+#if 0
+    if (pseudoramiXNumScreens == 1) {
+        // Only one screen - disable Xinerama extension.
+        noPseudoramiXExtension = TRUE;
+        return;
+    }
+#endif
+
+    if (pseudoramiXGeneration != serverGeneration) {
+        extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
+                                ProcPseudoramiXDispatch,
+                                SProcPseudoramiXDispatch,
+                                PseudoramiXResetProc,
+                                StandardMinorOpcode);
+        if (!extEntry) {
+            ErrorF("PseudoramiXExtensionInit(): AddExtension failed\n");
+        }
+        else {
+            pseudoramiXGeneration = serverGeneration;
+            success = TRUE;
+        }
+    }
+
+    if (!success) {
+        ErrorF("%s Extension (PseudoramiX) failed to initialize\n",
+               PANORAMIX_PROTOCOL_NAME);
+        return;
+    }
+}
+
+void
+PseudoramiXResetScreens(void)
+{
+    TRACE;
+
+    pseudoramiXNumScreens = 0;
+}
+
+static void
+PseudoramiXResetProc(ExtensionEntry *extEntry)
+{
+    TRACE;
+
+    PseudoramiXResetScreens();
+}
+
+// was PanoramiX
+static int
+ProcPseudoramiXQueryVersion(ClientPtr client)
+{
+    TRACE;
+
+    return ProcPanoramiXQueryVersion(client);
+}
+
+// was PanoramiX
+static int
+ProcPseudoramiXGetState(ClientPtr client)
+{
+    REQUEST(xPanoramiXGetStateReq);
+    WindowPtr pWin;
+    xPanoramiXGetStateReply rep;
+    register int rc;
+
+    TRACE;
+
+    REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+    if (rc != Success)
+        return rc;
+
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+    rep.state = !noPseudoramiXExtension;
+    rep.window = stuff->window;
+    if (client->swapped) {
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.window);
+    }
+    WriteToClient(client, sizeof(xPanoramiXGetStateReply),&rep);
+    return Success;
+}
+
+// was PanoramiX
+static int
+ProcPseudoramiXGetScreenCount(ClientPtr client)
+{
+    REQUEST(xPanoramiXGetScreenCountReq);
+    WindowPtr pWin;
+    xPanoramiXGetScreenCountReply rep;
+    register int rc;
+
+    TRACE;
+
+    REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+    if (rc != Success)
+        return rc;
+
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+    rep.ScreenCount = pseudoramiXNumScreens;
+    rep.window = stuff->window;
+    if (client->swapped) {
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.window);
+    }
+    WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply),&rep);
+    return Success;
+}
+
+// was PanoramiX
+static int
+ProcPseudoramiXGetScreenSize(ClientPtr client)
+{
+    REQUEST(xPanoramiXGetScreenSizeReq);
+    WindowPtr pWin;
+    xPanoramiXGetScreenSizeReply rep;
+    register int rc;
+
+    TRACE;
+
+    if (stuff->screen >= pseudoramiXNumScreens)
+      return BadMatch;
+
+    REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+    if (rc != Success)
+        return rc;
+
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+    /* screen dimensions */
+    rep.width = pseudoramiXScreens[stuff->screen].w;
+    // was screenInfo.screens[stuff->screen]->width;
+    rep.height = pseudoramiXScreens[stuff->screen].h;
+    // was screenInfo.screens[stuff->screen]->height;
+    rep.window = stuff->window;
+    rep.screen = stuff->screen;
+    if (client->swapped) {
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.width);
+        swapl(&rep.height);
+        swapl(&rep.window);
+        swapl(&rep.screen);
+    }
+    WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply),&rep);
+    return Success;
+}
+
+// was Xinerama
+static int
+ProcPseudoramiXIsActive(ClientPtr client)
+{
+    /* REQUEST(xXineramaIsActiveReq); */
+    xXineramaIsActiveReply rep;
+
+    TRACE;
+
+    REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
+
+    rep.type = X_Reply;
+    rep.length = 0;
+    rep.sequenceNumber = client->sequence;
+    rep.state = !noPseudoramiXExtension;
+    if (client->swapped) {
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.state);
+    }
+    WriteToClient(client, sizeof(xXineramaIsActiveReply),&rep);
+    return Success;
+}
+
+// was Xinerama
+static int
+ProcPseudoramiXQueryScreens(ClientPtr client)
+{
+    /* REQUEST(xXineramaQueryScreensReq); */
+    xXineramaQueryScreensReply rep;
+
+    DEBUG_LOG("noPseudoramiXExtension=%d, pseudoramiXNumScreens=%d\n",
+              noPseudoramiXExtension,
+              pseudoramiXNumScreens);
+
+    REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
+
+    rep.type = X_Reply;
+    rep.sequenceNumber = client->sequence;
+    rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens;
+    rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
+    if (client->swapped) {
+        swaps(&rep.sequenceNumber);
+        swapl(&rep.length);
+        swapl(&rep.number);
+    }
+    WriteToClient(client, sizeof(xXineramaQueryScreensReply),&rep);
+
+    if (!noPseudoramiXExtension) {
+        xXineramaScreenInfo scratch;
+        int i;
+
+        for (i = 0; i < pseudoramiXNumScreens; i++) {
+            scratch.x_org = pseudoramiXScreens[i].x;
+            scratch.y_org = pseudoramiXScreens[i].y;
+            scratch.width = pseudoramiXScreens[i].w;
+            scratch.height = pseudoramiXScreens[i].h;
+
+            if (client->swapped) {
+                swaps(&scratch.x_org);
+                swaps(&scratch.y_org);
+                swaps(&scratch.width);
+                swaps(&scratch.height);
+            }
+            WriteToClient(client, sz_XineramaScreenInfo,&scratch);
+        }
+    }
+
+    return Success;
+}
+
+// was PanoramiX
+static int
+ProcPseudoramiXDispatch(ClientPtr client)
+{
+    REQUEST(xReq);
+    TRACE;
+    switch (stuff->data) {
+    case X_PanoramiXQueryVersion:
+        return ProcPseudoramiXQueryVersion(client);
+
+    case X_PanoramiXGetState:
+        return ProcPseudoramiXGetState(client);
+
+    case X_PanoramiXGetScreenCount:
+        return ProcPseudoramiXGetScreenCount(client);
+
+    case X_PanoramiXGetScreenSize:
+        return ProcPseudoramiXGetScreenSize(client);
+
+    case X_XineramaIsActive:
+        return ProcPseudoramiXIsActive(client);
+
+    case X_XineramaQueryScreens:
+        return ProcPseudoramiXQueryScreens(client);
+    }
+    return BadRequest;
+}
+
+static int
+SProcPseudoramiXQueryVersion(ClientPtr client)
+{
+    REQUEST(xPanoramiXQueryVersionReq);
+
+    TRACE;
+
+    swaps(&stuff->length);
+    REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
+    return ProcPseudoramiXQueryVersion(client);
+}
+
+static int
+SProcPseudoramiXGetState(ClientPtr client)
+{
+    REQUEST(xPanoramiXGetStateReq);
+
+    TRACE;
+
+    swaps(&stuff->length);
+    REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+    return ProcPseudoramiXGetState(client);
+}
+
+static int
+SProcPseudoramiXGetScreenCount(ClientPtr client)
+{
+    REQUEST(xPanoramiXGetScreenCountReq);
+
+    TRACE;
+
+    swaps(&stuff->length);
+    REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+    return ProcPseudoramiXGetScreenCount(client);
+}
+
+static int
+SProcPseudoramiXGetScreenSize(ClientPtr client)
+{
+    REQUEST(xPanoramiXGetScreenSizeReq);
+
+    TRACE;
+
+    swaps(&stuff->length);
+    REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+    return ProcPseudoramiXGetScreenSize(client);
+}
+
+static int
+SProcPseudoramiXIsActive(ClientPtr client)
+{
+    REQUEST(xXineramaIsActiveReq);
+
+    TRACE;
+
+    swaps(&stuff->length);
+    REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
+    return ProcPseudoramiXIsActive(client);
+}
+
+static int
+SProcPseudoramiXQueryScreens(ClientPtr client)
+{
+    REQUEST(xXineramaQueryScreensReq);
+
+    TRACE;
+
+    swaps(&stuff->length);
+    REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
+    return ProcPseudoramiXQueryScreens(client);
+}
+
+static int
+SProcPseudoramiXDispatch(ClientPtr client)
+{
+    REQUEST(xReq);
+
+    TRACE;
+
+    switch (stuff->data) {
+    case X_PanoramiXQueryVersion:
+        return SProcPseudoramiXQueryVersion(client);
+
+    case X_PanoramiXGetState:
+        return SProcPseudoramiXGetState(client);
+
+    case X_PanoramiXGetScreenCount:
+        return SProcPseudoramiXGetScreenCount(client);
+
+    case X_PanoramiXGetScreenSize:
+        return SProcPseudoramiXGetScreenSize(client);
+
+    case X_XineramaIsActive:
+        return SProcPseudoramiXIsActive(client);
+
+    case X_XineramaQueryScreens:
+        return SProcPseudoramiXQueryScreens(client);
+    }
+    return BadRequest;
+}
diff --git a/pseudoramiX/pseudoramiX.h b/pseudoramiX/pseudoramiX.h
new file mode 100644
index 0000000..f063919
--- /dev/null
+++ b/pseudoramiX/pseudoramiX.h
@@ -0,0 +1,10 @@
+/*
+ * Minimal implementation of PanoramiX/Xinerama
+ */
+
+extern int noPseudoramiXExtension;
+
+void
+PseudoramiXAddScreen(int x, int y, int w, int h);
+void
+PseudoramiXResetScreens(void);
commit ce0217b98261dcf8b20cfb743831965dda1950ec
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Aug 10 12:35:55 2013 +0100

    hw/xwin: Fix winglobals.h for MinGW64 build
    
    Include pthread.h in winglobals.h to fix build with latest MinGW64 headers
    
    In file included from
    winmultiwindowicons.c:47:0:
    winglobals.h:92:1: error: unknown type name ‘pthread_mutex_t’
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/winglobals.h b/hw/xwin/winglobals.h
index e7e2f7e..4faba9e 100644
--- a/hw/xwin/winglobals.h
+++ b/hw/xwin/winglobals.h
@@ -30,6 +30,8 @@
 #include <xwin-config.h>
 #endif
 
+#include <pthread.h>
+
 /*
  * References to external symbols
  */
commit b27756dbe6a1be4633ec47a8fe92a4c217f68f93
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Aug 11 12:15:11 2013 +0100

    hw/xwin: Fix inclusion of shlobj.h in MinGW64 build
    
    Fix build with latest MinGW64 headers by wrapping Status type in shlobj.h as well
    
    In file included from InitOutput.c:51:0:
    /usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1231:44: error: expected identifier or ‘(’ before ‘int’
    /usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1248:44: error: expected identifier or ‘(’ before ‘int’
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Marc Haesen <marha at users.sourceforge.net>

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index d6b5e4f..b05ca27 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -48,7 +48,11 @@ from The Open Group.
 #include "xkbsrv.h"
 #endif
 #ifdef RELOCATE_PROJECTROOT
+#pragma push_macro("Status")
+#undef Status
+#define Status wStatus
 #include <shlobj.h>
+#pragma pop_macro("Status")
 typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
                                               int nFolder,
                                               HANDLE hToken,


More information about the xorg-commit mailing list