xserver: Branch 'master' - 13 commits

Adam Jackson ajax at kemper.freedesktop.org
Mon Feb 29 19:11:51 UTC 2016


 hw/xwin/winclipboard/internal.h   |    8 +
 hw/xwin/winclipboard/thread.c     |    9 +
 hw/xwin/winclipboard/wndproc.c    |  109 +++++++++++++++--------
 hw/xwin/winconfig.c               |   74 +++++++++-------
 hw/xwin/winlayouts.h              |    5 -
 hw/xwin/winmultiwindowclass.h     |   28 ++++--
 hw/xwin/winmultiwindowwindow.c    |   30 ++++--
 hw/xwin/winmultiwindowwm.c        |  174 +++++++++++++-------------------------
 hw/xwin/winrandr.c                |   92 +++++++++++++++++---
 hw/xwin/winwin32rootless.c        |    8 -
 hw/xwin/winwin32rootlesswindow.c  |    2 
 hw/xwin/winwin32rootlesswndproc.c |   12 +-
 hw/xwin/winwindowswm.c            |    2 
 13 files changed, 329 insertions(+), 224 deletions(-)

New commits:
commit 9fecc4cd571641f8920f25473ce5abb3fdca8b40
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Tue Jan 12 16:18:35 2016 +0000

    xwin: Remove unhelpful debug about WM message queue size
    
    Signed-off-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 b8577c8..97b893f 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -109,7 +109,6 @@ typedef struct _WMMsgQueueRec {
     struct _WMMsgNodeRec *pTail;
     pthread_mutex_t pmMutex;
     pthread_cond_t pcNotEmpty;
-    int nQueueSize;
 } WMMsgQueueRec, *WMMsgQueuePtr;
 
 typedef struct _WMInfo {
@@ -289,9 +288,6 @@ PushMessage(WMMsgQueuePtr pQueue, WMMsgNodePtr pNode)
         pQueue->pHead = pNode;
     }
 
-    /* Increase the count of elements in the queue by one */
-    ++(pQueue->nQueueSize);
-
     /* Release the queue mutex */
     pthread_mutex_unlock(&pQueue->pmMutex);
 
@@ -299,25 +295,6 @@ PushMessage(WMMsgQueuePtr pQueue, WMMsgNodePtr pNode)
     pthread_cond_signal(&pQueue->pcNotEmpty);
 }
 
-#if CYGMULTIWINDOW_DEBUG
-/*
- * QueueSize - Return the size of the queue
- */
-
-static int
-QueueSize(WMMsgQueuePtr pQueue)
-{
-    WMMsgNodePtr pNode;
-    int nSize = 0;
-
-    /* Loop through all elements in the queue */
-    for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext)
-        ++nSize;
-
-    return nSize;
-}
-#endif
-
 /*
  * PopMessage - Pop a message from the queue
  */
@@ -344,13 +321,6 @@ PopMessage(WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo)
         pQueue->pTail = NULL;
     }
 
-    /* Drop the number of elements in the queue by one */
-    --(pQueue->nQueueSize);
-
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("Queue Size %d %d\n", pQueue->nQueueSize, QueueSize(pQueue));
-#endif
-
     /* Release the queue mutex */
     pthread_mutex_unlock(&pQueue->pmMutex);
 
@@ -394,14 +364,6 @@ InitQueue(WMMsgQueuePtr pQueue)
     pQueue->pHead = NULL;
     pQueue->pTail = NULL;
 
-    /* There are no elements initially */
-    pQueue->nQueueSize = 0;
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("InitQueue - Queue Size %d %d\n", pQueue->nQueueSize,
-             QueueSize(pQueue));
-#endif
-
     winDebug("InitQueue - Calling pthread_mutex_init\n");
 
     /* Create synchronization objects */
commit f7d1e5acdf5ed4ab4ed5c18727aa6f3d379ef560
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Tue Aug 11 15:45:57 2015 +0100

    xwin: Add SKIPTASKBAR hint to _NET_WM_WINDOW_TYPE_DOCK type windows
    
    Signed-off-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 0fdaf5d..b8577c8 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -1765,7 +1765,7 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
                            (unsigned char **) &pAtom) == Success) {
         if (pAtom && nitems == 1) {
             if (*pAtom == dockWindow) {
-                hint = (hint & ~HINT_NOFRAME) | HINT_SIZEBOX;   /* Xming puts a sizebox on dock windows */
+                hint = (hint & ~HINT_NOFRAME) | HINT_SKIPTASKBAR | HINT_SIZEBOX;
                 *zstyle = HWND_TOPMOST;
             }
         }
commit e7f87f8f76e5ac9479a71e3daf2cfdefd4b5f684
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Thu Jul 2 19:21:11 2015 +0100

    xwin: In multiwindow mode, look up the HWND for the parent window
    
    Rather than only looking at the foreground window to see if it matches
    the WM_TRANSIENT_FOR window XID, lookup that XID and fetch the HWND from
    the window privates.
    
    Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 79ea108..8b85785 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -523,9 +523,13 @@ winCreateWindowsWindow(WindowPtr pWin)
 
     if (winMultiWindowGetTransientFor(pWin, &daddyId)) {
         if (daddyId) {
-            hFore = GetForegroundWindow();
-            if (hFore && (daddyId != (Window) (INT_PTR) GetProp(hFore, WIN_WID_PROP)))
-                hFore = NULL;
+            WindowPtr pParent;
+            int res = dixLookupWindow(&pParent, daddyId, serverClient, DixReadAccess);
+            if (res == Success)
+                {
+                    winPrivWinPtr pParentPriv = winGetWindowPriv(pParent);
+                    hFore = pParentPriv->hWnd;
+                }
         }
     }
     else {
commit 856a28f63739bffe32f5a8156fd2680e5c5259a1
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Thu Jul 2 13:32:40 2015 +0100

    xwin: Factor out MessageName() debug helper
    
    Factor out the MessageName() debug helper for message id -> text, and
    use it on message queue and dequeue.
    
    Reorder in numerical order to match winwindow.h
    
    Add missing WM_WM_ICON_EVENT
    
    Signed-off-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 c010134..0fdaf5d 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -210,6 +210,64 @@ static Bool redirectError = FALSE;
 static Bool g_fAnotherWMRunning = FALSE;
 
 /*
+ * Translate msg id to text, for debug purposes
+ */
+
+static const char *
+MessageName(winWMMessagePtr msg)
+{
+  switch (msg->msg)
+    {
+    case WM_WM_MOVE:
+      return "WM_WM_MOVE";
+      break;
+    case WM_WM_SIZE:
+      return "WM_WM_SIZE";
+      break;
+    case WM_WM_RAISE:
+      return "WM_WM_RAISE";
+      break;
+    case WM_WM_LOWER:
+      return "WM_WM_LOWER";
+      break;
+    case WM_WM_UNMAP:
+      return "WM_WM_UNMAP";
+      break;
+    case WM_WM_KILL:
+      return "WM_WM_KILL";
+      break;
+    case WM_WM_ACTIVATE:
+      return "WM_WM_ACTIVATE";
+      break;
+    case WM_WM_NAME_EVENT:
+      return "WM_WM_NAME_EVENT";
+      break;
+    case WM_WM_ICON_EVENT:
+      return "WM_WM_ICON_EVENT";
+      break;
+    case WM_WM_CHANGE_STATE:
+      return "WM_WM_CHANGE_STATE";
+      break;
+    case WM_WM_MAP:
+      return "WM_WM_MAP";
+      break;
+    case WM_WM_MAP2:
+      return "WM_WM_MAP2";
+      break;
+    case WM_WM_MAP3:
+      return "WM_WM_MAP3";
+      break;
+    case WM_WM_HINTS_EVENT:
+      return "WM_WM_HINTS_EVENT";
+      break;
+    default:
+      return "Unknown Message";
+      break;
+    }
+}
+
+
+/*
  * PushMessage - Push a message onto the queue
  */
 
@@ -231,44 +289,6 @@ PushMessage(WMMsgQueuePtr pQueue, WMMsgNodePtr pNode)
         pQueue->pHead = pNode;
     }
 
-#if 0
-    switch (pNode->msg.msg) {
-    case WM_WM_MOVE:
-        ErrorF("\tWM_WM_MOVE\n");
-        break;
-    case WM_WM_SIZE:
-        ErrorF("\tWM_WM_SIZE\n");
-        break;
-    case WM_WM_RAISE:
-        ErrorF("\tWM_WM_RAISE\n");
-        break;
-    case WM_WM_LOWER:
-        ErrorF("\tWM_WM_LOWER\n");
-        break;
-    case WM_WM_MAP:
-        ErrorF("\tWM_WM_MAP\n");
-        break;
-    case WM_WM_MAP2:
-        ErrorF("\tWM_WM_MAP2\n");
-        break;
-    case WM_WM_MAP3:
-        ErrorF("\tWM_WM_MAP3\n");
-        break;
-    case WM_WM_UNMAP:
-        ErrorF("\tWM_WM_UNMAP\n");
-        break;
-    case WM_WM_KILL:
-        ErrorF("\tWM_WM_KILL\n");
-        break;
-    case WM_WM_ACTIVATE:
-        ErrorF("\tWM_WM_ACTIVATE\n");
-        break;
-    default:
-        ErrorF("\tUnknown Message.\n");
-        break;
-    }
-#endif
-
     /* Increase the count of elements in the queue by one */
     ++(pQueue->nQueueSize);
 
@@ -772,26 +792,21 @@ winMultiWindowWMProc(void *pArg)
         }
 
 #if CYGMULTIWINDOW_DEBUG
-        ErrorF("winMultiWindowWMProc - MSG: %d ID: %d\n",
-               (int) pNode->msg.msg, (int) pNode->msg.dwID);
+        ErrorF("winMultiWindowWMProc - MSG: %s (%d) ID: %d\n",
+               MessageName(&(pNode->msg)), (int)pNode->msg.msg, (int)pNode->msg.dwID);
 #endif
 
         /* Branch on the message type */
         switch (pNode->msg.msg) {
 #if 0
         case WM_WM_MOVE:
-            ErrorF("\tWM_WM_MOVE\n");
             break;
 
         case WM_WM_SIZE:
-            ErrorF("\tWM_WM_SIZE\n");
             break;
 #endif
 
         case WM_WM_RAISE:
-#if CYGMULTIWINDOW_DEBUG
-            ErrorF("\tWM_WM_RAISE\n");
-#endif
             /* Raise the window */
             XRaiseWindow(pWMInfo->pDisplay, pNode->msg.iWindow);
 #if 0
@@ -800,18 +815,11 @@ winMultiWindowWMProc(void *pArg)
             break;
 
         case WM_WM_LOWER:
-#if CYGMULTIWINDOW_DEBUG
-            ErrorF("\tWM_WM_LOWER\n");
-#endif
-
             /* Lower the window */
             XLowerWindow(pWMInfo->pDisplay, pNode->msg.iWindow);
             break;
 
         case WM_WM_MAP:
-#if CYGMULTIWINDOW_DEBUG
-            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,
                             32,
@@ -822,9 +830,6 @@ winMultiWindowWMProc(void *pArg)
             break;
 
         case WM_WM_MAP2:
-#if CYGMULTIWINDOW_DEBUG
-            ErrorF("\tWM_WM_MAP2\n");
-#endif
             XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER,
                             32,
                             PropModeReplace,
@@ -832,9 +837,6 @@ winMultiWindowWMProc(void *pArg)
             break;
 
         case WM_WM_MAP3:
-#if CYGMULTIWINDOW_DEBUG
-            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,
                             32,
@@ -858,18 +860,12 @@ winMultiWindowWMProc(void *pArg)
             break;
 
         case WM_WM_UNMAP:
-#if CYGMULTIWINDOW_DEBUG
-            ErrorF("\tWM_WM_UNMAP\n");
-#endif
 
             /* Unmap the window */
             XUnmapWindow(pWMInfo->pDisplay, pNode->msg.iWindow);
             break;
 
         case WM_WM_KILL:
-#if CYGMULTIWINDOW_DEBUG
-            ErrorF("\tWM_WM_KILL\n");
-#endif
             {
                 /* --- */
                 if (IsWmProtocolAvailable(pWMInfo->pDisplay,
@@ -884,9 +880,6 @@ winMultiWindowWMProc(void *pArg)
             break;
 
         case WM_WM_ACTIVATE:
-#if CYGMULTIWINDOW_DEBUG
-            ErrorF("\tWM_WM_ACTIVATE\n");
-#endif
             /* Set the input focus */
 
             /*
@@ -1512,7 +1505,7 @@ winSendMessageToWM(void *pWMInfo, winWMMessagePtr pMsg)
     WMMsgNodePtr pNode;
 
 #if CYGMULTIWINDOW_DEBUG
-    ErrorF("winSendMessageToWM ()\n");
+    ErrorF("winSendMessageToWM %s\n", MessageName(pMsg));
 #endif
 
     pNode = malloc(sizeof(WMMsgNodeRec));
commit 8c2006ddc5abbd4ac374dabf1cfdd3df8fc88779
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Mon Feb 22 17:41:14 2016 +0000

    xwin: Keyboard layout updates
    
    layout zh_TW doesn't exist (anymore), try something else for that.
    
    layout it variant mac doesn't seem to exist anymore, try to handle
    Macintosh keyboards (running under Parallels on Mac) and other oddities
    in a more generic way, by falling back to matching only on the language
    identifer part of the input locale identifer.
    
    v2:
    Fix typo of 0xa0000 for 0xa000
    
    Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
index d26cc93..fb99113 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -224,7 +224,8 @@ winConfigKeyboard(DeviceIntPtr pDevice)
 {
     char layoutName[KL_NAMELENGTH];
     unsigned char layoutFriendlyName[256];
-    static unsigned int layoutNum = 0;
+    unsigned int layoutNum = 0;
+    unsigned int deviceIdentifier = 0;
     int keyboardType;
 
 #ifdef XWIN_XF86CONFIG
@@ -272,15 +273,10 @@ winConfigKeyboard(DeviceIntPtr pDevice)
     if (keyboardType > 0 && GetKeyboardLayoutName(layoutName)) {
         WinKBLayoutPtr pLayout;
         Bool bfound = FALSE;
+        int pass;
 
-        if (!layoutNum)
-            layoutNum = strtoul(layoutName, (char **) NULL, 16);
+        layoutNum = strtoul(layoutName, (char **) NULL, 16);
         if ((layoutNum & 0xffff) == 0x411) {
-            /* The japanese layouts know a lot of different IMEs which all have
-               different layout numbers set. Map them to a single entry.
-               Same might apply for chinese, korean and other symbol languages
-               too */
-            layoutNum = (layoutNum & 0xffff);
             if (keyboardType == 7) {
                 /* Japanese layouts have problems with key event messages
                    such as the lack of WM_KEYUP for Caps Lock key.
@@ -318,31 +314,47 @@ winConfigKeyboard(DeviceIntPtr pDevice)
                "Windows keyboard layout: \"%s\" (%08x) \"%s\", type %d\n",
                layoutName, layoutNum, layoutFriendlyName, keyboardType);
 
-        for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++) {
-            if (pLayout->winlayout != layoutNum)
-                continue;
-            if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType)
-                continue;
-
-            bfound = TRUE;
-            winMsg(X_PROBED,
-                   "Found matching XKB configuration \"%s\"\n",
-                   pLayout->layoutname);
-
-            winMsg(X_PROBED,
-                   "Model = \"%s\" Layout = \"%s\""
-                   " Variant = \"%s\" Options = \"%s\"\n",
-                   pLayout->xkbmodel ? pLayout->xkbmodel : "none",
-                   pLayout->xkblayout ? pLayout->xkblayout : "none",
-                   pLayout->xkbvariant ? pLayout->xkbvariant : "none",
-                   pLayout->xkboptions ? pLayout->xkboptions : "none");
+        deviceIdentifier = layoutNum >> 16;
+        for (pass = 0; pass < 2; pass++) {
+            /* If we didn't find an exact match for the input locale identifer,
+               try to find an match on the language identifier part only  */
+            if (pass == 1)
+                layoutNum = (layoutNum & 0xffff);
+
+            for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++) {
+                if (pLayout->winlayout != layoutNum)
+                    continue;
+                if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType)
+                    continue;
+
+                bfound = TRUE;
+                winMsg(X_PROBED,
+                       "Found matching XKB configuration \"%s\"\n",
+                       pLayout->layoutname);
+
+                winMsg(X_PROBED,
+                       "Model = \"%s\" Layout = \"%s\""
+                       " Variant = \"%s\" Options = \"%s\"\n",
+                       pLayout->xkbmodel ? pLayout->xkbmodel : "none",
+                       pLayout->xkblayout ? pLayout->xkblayout : "none",
+                       pLayout->xkbvariant ? pLayout->xkbvariant : "none",
+                       pLayout->xkboptions ? pLayout->xkboptions : "none");
+
+                g_winInfo.xkb.model = pLayout->xkbmodel;
+                g_winInfo.xkb.layout = pLayout->xkblayout;
+                g_winInfo.xkb.variant = pLayout->xkbvariant;
+                g_winInfo.xkb.options = pLayout->xkboptions;
+
+                if (deviceIdentifier == 0xa000) {
+                    winMsg(X_PROBED, "Windows keyboard layout device identifier indicates Macintosh, setting Model = \"macintosh\"");
+                    g_winInfo.xkb.model = "macintosh";
+                }
 
-            g_winInfo.xkb.model = pLayout->xkbmodel;
-            g_winInfo.xkb.layout = pLayout->xkblayout;
-            g_winInfo.xkb.variant = pLayout->xkbvariant;
-            g_winInfo.xkb.options = pLayout->xkboptions;
+                break;
+            }
 
-            break;
+            if (bfound)
+                break;
         }
 
         if (!bfound) {
diff --git a/hw/xwin/winlayouts.h b/hw/xwin/winlayouts.h
index d3d5c6d..c7905e3 100644
--- a/hw/xwin/winlayouts.h
+++ b/hw/xwin/winlayouts.h
@@ -42,7 +42,8 @@ typedef struct {
 */
 
 WinKBLayoutRec winKBLayouts[] = {
-    {0x00000404, -1, "pc105", "zh_TW", NULL, NULL, "Chinese (Taiwan)"},
+    {0x00000404, -1, "pc105", "cn", NULL, NULL, "Chinese (Traditional)"},
+    {0x00000804, -1, "pc105", "cn", NULL, NULL, "Chinese (Simplified)"},
     {0x00000405, -1, "pc105", "cz", NULL, NULL, "Czech"},
     {0x00010405, -1, "pc105", "cz_qwerty", NULL, NULL, "Czech (QWERTY)"},
     {0x00000406, -1, "pc105", "dk", NULL, NULL, "Danish"},
@@ -72,7 +73,6 @@ WinKBLayoutRec winKBLayouts[] = {
     {0x0000040f, -1, "pc105", "is", NULL, NULL, "Icelandic"},
     {0x00000410, -1, "pc105", "it", NULL, NULL, "Italian"},
     {0x00010410, -1, "pc105", "it", NULL, NULL, "Italian (142)"},
-    {0xa0000410, -1, "macbook79", "it", "mac", NULL, "Italiano (Apple)"},
     {0x00000411, 7, "jp106", "jp", NULL, NULL, "Japanese"},
     {0x00000412, -1, "kr106", "kr", NULL, NULL, "Korean"},
     {0x00000413, -1, "pc105", "nl", NULL, NULL, "Dutch"},
commit 8c97a0078e7fe22e6159fa53490dfca2f4d267a9
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Wed Nov 19 22:33:39 2014 +0000

    xwin: Add a tentative entry for the Korean keyboard to the list of known keyboard layouts
    
    Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Jon Turney <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winlayouts.h b/hw/xwin/winlayouts.h
index a61fd7a..d3d5c6d 100644
--- a/hw/xwin/winlayouts.h
+++ b/hw/xwin/winlayouts.h
@@ -74,6 +74,7 @@ WinKBLayoutRec winKBLayouts[] = {
     {0x00010410, -1, "pc105", "it", NULL, NULL, "Italian (142)"},
     {0xa0000410, -1, "macbook79", "it", "mac", NULL, "Italiano (Apple)"},
     {0x00000411, 7, "jp106", "jp", NULL, NULL, "Japanese"},
+    {0x00000412, -1, "kr106", "kr", NULL, NULL, "Korean"},
     {0x00000413, -1, "pc105", "nl", NULL, NULL, "Dutch"},
     {0x00000813, -1, "pc105", "be", NULL, NULL, "Dutch (Belgian)"},
     {0x00000414, -1, "pc105", "no", NULL, NULL, "Norwegian"},
commit a4d8a64c4ba467964476c4a1486da698bd6aed9e
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Tue Feb 10 14:36:37 2015 +0000

    xwin: Update to XRANDR 1.2 internal interface to ensure an output is reported by XRANDR
    
    If using the X server internal XRANDR 1.0 interface, it seems we must
    register a display size with RRRegisterSize() in order to make
    RRGetInfo() call RRScanOldConfig() to generate an output and crtc for
    us.
    
    Without this, the following GDM bug means that an XDMCP session to GDM
    cannot be started.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736054
    
    Instead, use the more recent XRANDR 1.2 internal interface to explicitly
    create the output and crtc, and maintain a single mode which represents
    the current display size.
    
    Also don't emit a RRScreenSizeNotify when a RRScreenSizeSize is done
    which has no effect, this seems to throw the GDM greeter into a loop...
    
    v2: Maintain reference count for the mode we maintain more correctly, to
    avoid double free causing a crash on shutdown
    
    Connect crtc to output, so a subsequent RRSetCrtcConfig request doesn't
    change anything, so we don't fail due to our lack of rrSetConfig or
    rrCrtcSet hooks.
    
    See https://cygwin.com/ml/cygwin-xfree/2015-02/msg00032.html
    
    v3:
    Raise limit on X display size from 4Kx4K to 32Kx32K
    
    Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c
index c29d7b3..1560199 100644
--- a/hw/xwin/winrandr.c
+++ b/hw/xwin/winrandr.c
@@ -34,11 +34,6 @@
 #include <xwin-config.h>
 #endif
 #include "win.h"
-#include "mivalidate.h"         // for union _Validate used by windowstr.h
-
-#ifndef RANDR_12_INTERFACE
-#error X server must have RandR 1.2 interface
-#endif
 
 /*
  * Answer queries about the RandR features supported.
@@ -47,17 +42,47 @@
 static Bool
 winRandRGetInfo(ScreenPtr pScreen, Rotation * pRotations)
 {
+    rrScrPrivPtr pRRScrPriv;
+    RROutputPtr output;
+
+    pRRScrPriv = rrGetScrPriv(pScreen);
+    output = pRRScrPriv->outputs[0];
+
     winDebug("winRandRGetInfo ()\n");
 
     /* Don't support rotations */
     *pRotations = RR_Rotate_0;
 
-    /*
-       The screen doesn't have to be limited to the actual
-       monitor size (we can have scrollbars :-), so what is
-       the upper limit?
-     */
-    RRScreenSetSizeRange(pScreen, 0, 0, 4096, 4096);
+    /* Delete previous mode */
+    if (output->modes[0])
+        {
+            RRModeDestroy(output->modes[0]);
+            RRModeDestroy(output->crtc->mode);
+        }
+
+    /* Register current mode */
+    {
+        xRRModeInfo modeInfo;
+        RRModePtr mode;
+        char name[100];
+
+        memset(&modeInfo, '\0', sizeof(modeInfo));
+        snprintf(name, sizeof(name), "%dx%d", pScreen->width, pScreen->height);
+
+        modeInfo.width = pScreen->width;
+        modeInfo.height = pScreen->height;
+        modeInfo.hTotal = pScreen->width;
+        modeInfo.vTotal = pScreen->height;
+        modeInfo.dotClock = 0;
+        modeInfo.nameLength = strlen(name);
+        mode = RRModeGet(&modeInfo, name);
+
+        output->modes[0] = mode;
+        output->numModes = 1;
+
+        mode = RRModeGet(&modeInfo, name);
+        output->crtc->mode = mode;
+    }
 
     return TRUE;
 }
@@ -74,6 +99,11 @@ winDoRandRScreenSetSize(ScreenPtr pScreen,
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
     WindowPtr pRoot = pScreen->root;
 
+    /* Ignore changes which do nothing */
+    if ((pScreen->width == width) && (pScreen->height == height) &&
+        (pScreen->mmWidth == mmWidth) && (pScreen->mmHeight == mmHeight))
+        return;
+
     // Prevent screen updates while we change things around
     SetRootClip(pScreen, ROOT_CLIP_NONE);
 
@@ -214,5 +244,45 @@ winRandRInit(ScreenPtr pScreen)
     pRRScrPriv->rrCrtcSet = NULL;
     pRRScrPriv->rrCrtcSetGamma = NULL;
 
+    /* Create a CRTC and an output for the screen, and hook them together */
+    {
+        RRCrtcPtr crtc;
+        RROutputPtr output;
+
+        crtc = RRCrtcCreate(pScreen, NULL);
+        if (!crtc)
+            return FALSE;
+
+        crtc->rotations = RR_Rotate_0;
+
+        output = RROutputCreate(pScreen, "default", 7, NULL);
+        if (!output)
+            return FALSE;
+
+        RROutputSetCrtcs(output, &crtc, 1);
+        RROutputSetConnection(output, RR_Connected);
+        RROutputSetSubpixelOrder(output, PictureGetSubpixelOrder(pScreen));
+
+        output->crtc = crtc;
+
+        /* Set crtc outputs (should use RRCrtcNotify?) */
+        crtc->outputs = malloc(sizeof(RROutputPtr));
+        crtc->outputs[0] = output;
+        crtc->numOutputs = 1;
+
+        pRRScrPriv->primaryOutput = output;
+
+        /* Ensure we have space for exactly one mode */
+        output->modes = malloc(sizeof(RRModePtr));
+        output->modes[0] = NULL;
+    }
+
+    /*
+       The screen doesn't have to be limited to the actual
+       monitor size (we can have scrollbars :-), so set the
+       upper limit to the maximum coordinates X11 can use.
+     */
+    RRScreenSetSizeRange(pScreen, 0, 0, 32768, 32768);
+
     return TRUE;
 }
commit 008efebda801b9b80e2ab3f2c95aeef8c82102ee
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Sat Oct 18 17:31:57 2014 +0100

    xwin: Use WM_CLIPBOARDUPDATE clipboard API
    
    Windows Vista and later have a saner clipboard API where the clipboard
    viewer linked list is no longer maintained by applications.  Use it
    where available.
    
    Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winclipboard/internal.h b/hw/xwin/winclipboard/internal.h
index 6c26caf..d0d8fbd 100644
--- a/hw/xwin/winclipboard/internal.h
+++ b/hw/xwin/winclipboard/internal.h
@@ -77,6 +77,14 @@ typedef struct
     Atom atomTargets;
 } ClipboardAtoms;
 
+/* Modern clipboard API functions */
+typedef wBOOL WINAPI (*ADDCLIPBOARDFORMATLISTENERPROC)(HWND hwnd);
+typedef wBOOL WINAPI (*REMOVECLIPBOARDFORMATLISTENERPROC)(HWND hwnd);
+
+extern Bool g_fHasModernClipboardApi;
+extern ADDCLIPBOARDFORMATLISTENERPROC g_fpAddClipboardFormatListener;
+extern REMOVECLIPBOARDFORMATLISTENERPROC g_fpRemoveClipboardFormatListener;
+
 /*
  * winclipboardwndproc.c
  */
diff --git a/hw/xwin/winclipboard/thread.c b/hw/xwin/winclipboard/thread.c
index 50e1e8c..fa57ada 100644
--- a/hw/xwin/winclipboard/thread.c
+++ b/hw/xwin/winclipboard/thread.c
@@ -84,6 +84,10 @@ static pthread_t g_winClipboardProcThread;
 int xfixes_event_base;
 int xfixes_error_base;
 
+Bool g_fHasModernClipboardApi = FALSE;
+ADDCLIPBOARDFORMATLISTENERPROC g_fpAddClipboardFormatListener;
+REMOVECLIPBOARDFORMATLISTENERPROC g_fpRemoveClipboardFormatListener;
+
 /*
  * Local function prototypes
  */
@@ -138,6 +142,11 @@ winClipboardProc(Bool fUseUnicode, char *szDisplay)
         ErrorF("winClipboardProc - Warning: Locale not supported by X.\n");
     }
 
+    g_fpAddClipboardFormatListener = (ADDCLIPBOARDFORMATLISTENERPROC)GetProcAddress(GetModuleHandle("user32"),"AddClipboardFormatListener");
+    g_fpRemoveClipboardFormatListener = (REMOVECLIPBOARDFORMATLISTENERPROC)GetProcAddress(GetModuleHandle("user32"),"RemoveClipboardFormatListener");
+    g_fHasModernClipboardApi = g_fpAddClipboardFormatListener && g_fpRemoveClipboardFormatListener;
+    ErrorF("OS maintains clipboard viewer chain: %s\n", g_fHasModernClipboardApi ? "yes" : "no");
+
     g_winClipboardProcThread = pthread_self();
 
     /* Set error handler */
diff --git a/hw/xwin/winclipboard/wndproc.c b/hw/xwin/winclipboard/wndproc.c
index d17cf2e..d289f77 100644
--- a/hw/xwin/winclipboard/wndproc.c
+++ b/hw/xwin/winclipboard/wndproc.c
@@ -58,6 +58,9 @@
 
 #define WIN_POLL_TIMEOUT	1
 
+#ifndef WM_CLIPBOARDUPDATE
+#define WM_CLIPBOARDUPDATE 0x031D
+#endif
 
 /*
  * Process X events up to specified timeout
@@ -151,8 +154,16 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     {
         winDebug("winClipboardWindowProc - WM_DESTROY\n");
 
-        /* Remove ourselves from the clipboard chain */
-        ChangeClipboardChain(hwnd, s_hwndNextViewer);
+        if (g_fHasModernClipboardApi)
+            {
+                /* Remove clipboard listener */
+                g_fpRemoveClipboardFormatListener(hwnd);
+            }
+        else
+            {
+                /* Remove ourselves from the clipboard chain */
+                ChangeClipboardChain(hwnd, s_hwndNextViewer);
+            }
 
         s_hwndNextViewer = NULL;
     }
@@ -168,8 +179,6 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
     case WM_CREATE:
     {
-        HWND first, next;
-        DWORD error_code = 0;
         ClipboardWindowCreationParams *cwcp = (ClipboardWindowCreationParams *)((CREATESTRUCT *)lParam)->lpCreateParams;
 
         winDebug("winClipboardWindowProc - WM_CREATE\n");
@@ -179,16 +188,26 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         atoms = cwcp->atoms;
         fRunning = TRUE;
 
-        first = GetClipboardViewer();   /* Get handle to first viewer in chain. */
-        if (first == hwnd)
-            return 0;           /* Make sure it's not us! */
-        /* Add ourselves to the clipboard viewer chain */
-        next = SetClipboardViewer(hwnd);
-        error_code = GetLastError();
-        if (SUCCEEDED(error_code) && (next == first))   /* SetClipboardViewer must have succeeded, and the handle */
-            s_hwndNextViewer = next;    /* it returned must have been the first window in the chain */
+        if (g_fHasModernClipboardApi)
+            {
+                g_fpAddClipboardFormatListener(hwnd);
+            }
         else
-            s_fCBCInitialized = FALSE;
+            {
+                HWND first, next;
+                DWORD error_code = 0;
+
+                first = GetClipboardViewer();   /* Get handle to first viewer in chain. */
+                if (first == hwnd)
+                    return 0;           /* Make sure it's not us! */
+                /* Add ourselves to the clipboard viewer chain */
+                next = SetClipboardViewer(hwnd);
+                error_code = GetLastError();
+                if (SUCCEEDED(error_code) && (next == first))   /* SetClipboardViewer must have succeeded, and the handle */
+                    s_hwndNextViewer = next;    /* it returned must have been the first window in the chain */
+                else
+                    s_fCBCInitialized = FALSE;
+            }
     }
         return 0;
 
@@ -233,6 +252,11 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
         winDebug("winClipboardWindowProc - WM_WM_REINIT: Enter\n");
 
+        if (g_fHasModernClipboardApi)
+            {
+                return 0;
+            }
+
         first = GetClipboardViewer();   /* Get handle to first viewer in chain. */
         if (first == hwnd)
             return 0;           /* Make sure it's not us! */
@@ -257,38 +281,45 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         return 0;
 
     case WM_DRAWCLIPBOARD:
+    case WM_CLIPBOARDUPDATE:
     {
         static Bool s_fProcessingDrawClipboard = FALSE;
         int iReturn;
 
-        winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Enter\n");
+        if (message == WM_DRAWCLIPBOARD)
+            winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Enter\n");
+        else
+            winDebug("winClipboardWindowProc -  WM_CLIPBOARDUPDATE: Enter\n");
 
-        /*
-         * We've occasionally seen a loop in the clipboard chain.
-         * Try and fix it on the first hint of recursion.
-         */
-        if (!s_fProcessingDrawClipboard) {
-            s_fProcessingDrawClipboard = TRUE;
-        }
-        else {
-            /* Attempt to break the nesting by getting out of the chain, twice?, and then fix and bail */
-            s_fCBCInitialized = FALSE;
-            ChangeClipboardChain(hwnd, s_hwndNextViewer);
-            winFixClipboardChain();
-            ErrorF("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
-                   "Nested calls detected.  Re-initing.\n");
-            winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
-            s_fProcessingDrawClipboard = FALSE;
-            return 0;
-        }
+        if (!g_fHasModernClipboardApi)
+            {
+                /*
+                 * We've occasionally seen a loop in the clipboard chain.
+                 * Try and fix it on the first hint of recursion.
+                 */
+                if (!s_fProcessingDrawClipboard) {
+                    s_fProcessingDrawClipboard = TRUE;
+                }
+                else {
+                    /* Attempt to break the nesting by getting out of the chain, twice?, and then fix and bail */
+                    s_fCBCInitialized = FALSE;
+                    ChangeClipboardChain(hwnd, s_hwndNextViewer);
+                    winFixClipboardChain();
+                    ErrorF("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+                           "Nested calls detected.  Re-initing.\n");
+                    winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
+                    s_fProcessingDrawClipboard = FALSE;
+                    return 0;
+                }
 
-        /* Bail on first message */
-        if (!s_fCBCInitialized) {
-            s_fCBCInitialized = TRUE;
-            s_fProcessingDrawClipboard = FALSE;
-            winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
-            return 0;
-        }
+                /* Bail on first message */
+                if (!s_fCBCInitialized) {
+                    s_fCBCInitialized = TRUE;
+                    s_fProcessingDrawClipboard = FALSE;
+                    winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
+                    return 0;
+                }
+            }
 
         /*
          * NOTE: We cannot bail out when NULL == GetClipboardOwner ()
commit de7f1fd6f8f10f07b366ae5428a8c65a224bda98
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Wed Jul 9 14:26:54 2014 +0100

    xwin: Check that window position is visible on non-rectangular virtual desktops
    
    Improve the check that window position is visible to work correctly for
    non-rectangular virtual desktops
    
    Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index f4de912..79ea108 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -503,15 +503,19 @@ winCreateWindowsWindow(WindowPtr pWin)
     iHeight = pWin->drawable.height;
 
     /* If it's an InputOutput window, and so is going to end up being made visible,
-       make sure the window actually ends up somewhere where it will be visible */
-    if (pWin->drawable.class != InputOnly) {
-        if ((iX < GetSystemMetrics(SM_XVIRTUALSCREEN)) ||
-            (iX > GetSystemMetrics(SM_CXVIRTUALSCREEN)))
-            iX = CW_USEDEFAULT;
+       make sure the window actually ends up somewhere where it will be visible
 
-        if ((iY < GetSystemMetrics(SM_YVIRTUALSCREEN)) ||
-            (iY > GetSystemMetrics(SM_CYVIRTUALSCREEN)))
-            iY = CW_USEDEFAULT;
+       To handle arrangements of monitors which form a non-rectangular virtual
+       desktop, check if the window will end up with it's top-left corner on any
+       monitor
+    */
+    if (pWin->drawable.class != InputOnly) {
+        POINT pt = { iX, iY };
+        if (MonitorFromPoint(pt, MONITOR_DEFAULTTONULL) == NULL)
+            {
+                iX = CW_USEDEFAULT;
+                iY = CW_USEDEFAULT;
+            }
     }
 
     winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX,
commit a9e73131b6453e0fa2da5360e84af7a2eae3b205
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Thu May 8 11:40:39 2014 +0100

    xwin: Correctly interpret WM_HINTS, WM_NORMAL_HINTS properties on x86_64
    
    Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowclass.h b/hw/xwin/winmultiwindowclass.h
index 3244f78..37ee9fb 100644
--- a/hw/xwin/winmultiwindowclass.h
+++ b/hw/xwin/winmultiwindowclass.h
@@ -31,11 +31,24 @@
  */
 
 /*
+ * The next block of definitions are for window manager properties that
+ * clients and applications use for communication.
+ */
+
+/*
  * Structures
  */
 
+/*
+ * WM_HINTS structure
+ *
+ * NOTE: this structure represents the internal format stored in the property
+ * after it is marshalled by libX11, converting the flags field from an
+ * arch-dependent long to a 32-bit int.
+ */
+
 typedef struct {
-    long flags;                 /* marks which fields in this structure are defined */
+    int flags;                  /* marks which fields in this structure are defined */
     Bool input;                 /* does this application rely on the window manager to
                                    get keyboard input? */
     int initial_state;          /* see below */
@@ -59,11 +72,15 @@ typedef struct {
 #define	AllHints 	(InputHint|StateHint|IconPixmapHint|IconWindowHint|IconPositionHint|IconMaskHint|WindowGroupHint)
 
 /*
- * new version containing base_width, base_height, and win_gravity fields;
+ * ICCCM 1.0 version containing base_width, base_height, and win_gravity fields;
  * used with WM_NORMAL_HINTS.
+ *
+ * NOTE: this structure represents the internal format stored in the property
+ * after it is marshalled by libX11, converting the flags field from an
+ * arch-dependent long to a 32-bit int.
  */
 typedef struct {
-    long flags;                 /* marks which fields in this structure are defined */
+    int flags;                  /* marks which fields in this structure are defined */
     int x, y;                   /* obsolete for new window mgrs, but clients */
     int width, height;          /* should set so old wm's don't mess up */
     int min_width, min_height;
@@ -77,11 +94,6 @@ typedef struct {
     int win_gravity;            /* added by ICCCM version 1 */
 } WinXSizeHints;
 
-/*
- * The next block of definitions are for window manager properties that
- * clients and applications use for communication.
- */
-
 /* flags argument in size hints */
 #define USPosition      (1L << 0)       /* user specified x, y */
 #define USSize          (1L << 1)       /* user specified width, height */
commit d7cef6fbe23381b31c163468f349feee2f1b1eba
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Thu Mar 13 18:04:17 2014 +0000

    xwin: Improve handling of no-decoration motif hint
    
    When motif decoration hint asks for no decoration, don't add sysmenu,
    mimimize or maximimize controls.
    
    (This fixes a problem with e.g. fbpanel having a minimize control, but
    gtk's panel_configure_event() doesn't like the state we put the window
    into when we minimize it, causing it to spin)
    
    Signed-off-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 3156e36..c010134 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -1738,7 +1738,7 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
         if (mwm_hint && nitems == PropMwmHintsElements &&
             (mwm_hint->flags & MwmHintsDecorations)) {
             if (!mwm_hint->decorations)
-                hint |= HINT_NOFRAME;
+                hint |= (HINT_NOFRAME | HINT_NOSYSMENU | HINT_NOMINIMIZE | HINT_NOMAXIMIZE);
             else if (!(mwm_hint->decorations & MwmDecorAll)) {
                 if (mwm_hint->decorations & MwmDecorBorder)
                     hint |= HINT_BORDER;
commit f75404be3ad94c8da493688397712c65ea66cb90
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Fri Mar 28 16:57:48 2014 +0000

    xwin: XGetWMNormalHints() returns non-zero on success
    
    XGetWMNormalHints() doesn't actually return a Status value.  On success
    it returns a non-zero value, not Success.
    
    Signed-off-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 1efe96a..3156e36 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -1785,8 +1785,7 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
         long supplied;
 
         if (normal_hint &&
-            (XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied) ==
-             Success)) {
+            XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied)) {
             if (normal_hint->flags & PMaxSize) {
                 /* Not maximizable if a maximum size is specified */
                 hint |= HINT_NOMAXIMIZE;
commit 9dc32746f2cd161b512cce8f39c95287bdf1a3a3
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Tue Nov 10 10:27:07 2015 +0000

    xwin: Fix format warnings when ./configured --enable-debug --enable-windowswm
    
    Fix format warnings (mainly pointer format fixes) which show up when
    ./configured --enable-debug --enable-windowswm
    
    Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
index 660a78f..8fe6f42 100644
--- a/hw/xwin/winwin32rootless.c
+++ b/hw/xwin/winwin32rootless.c
@@ -541,7 +541,7 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
 
     if (pRLNextWinPriv == NULL) {
 #if CYGMULTIWINDOW_DEBUG
-        winDebug("Win %08x is top\n", pRLWinPriv);
+        winDebug("Win %p is top\n", pRLWinPriv);
 #endif
         pScreenPriv->widTop = wid;
         SetWindowPos(pRLWinPriv->hWnd, HWND_TOP,
@@ -550,7 +550,7 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
     else if (winIsInternalWMRunning(pScreenInfo)) {
         /* using mulwinidow wm */
 #if CYGMULTIWINDOW_DEBUG
-        winDebug("Win %08x is not top\n", pRLWinPriv);
+        winDebug("Win %p is not top\n", pRLWinPriv);
 #endif
         for (hWnd = GetNextWindow(pRLWinPriv->hWnd, GW_HWNDPREV);
              fNeedRestack && hWnd != NULL;
@@ -563,7 +563,7 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
                     /* Enable interleave X window and Windows window */
                     if (!fFirst) {
 #if CYGMULTIWINDOW_DEBUG
-                        winDebug("raise: Insert after Win %08x\n",
+                        winDebug("raise: Insert after Win %p\n",
                                  pRLNextWinPriv);
 #endif
                         SetWindowPos(pRLWinPriv->hWnd, pRLNextWinPriv->hWnd,
@@ -592,7 +592,7 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
                 && GetProp(hWnd, WIN_WINDOW_PROP)) {
                 if (hWnd == pRLNextWinPriv->hWnd) {
 #if CYGMULTIWINDOW_DEBUG
-                    winDebug("lower: Insert after Win %08x\n", pRLNextWinPriv);
+                    winDebug("lower: Insert after Win %p\n", pRLNextWinPriv);
 #endif
                     SetWindowPos(pRLWinPriv->hWnd, pRLNextWinPriv->hWnd,
                                  0, 0, 0, 0,
diff --git a/hw/xwin/winwin32rootlesswindow.c b/hw/xwin/winwin32rootlesswindow.c
index 1faa531..ba4fb51 100644
--- a/hw/xwin/winwin32rootlesswindow.c
+++ b/hw/xwin/winwin32rootlesswindow.c
@@ -402,7 +402,7 @@ winMWExtWMRestackWindows(ScreenPtr pScreen)
 
 #if CYGMULTIWINDOW_DEBUG
                 winDebug
-                    ("winMWExtWMRestackWindows - DeferWindowPos (%08x, %08x)\n",
+                    ("winMWExtWMRestackWindows - DeferWindowPos (%p, %p)\n",
                      pRLWin->hWnd, pRLWinPrev ? pRLWinPrev->hWnd : HWND_TOP);
 #endif
                 hWinPosInfo = DeferWindowPos(hWinPosInfo, pRLWin->hWnd,
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
index 79d9591..47de608 100644
--- a/hw/xwin/winwin32rootlesswndproc.c
+++ b/hw/xwin/winwin32rootlesswndproc.c
@@ -417,12 +417,12 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         winDebugWin32Message("winMWExtWMWindowProc", hwnd, message, wParam,
                              lParam);
 
-        winDebug("\thWnd %08X\n", hwnd);
-        winDebug("\tpScreenPriv %08X\n", pScreenPriv);
-        winDebug("\tpScreenInfo %08X\n", pScreenInfo);
-        winDebug("\thwndScreen %08X\n", hwndScreen);
-        winDebug("winMWExtWMWindowProc (%08x) %08x %08x %08x\n",
-                 pRLWinPriv, message, wParam, lParam);
+        winDebug("\thWnd %p\n", hwnd);
+        winDebug("\tpScreenPriv %p\n", pScreenPriv);
+        winDebug("\tpScreenInfo %p\n", pScreenInfo);
+        winDebug("\thwndScreen %p\n", hwndScreen);
+        winDebug("winMWExtWMWindowProc (%p) %08x %08x %08x\n",
+                 pRLWinPriv, message, (int)wParam, (int)lParam);
 #endif
     }
     /* Branch on message type */
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index db41d6b..b9399fa 100644
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -312,7 +312,7 @@ ProcWindowsWMFrameGetRect(ClientPtr client)
     REQUEST(xWindowsWMFrameGetRectReq);
 
 #if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameGetRect %d %d\n",
+    ErrorF("ProcWindowsWMFrameGetRect %zu %d\n",
            (sizeof(xWindowsWMFrameGetRectReq) >> 2), (int) client->req_len);
 #endif
 


More information about the xorg-commit mailing list