xserver: Branch 'master' - 13 commits

Adam Jackson ajax at kemper.freedesktop.org
Wed Mar 9 19:01:34 UTC 2016


 hw/xwin/InitOutput.c              |   87 --------------
 hw/xwin/man/XWin.man              |    7 -
 hw/xwin/win.h                     |   27 ----
 hw/xwin/winallpriv.c              |    7 -
 hw/xwin/winconfig.c               |    5 
 hw/xwin/winengine.c               |    2 
 hw/xwin/winglobals.c              |    1 
 hw/xwin/winglobals.h              |    1 
 hw/xwin/winmsg.c                  |   33 -----
 hw/xwin/winmsg.h                  |   17 +-
 hw/xwin/winmultiwindowwindow.c    |   16 --
 hw/xwin/winmultiwindowwm.c        |   59 +--------
 hw/xwin/winprocarg.c              |   13 --
 hw/xwin/winscrinit.c              |   10 -
 hw/xwin/winshadddnl.c             |    6 -
 hw/xwin/winshadgdi.c              |   12 --
 hw/xwin/winwin32rootless.c        |   65 ----------
 hw/xwin/winwin32rootlesswindow.c  |   13 --
 hw/xwin/winwin32rootlesswndproc.c |  227 --------------------------------------
 hw/xwin/winwindow.h               |    5 
 hw/xwin/winwndproc.c              |   46 -------
 21 files changed, 39 insertions(+), 620 deletions(-)

New commits:
commit d11fdff50c91575e977a63617806a61bca98cd35
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Fri Jan 3 13:21:40 2014 +0000

    hw/xwin: Tidy-up of winmsg.h
    
    - winVMsg() has no uses, so remove
    - winMsgVerb() has only one use, with default verbosity, so remove
    - winMsg() is identical to LogMessage()
    - Put winDrvMsg() and winDrvMsgVerb() under XWIN_XF86CONFIG
    - Include what you use Xfuncproto.h for _X_ATTRIBUTE_PRINTF
    
    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 fb99113..31894d2 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -264,8 +264,9 @@ winConfigKeyboard(DeviceIntPtr pDevice)
                 break;
             }
             g_winInfo.keyboard.rate = (kbd_speed > 0) ? kbd_speed : 1;
-            winMsgVerb(X_PROBED, 1, "Setting autorepeat to delay=%ld, rate=%ld\n",
-                       g_winInfo.keyboard.delay, g_winInfo.keyboard.rate);
+            winMsg(X_PROBED, "Setting autorepeat to delay=%ld, rate=%ld\n",
+                   g_winInfo.keyboard.delay, g_winInfo.keyboard.rate);
+
         }
     }
 
diff --git a/hw/xwin/winmsg.c b/hw/xwin/winmsg.c
index 575bc47..2ee48ce 100644
--- a/hw/xwin/winmsg.c
+++ b/hw/xwin/winmsg.c
@@ -38,17 +38,7 @@
 #endif
 #include <stdarg.h>
 
-void
-winVMsg(int, MessageType, int verb, const char *, va_list)
-_X_ATTRIBUTE_PRINTF(4, 0);
-
-void
-winVMsg(int scrnIndex, MessageType type, int verb, const char *format,
-        va_list ap)
-{
-    LogVMessageVerb(type, verb, format, ap);
-}
-
+#ifdef XWIN_XF86CONFIG
 void
 winDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
 {
@@ -60,16 +50,6 @@ winDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
 }
 
 void
-winMsg(MessageType type, const char *format, ...)
-{
-    va_list ap;
-
-    va_start(ap, format);
-    LogVMessageVerb(type, 1, format, ap);
-    va_end(ap);
-}
-
-void
 winDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
               ...)
 {
@@ -79,16 +59,7 @@ winDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
     LogVMessageVerb(type, verb, format, ap);
     va_end(ap);
 }
-
-void
-winMsgVerb(MessageType type, int verb, const char *format, ...)
-{
-    va_list ap;
-
-    va_start(ap, format);
-    LogVMessageVerb(type, verb, format, ap);
-    va_end(ap);
-}
+#endif
 
 void
 winErrorFVerb(int verb, const char *format, ...)
diff --git a/hw/xwin/winmsg.h b/hw/xwin/winmsg.h
index 6c96c40..02f672f 100644
--- a/hw/xwin/winmsg.h
+++ b/hw/xwin/winmsg.h
@@ -1,5 +1,3 @@
-#ifndef __WIN_MSG_H__
-#define __WIN_MSG_H__
 /*
  *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
  *
@@ -30,12 +28,17 @@
  * Authors: Alexander Gottwald	
  */
 
+#ifndef __WIN_MSG_H__
+#define __WIN_MSG_H__
+
 #include <X11/Xwindows.h>
+#include <X11/Xfuncproto.h>
 
 /*
  * Function prototypes
  */
 
+#ifdef XWIN_XF86CONFIG
 void
 winDrvMsgVerb(int scrnIndex,
               MessageType type, int verb, const char *format, ...)
@@ -43,12 +46,10 @@ _X_ATTRIBUTE_PRINTF(4, 5);
 void
 winDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
 _X_ATTRIBUTE_PRINTF(3, 4);
-void
-winMsgVerb(MessageType type, int verb, const char *format, ...)
-_X_ATTRIBUTE_PRINTF(3, 4);
-void
-winMsg(MessageType type, const char *format, ...)
-_X_ATTRIBUTE_PRINTF(2, 3);
+#endif
+
+#define winMsg LogMessage
+
 void
 winDebug(const char *format, ...)
 _X_ATTRIBUTE_PRINTF(1, 2);
commit 519b98765f0c7d083a744ae7beb641753e4eb751
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Thu Mar 3 22:32:28 2016 +0000

    hw/xwin: Remove GC privates, unused since native GDI engine removal
    
    Unused since native GDI engine removal in commit 8465ee78
    
    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/win.h b/hw/xwin/win.h
index 0574707..f9c44b3 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -293,15 +293,6 @@ typedef Bool (*winReleasePrimarySurfaceProcPtr) (ScreenPtr);
 typedef Bool (*winCreateScreenResourcesProc) (ScreenPtr);
 
 /*
- * GC (graphics context) privates
- */
-
-typedef struct {
-    HDC hdc;
-    HDC hdcMem;
-} winPrivGCRec, *winPrivGCPtr;
-
-/*
  * Pixmap privates
  */
 
@@ -324,6 +315,7 @@ typedef struct {
     PALETTEENTRY peColors[WIN_NUM_PALETTE_ENTRIES];
 } winPrivCmapRec, *winPrivCmapPtr;
 
+
 /*
  * Windows Cursor handling.
  */
diff --git a/hw/xwin/winallpriv.c b/hw/xwin/winallpriv.c
index 816b030..e25e6bd 100644
--- a/hw/xwin/winallpriv.c
+++ b/hw/xwin/winallpriv.c
@@ -79,13 +79,6 @@ winAllocatePrivates(ScreenPtr pScreen)
     /* Save the screen private pointer */
     winSetScreenPriv(pScreen, pScreenPriv);
 
-    /* Reserve GC memory for our privates */
-    if (!dixRegisterPrivateKey
-        (g_iGCPrivateKey, PRIVATE_GC, sizeof(winPrivGCRec))) {
-        ErrorF("winAllocatePrivates - AllocateGCPrivate () failed\n");
-        return FALSE;
-    }
-
     /* Reserve Pixmap memory for our privates */
     if (!dixRegisterPrivateKey
         (g_iPixmapPrivateKey, PRIVATE_PIXMAP, sizeof(winPrivPixmapRec))) {
commit 9d28ff2a9be86662f56463aa1fd46d12988e30fa
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Fri Jul 31 20:23:59 2015 +0100

    hw/xwin: Use NULL rather than NoopDDA for unimplemented engine functions
    
    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/win.h b/hw/xwin/win.h
index d72114f..0574707 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -162,7 +162,6 @@
 #include "mipointer.h"
 #include "X11/keysym.h"
 #include "micoord.h"
-#include "dix.h"
 #include "miline.h"
 #include "shadow.h"
 #include "fb.h"
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index c84bf56..22836c5 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -1143,10 +1143,8 @@ winSetEngineFunctionsShadowGDI(ScreenPtr pScreen)
     pScreenPriv->pwinStoreColors = winStoreColorsShadowGDI;
     pScreenPriv->pwinCreateColormap = winCreateColormapShadowGDI;
     pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowGDI;
-    pScreenPriv->pwinCreatePrimarySurface =
-        (winCreatePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA;
-    pScreenPriv->pwinReleasePrimarySurface =
-        (winReleasePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA;
+    pScreenPriv->pwinCreatePrimarySurface = NULL;
+    pScreenPriv->pwinReleasePrimarySurface = NULL;
 
     return TRUE;
 }
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index b3b720b..7423643 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -290,22 +290,16 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                  * the display dimensions change.
                  */
 
-                /*
-                 * NOTE: The non-DirectDraw engines set the ReleasePrimarySurface
-                 * and CreatePrimarySurface function pointers to point
-                 * to the no operation function, NoopDDA.  This allows us
-                 * to blindly call these functions, even if they are not
-                 * relevant to the current engine (e.g., Shadow GDI).
-                 */
-
                 winDebug
                     ("winWindowProc - WM_DISPLAYCHANGE - Releasing and recreating primary surface\n");
 
                 /* Release the old primary surface */
-                (*s_pScreenPriv->pwinReleasePrimarySurface) (s_pScreen);
+                if (*s_pScreenPriv->pwinReleasePrimarySurface)
+                    (*s_pScreenPriv->pwinReleasePrimarySurface) (s_pScreen);
 
                 /* Create the new primary surface */
-                (*s_pScreenPriv->pwinCreatePrimarySurface) (s_pScreen);
+                if (*s_pScreenPriv->pwinCreatePrimarySurface)
+                    (*s_pScreenPriv->pwinCreatePrimarySurface) (s_pScreen);
             }
         }
 
commit a309085a56de4d30dfbc44d9ff5302c7d9fdbf73
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Fri Jul 31 20:20:00 2015 +0100

    hw/xwin: Remove unused FinishCreateWindowsWindow engine function
    
    This only ever had an (unused) implementation in the DDNL engine, which was
    removed in commit 57bbf6e2.
    
    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/win.h b/hw/xwin/win.h
index 927a08e..d72114f 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -291,8 +291,6 @@ typedef Bool (*winCreatePrimarySurfaceProcPtr) (ScreenPtr);
 
 typedef Bool (*winReleasePrimarySurfaceProcPtr) (ScreenPtr);
 
-typedef Bool (*winFinishCreateWindowsWindowProcPtr) (WindowPtr pWin);
-
 typedef Bool (*winCreateScreenResourcesProc) (ScreenPtr);
 
 /*
@@ -522,14 +520,8 @@ typedef struct _winPrivScreenRec {
     winDestroyColormapProcPtr pwinDestroyColormap;
     winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface;
     winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface;
-
     winCreateScreenResourcesProc pwinCreateScreenResources;
 
-#ifdef XWIN_MULTIWINDOW
-    /* Window Procedures for MultiWindow mode */
-    winFinishCreateWindowsWindowProcPtr pwinFinishCreateWindowsWindow;
-#endif
-
     /* Window Procedures for Rootless mode */
     CreateWindowProcPtr CreateWindow;
     DestroyWindowProcPtr DestroyWindow;
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 74d722c..6db576a 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -485,7 +485,6 @@ winCreateWindowsWindow(WindowPtr pWin)
     HWND hFore = NULL;
 
     winWindowPriv(pWin);
-    winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
     WinXSizeHints hints;
     Window daddyId;
     DWORD dwStyle, dwExStyle;
@@ -606,9 +605,6 @@ winCreateWindowsWindow(WindowPtr pWin)
 
     /* Flag that this Windows window handles its own activation */
     SetProp(hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0);
-
-    /* Call engine-specific create window procedure */
-    (*pScreenPriv->pwinFinishCreateWindowsWindow) (pWin);
 }
 
 Bool winInDestroyWindowsWindow = FALSE;
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 074ebf3..0ec5246 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -1213,10 +1213,6 @@ winSetEngineFunctionsShadowDDNL(ScreenPtr pScreen)
     pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDDNL;
     pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDDNL;
     pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDDNL;
-#ifdef XWIN_MULTIWINDOW
-    pScreenPriv->pwinFinishCreateWindowsWindow
-        = (winFinishCreateWindowsWindowProcPtr) (void (*)(void)) NoopDDA;
-#endif
 
     return TRUE;
 }
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index ba2e84e..c84bf56 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -1147,10 +1147,6 @@ winSetEngineFunctionsShadowGDI(ScreenPtr pScreen)
         (winCreatePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA;
     pScreenPriv->pwinReleasePrimarySurface =
         (winReleasePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA;
-#ifdef XWIN_MULTIWINDOW
-    pScreenPriv->pwinFinishCreateWindowsWindow =
-        (winFinishCreateWindowsWindowProcPtr) (void (*)(void)) NoopDDA;
-#endif
 
     return TRUE;
 }
commit fa6f9d06a3d1a90134d9349f5ce4ec5b4eeff5e3
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Fri Jul 31 20:12:37 2015 +0100

    hw/xwin: Remove unused HotKeyAltTab engine function
    
    This was only ever used by the primaryfb engine, removed in commit c79f824b
    
    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/win.h b/hw/xwin/win.h
index 3b8e93d..927a08e 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -287,8 +287,6 @@ typedef Bool (*winCreateColormapProcPtr) (ColormapPtr pColormap);
 
 typedef Bool (*winDestroyColormapProcPtr) (ColormapPtr pColormap);
 
-typedef Bool (*winHotKeyAltTabProcPtr) (ScreenPtr);
-
 typedef Bool (*winCreatePrimarySurfaceProcPtr) (ScreenPtr);
 
 typedef Bool (*winReleasePrimarySurfaceProcPtr) (ScreenPtr);
@@ -522,7 +520,6 @@ typedef struct _winPrivScreenRec {
     winStoreColorsProcPtr pwinStoreColors;
     winCreateColormapProcPtr pwinCreateColormap;
     winDestroyColormapProcPtr pwinDestroyColormap;
-    winHotKeyAltTabProcPtr pwinHotKeyAltTab;
     winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface;
     winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface;
 
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index d4f940e..074ebf3 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -1211,8 +1211,6 @@ winSetEngineFunctionsShadowDDNL(ScreenPtr pScreen)
     pScreenPriv->pwinStoreColors = winStoreColorsShadowDDNL;
     pScreenPriv->pwinCreateColormap = winCreateColormapShadowDDNL;
     pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDDNL;
-    pScreenPriv->pwinHotKeyAltTab =
-        (winHotKeyAltTabProcPtr) (void (*)(void)) NoopDDA;
     pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDDNL;
     pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDDNL;
 #ifdef XWIN_MULTIWINDOW
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index bf65517..ba2e84e 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -1143,8 +1143,6 @@ winSetEngineFunctionsShadowGDI(ScreenPtr pScreen)
     pScreenPriv->pwinStoreColors = winStoreColorsShadowGDI;
     pScreenPriv->pwinCreateColormap = winCreateColormapShadowGDI;
     pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowGDI;
-    pScreenPriv->pwinHotKeyAltTab =
-        (winHotKeyAltTabProcPtr) (void (*)(void)) NoopDDA;
     pScreenPriv->pwinCreatePrimarySurface =
         (winCreatePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA;
     pScreenPriv->pwinReleasePrimarySurface =
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index a2365a0..b3b720b 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -1107,14 +1107,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
             winFixShiftKeys(iScanCode);
         return 0;
 
-    case WM_HOTKEY:
-        if (s_pScreenPriv == NULL)
-            break;
-
-        /* Call the engine-specific hot key handler */
-        (*s_pScreenPriv->pwinHotKeyAltTab) (s_pScreen);
-        return 0;
-
     case WM_ACTIVATE:
         if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
             break;
commit 7bd25aa8437ec410e7a7de1b0636ba33298fc8d6
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Fri Jul 31 19:44:34 2015 +0100

    hw/xwin: Return FALSE to indicate failure in winSetEngine()
    
    Return FALSE to indicate failure in winSetEngine(), if it couldn't find a
    drawing engine to use
    
    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/winengine.c b/hw/xwin/winengine.c
index b8f8da0..d816851 100644
--- a/hw/xwin/winengine.c
+++ b/hw/xwin/winengine.c
@@ -203,7 +203,7 @@ winSetEngine(ScreenPtr pScreen)
         return TRUE;
     }
 
-    return TRUE;
+    return FALSE;
 }
 
 /*
commit 52e05b9282f0f220d7c762793ce0b8f606a45deb
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Tue Feb 23 23:09:43 2016 +0000

    hw/xwin: Remove WM_WM_MAP message, which is now unused
    
    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 54d9a8a..c5404cf 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -243,9 +243,6 @@ MessageName(winWMMessagePtr msg)
     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;
@@ -772,16 +769,6 @@ winMultiWindowWMProc(void *pArg)
             XLowerWindow(pWMInfo->pDisplay, pNode->msg.iWindow);
             break;
 
-        case WM_WM_MAP:
-            /* Put a note as to the HWND associated with this Window */
-            XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER,
-                            32,
-                            PropModeReplace,
-                            (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4);
-            UpdateName(pWMInfo, pNode->msg.iWindow);
-            UpdateIcon(pWMInfo, pNode->msg.iWindow);
-            break;
-
         case WM_WM_MAP2:
             XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER,
                             32,
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
index 129a77c..5a1759d 100644
--- a/hw/xwin/winwindow.h
+++ b/hw/xwin/winwindow.h
@@ -102,7 +102,6 @@ typedef struct _winWMMessageRec {
 #define		WM_WM_SIZE		(WM_USER + 2)
 #define		WM_WM_RAISE		(WM_USER + 3)
 #define		WM_WM_LOWER		(WM_USER + 4)
-#define		WM_WM_MAP		(WM_USER + 5)
 #define		WM_WM_UNMAP		(WM_USER + 6)
 #define		WM_WM_KILL		(WM_USER + 7)
 #define		WM_WM_ACTIVATE		(WM_USER + 8)
commit c42217aa3d372acaa5ca7c64895edbfbd20c8475
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Mon Nov 2 20:24:33 2015 +0000

    hw/xwin: Remove WM_(UN|)MANAGE messages, which are now never sent
    
    Remove fAnotherWMRunning which tracks this message (although since it was
    never initialized, I doubt this worked reliably), and the only use of that,
    which was to prevent winMWExtWMRestackWindows() from being used when the
    internalwm is running
    
    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/win.h b/hw/xwin/win.h
index f3d1eab..3b8e93d 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -404,7 +404,6 @@ typedef struct {
     Bool fDecoration;
 #ifdef XWIN_MULTIWINDOWEXTWM
     Bool fMWExtWM;
-    Bool fAnotherWMRunning;
 #endif
     Bool fRootless;
 #ifdef XWIN_MULTIWINDOW
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
index ab7d82b..5575f4b 100644
--- a/hw/xwin/winwin32rootlesswndproc.c
+++ b/hw/xwin/winwin32rootlesswndproc.c
@@ -1072,14 +1072,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                                     - wBorderWidth(pWin) * 2);
         break;
 
-    case WM_MANAGE:
-        ErrorF("winMWExtWMWindowProc - WM_MANAGE\n");
-        break;
-
-    case WM_UNMANAGE:
-        ErrorF("winMWExtWMWindowProc - WM_UNMANAGE\n");
-        break;
-
     default:
         break;
     }
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
index 0b2bf93..129a77c 100644
--- a/hw/xwin/winwindow.h
+++ b/hw/xwin/winwindow.h
@@ -112,8 +112,6 @@ typedef struct _winWMMessageRec {
 #define		WM_WM_MAP2		(WM_USER + 12)
 #define		WM_WM_MAP3		(WM_USER + 13)
 #define		WM_WM_HINTS_EVENT	(WM_USER + 14)
-#define		WM_MANAGE		(WM_USER + 100)
-#define		WM_UNMANAGE		(WM_USER + 102)
 
 #define		MwmHintsDecorations	(1L << 1)
 
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 5104c7b..a2365a0 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -1192,7 +1192,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 #ifdef XWIN_MULTIWINDOWEXTWM
         if (s_pScreenPriv->fActive) {
             /* Restack all window unless using built-in wm. */
-            if (s_pScreenInfo->fAnotherWMRunning)
+            if (s_pScreenInfo->fMWExtWM)
                 winMWExtWMRestackWindows(s_pScreen);
         }
 #endif
@@ -1256,18 +1256,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         }
         break;
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-    case WM_MANAGE:
-        ErrorF("winWindowProc - WM_MANAGE\n");
-        s_pScreenInfo->fAnotherWMRunning = FALSE;
-        break;
-
-    case WM_UNMANAGE:
-        ErrorF("winWindowProc - WM_UNMANAGE\n");
-        s_pScreenInfo->fAnotherWMRunning = TRUE;
-        break;
-#endif
-
     default:
         if (message == s_uTaskbarRestart) {
             winInitNotifyIcon(s_pScreenPriv);
commit b6bdf368420355332e41c604c523584bd39933f9
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Mon Nov 2 20:51:51 2015 +0000

    hw/xwin: Remove allowOtherWM, which is now always FALSE
    
    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 97b893f..54d9a8a 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -118,7 +118,6 @@ typedef struct _WMInfo {
     Atom atmWmDelete;
     Atom atmWmTakeFocus;
     Atom atmPrivMap;
-    Bool fAllowOtherWM;
 } WMInfoRec, *WMInfoPtr;
 
 typedef struct _WMProcArgRec {
@@ -184,9 +183,7 @@ static void
 #endif
 
 static Bool
-
-CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen,
-                          Bool fAllowOtherWM);
+CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen);
 
 static void
  winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle);
@@ -206,7 +203,6 @@ static XIOErrorHandler g_winMultiWindowXMsgProcOldIOErrorHandler;
 static pthread_t g_winMultiWindowXMsgProcThread;
 static Bool g_shutdown = FALSE;
 static Bool redirectError = FALSE;
-static Bool g_fAnotherWMRunning = FALSE;
 
 /*
  * Translate msg id to text, for debug purposes
@@ -739,11 +735,6 @@ winMultiWindowWMProc(void *pArg)
     for (;;) {
         WMMsgNodePtr pNode;
 
-        if (g_fAnotherWMRunning) {      /* Another Window manager exists. */
-            Sleep(1000);
-            continue;
-        }
-
         /* Pop a message off of our queue */
         pNode = PopMessage(&pWMInfo->wmMsgQueue, pWMInfo);
         if (pNode == NULL) {
@@ -1047,11 +1038,7 @@ winMultiWindowXMsgProc(void *pArg)
            "successfully opened the display.\n");
 
     /* Check if another window manager is already running */
-    g_fAnotherWMRunning =
-        CheckAnotherWindowManager(pProcArg->pDisplay, pProcArg->dwScreen,
-                                  pProcArg->pWMInfo->fAllowOtherWM);
-
-    if (g_fAnotherWMRunning && !pProcArg->pWMInfo->fAllowOtherWM) {
+    if (CheckAnotherWindowManager(pProcArg->pDisplay, pProcArg->dwScreen)) {
         ErrorF("winMultiWindowXMsgProc - "
                "another window manager is running.  Exiting.\n");
         pthread_exit(NULL);
@@ -1093,24 +1080,6 @@ winMultiWindowXMsgProc(void *pArg)
         if (g_shutdown)
             break;
 
-        if (pProcArg->pWMInfo->fAllowOtherWM && !XPending(pProcArg->pDisplay)) {
-            if (CheckAnotherWindowManager
-                (pProcArg->pDisplay, pProcArg->dwScreen, TRUE)) {
-                if (!g_fAnotherWMRunning) {
-                    g_fAnotherWMRunning = TRUE;
-                    SendMessage(pProcArg->hwndScreen, WM_UNMANAGE, 0, 0);
-                }
-            }
-            else {
-                if (g_fAnotherWMRunning) {
-                    g_fAnotherWMRunning = FALSE;
-                    SendMessage(pProcArg->hwndScreen, WM_MANAGE, 0, 0);
-                }
-            }
-            Sleep(500);
-            continue;
-        }
-
         /* Fetch next event */
         XNextEvent(pProcArg->pDisplay, &event);
 
@@ -1272,7 +1241,7 @@ winInitWM(void **ppWMInfo,
           pthread_t * ptWMProc,
           pthread_t * ptXMsgProc,
           pthread_mutex_t * ppmServerStarted,
-          int dwScreen, HWND hwndScreen, BOOL allowOtherWM)
+          int dwScreen, HWND hwndScreen)
 {
     WMProcArgPtr pArg = malloc(sizeof(WMProcArgRec));
     WMInfoPtr pWMInfo = malloc(sizeof(WMInfoRec));
@@ -1294,7 +1263,6 @@ winInitWM(void **ppWMInfo,
 
     /* Set a return pointer to the Window Manager info structure */
     *ppWMInfo = pWMInfo;
-    pWMInfo->fAllowOtherWM = allowOtherWM;
 
     /* Setup the argument structure for the thread function */
     pArg->dwScreen = dwScreen;
@@ -1575,8 +1543,7 @@ winRedirectErrorHandler(Display * pDisplay, XErrorEvent * pErr)
  */
 
 static Bool
-CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen,
-                          Bool fAllowOtherWM)
+CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen)
 {
     /*
        Try to select the events which only one client at a time is allowed to select.
@@ -1593,12 +1560,11 @@ CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen,
     /*
        Side effect: select the events we are actually interested in...
 
-       If other WMs are not allowed, also select one of the events which only one client
+       Other WMs are not allowed, also select one of the events which only one client
        at a time is allowed to select, so other window managers won't start...
      */
     XSelectInput(pDisplay, RootWindow(pDisplay, dwScreen),
-                 SubstructureNotifyMask | (!fAllowOtherWM ? ButtonPressMask :
-                                           0));
+                 SubstructureNotifyMask | ButtonPressMask);
     XSync(pDisplay, 0);
     return redirectError;
 }
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index f75b2f9..6cbf08d 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -544,8 +544,8 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
                        &pScreenPriv->ptWMProc,
                        &pScreenPriv->ptXMsgProc,
                        &pScreenPriv->pmServerStarted,
-                       pScreenInfo->dwScreen, (HWND) &pScreenPriv->hwndScreen,
-                       FALSE)) {
+                       pScreenInfo->dwScreen,
+                       (HWND) &pScreenPriv->hwndScreen)) {
             ErrorF("winFinishScreenInitFB - winInitWM () failed.\n");
             return FALSE;
         }
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
index 7e6bd56..0b2bf93 100644
--- a/hw/xwin/winwindow.h
+++ b/hw/xwin/winwindow.h
@@ -142,7 +142,7 @@ winInitWM(void **ppWMInfo,
           pthread_t * ptWMProc,
           pthread_t * ptXMsgProc,
           pthread_mutex_t * ppmServerStarted,
-          int dwScreen, HWND hwndScreen, BOOL allowOtherWM);
+          int dwScreen, HWND hwndScreen);
 
 void
  winDeinitMultiWindowWM(void);
commit 8407d3096287868b5c5e50ca5a98d470918c85a9
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Mon Nov 2 20:34:09 2015 +0000

    hw/xwin: Remove winIsInternalWMRunning(), which now always returns FALSE
    
    Also remove then unused variables and IsRaiseonClick()
    
    v2:
    Also remove unused pScreenInfo variable in winMWEXtWMRestackFrame()
    
    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/win.h b/hw/xwin/win.h
index d43771e..f3d1eab 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -1136,9 +1136,6 @@ winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv,
 
 wBOOL CALLBACK winMWExtWMDecorateWindow(HWND hwnd, LPARAM lParam);
 
-Bool
- winIsInternalWMRunning(winScreenInfoPtr pScreenInfo);
-
 void
  winMWExtWMRestackWindows(ScreenPtr pScreen);
 #endif
diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
index 8fe6f42..95b8452 100644
--- a/hw/xwin/winwin32rootless.c
+++ b/hw/xwin/winwin32rootless.c
@@ -516,12 +516,6 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
     win32RootlessWindowPtr pRLNextWinPriv = (win32RootlessWindowPtr) nextWid;
 
     winScreenPriv(pRLWinPriv->pFrame->win->drawable.pScreen);
-    winScreenInfo *pScreenInfo = NULL;
-    DWORD dwCurrentProcessID = GetCurrentProcessId();
-    DWORD dwWindowProcessID = 0;
-    HWND hWnd;
-    Bool fFirst = TRUE;
-    Bool fNeedRestack = TRUE;
 
 #if CYGMULTIWINDOW_DEBUG
     winDebug("winMWExtWMRestackFrame (%p)\n", pRLWinPriv);
@@ -530,9 +524,6 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
     if (pScreenPriv && pScreenPriv->fRestacking)
         return;
 
-    if (pScreenPriv)
-        pScreenInfo = pScreenPriv->pScreenInfo;
-
     pRLWinPriv->fRestackingNow = TRUE;
 
     /* Show window */
@@ -547,62 +538,6 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
         SetWindowPos(pRLWinPriv->hWnd, HWND_TOP,
                      0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
     }
-    else if (winIsInternalWMRunning(pScreenInfo)) {
-        /* using mulwinidow wm */
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("Win %p is not top\n", pRLWinPriv);
-#endif
-        for (hWnd = GetNextWindow(pRLWinPriv->hWnd, GW_HWNDPREV);
-             fNeedRestack && hWnd != NULL;
-             hWnd = GetNextWindow(hWnd, GW_HWNDPREV)) {
-            GetWindowThreadProcessId(hWnd, &dwWindowProcessID);
-
-            if ((dwWindowProcessID == dwCurrentProcessID)
-                && GetProp(hWnd, WIN_WINDOW_PROP)) {
-                if (hWnd == pRLNextWinPriv->hWnd) {
-                    /* Enable interleave X window and Windows window */
-                    if (!fFirst) {
-#if CYGMULTIWINDOW_DEBUG
-                        winDebug("raise: Insert after Win %p\n",
-                                 pRLNextWinPriv);
-#endif
-                        SetWindowPos(pRLWinPriv->hWnd, pRLNextWinPriv->hWnd,
-                                     0, 0, 0, 0,
-                                     SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
-                    }
-                    else {
-#if CYGMULTIWINDOW_DEBUG
-                        winDebug("No change\n");
-#endif
-                    }
-                    fNeedRestack = FALSE;
-                    break;
-                }
-                if (fFirst)
-                    fFirst = FALSE;
-            }
-        }
-
-        for (hWnd = GetNextWindow(pRLWinPriv->hWnd, GW_HWNDNEXT);
-             fNeedRestack && hWnd != NULL;
-             hWnd = GetNextWindow(hWnd, GW_HWNDNEXT)) {
-            GetWindowThreadProcessId(hWnd, &dwWindowProcessID);
-
-            if ((dwWindowProcessID == dwCurrentProcessID)
-                && GetProp(hWnd, WIN_WINDOW_PROP)) {
-                if (hWnd == pRLNextWinPriv->hWnd) {
-#if CYGMULTIWINDOW_DEBUG
-                    winDebug("lower: Insert after Win %p\n", pRLNextWinPriv);
-#endif
-                    SetWindowPos(pRLWinPriv->hWnd, pRLNextWinPriv->hWnd,
-                                 0, 0, 0, 0,
-                                 SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
-                    fNeedRestack = FALSE;
-                    break;
-                }
-            }
-        }
-    }
     else {
         /* using general wm like twm, wmaker etc.
            Interleave X window and Windows window will cause problem. */
diff --git a/hw/xwin/winwin32rootlesswindow.c b/hw/xwin/winwin32rootlesswindow.c
index 524051f..817cd09 100644
--- a/hw/xwin/winwin32rootlesswindow.c
+++ b/hw/xwin/winwin32rootlesswindow.c
@@ -194,10 +194,6 @@ winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv,
     /* Get current window placement */
     GetWindowPlacement(pRLWinPriv->hWnd, &wndPlace);
 
-    if (winIsInternalWMRunning(pScreenInfo)) {
-        if (!pRLWinPriv->pFrame->win->overrideRedirect)
-            fDecorate = TRUE;
-    }
 #if 0
     if (wndPlace.showCmd == SW_HIDE)
         return;                 //showCmd = SWP_HIDEWINDOW;
@@ -345,15 +341,6 @@ winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv,
 }
 
 /*
- * winIsInternalWMRunning (winScreenInfoPtr pScreenInfo)
- */
-Bool
-winIsInternalWMRunning(winScreenInfoPtr pScreenInfo)
-{
-    return FALSE;
-}
-
-/*
  * winMWExtWMRestackWindows
  */
 
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
index 6618c05..ab7d82b 100644
--- a/hw/xwin/winwin32rootlesswndproc.c
+++ b/hw/xwin/winwin32rootlesswndproc.c
@@ -60,9 +60,9 @@ static UINT_PTR g_uipMousePollingTimerID = 0;
  * Local function
  */
 
-DEFINE_ATOM_HELPER(AtmWindowsWmRaiseOnClick, WINDOWSWM_RAISE_ON_CLICK)
-    DEFINE_ATOM_HELPER(AtmWindowsWMMouseActivate, WINDOWSWM_MOUSE_ACTIVATE)
+DEFINE_ATOM_HELPER(AtmWindowsWMMouseActivate, WINDOWSWM_MOUSE_ACTIVATE)
 /* DEFINE_ATOM_HELPER(AtmWindowsWMClientWindow, WINDOWSWM_CLIENT_WINDOW) */
+
 /*
  * ConstrainSize - Taken from TWM sources - Respects hints for sizing
  */
@@ -272,55 +272,6 @@ ValidateSizing(HWND hwnd, WindowPtr pWin, WPARAM wParam, LPARAM lParam)
 }
 
 /*
- * IsRaiseOnClick
- */
-
-static Bool
-IsRaiseOnClick(WindowPtr pWin)
-{
-
-    struct _Window *pwin;
-    struct _Property *prop;
-
-    /* XXX We're getting inputInfo.poniter here, but this might be really wrong.
-     * Which pointer's current window do we want? */
-    WindowPtr pRoot = GetCurrentRootWindow(inputInfo.pointer);
-
-    if (!pWin) {
-        ErrorF("IsRaiseOnClick - no prop use default value:%d\n",
-               RAISE_ON_CLICK_DEFAULT);
-        return RAISE_ON_CLICK_DEFAULT;
-    }
-
-    pwin = (struct _Window *) pWin;
-
-    if (pwin->optional)
-        prop = (struct _Property *) pwin->optional->userProps;
-    else
-        prop = NULL;
-
-    while (prop) {
-        if (prop->propertyName == AtmWindowsWmRaiseOnClick()
-            && prop->type == XA_INTEGER && prop->format == 32) {
-            return *(int *) prop->data;
-        }
-        else
-            prop = prop->next;
-    }
-
-    if (pWin != pRoot) {
-        return IsRaiseOnClick(pRoot);
-    }
-    else {
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("IsRaiseOnClick - no prop use default value:%d\n",
-                 RAISE_ON_CLICK_DEFAULT);
-#endif
-        return RAISE_ON_CLICK_DEFAULT;
-    }
-}
-
-/*
  * IsMouseActive
  */
 
@@ -388,8 +339,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     PAINTSTRUCT ps;
     LPWINDOWPOS pWinPos = NULL;
     RECT rcClient;
-    winWMMessageRec wmMsg;
-    Bool fWMMsgInitialized = FALSE;
 
     /* Check if the Windows window property for our X window pointer is valid */
     if ((pRLWinPriv =
@@ -403,16 +352,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         if (pScreenPriv)
             hwndScreen = pScreenPriv->hwndScreen;
 
-        wmMsg.msg = 0;
-        wmMsg.hwndWindow = hwnd;
-        wmMsg.iWindow = (Window) pWin->drawable.id;
-
-        wmMsg.iX = pRLWinPriv->pFrame->x;
-        wmMsg.iY = pRLWinPriv->pFrame->y;
-        wmMsg.iWidth = pRLWinPriv->pFrame->width;
-        wmMsg.iHeight = pRLWinPriv->pFrame->height;
-
-        fWMMsgInitialized = TRUE;
 #if CYGDEBUG
         winDebugWin32Message("winMWExtWMWindowProc", hwnd, message, wParam,
                              lParam);
@@ -446,12 +385,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
             DestroyWindow(hwnd);
         }
         else {
-            if (winIsInternalWMRunning(pScreenInfo)) {
-                /* Tell our Window Manager thread to kill the window */
-                wmMsg.msg = WM_WM_KILL;
-                if (fWMMsgInitialized)
-                    winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
-            }
             winWindowsWMSendEvent(WindowsWMControllerNotify,
                                   WindowsWMControllerNotifyMask,
                                   1,
@@ -680,19 +613,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 #if CYGMULTIWINDOW_DEBUG
         winDebug("winMWExtWMWindowProc - WM_MOUSEACTIVATE\n");
 #endif
-#if 1
-        /* Check if this window needs to be made active when clicked */
-        if (winIsInternalWMRunning(pScreenInfo) && pWin->overrideRedirect) {
-#if CYGMULTIWINDOW_DEBUG
-            winDebug("winMWExtWMWindowProc - WM_MOUSEACTIVATE - "
-                     "MA_NOACTIVATE\n");
-#endif
-
-            /* */
-            return MA_NOACTIVATE;
-        }
-#endif
-        if (!winIsInternalWMRunning(pScreenInfo) && !IsMouseActive(pWin))
+        if (!IsMouseActive(pWin))
             return MA_NOACTIVATE;
 
         break;
@@ -805,19 +726,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         winDebug("winMWExtWMWindowProc - WM_ACTIVATE\n");
 #endif
         if (LOWORD(wParam) != WA_INACTIVE) {
-            if (winIsInternalWMRunning(pScreenInfo)) {
-#if 0
-                /* Raise the window to the top in Z order */
-                wmMsg.msg = WM_WM_RAISE;
-                if (fWMMsgInitialized)
-                    winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
-#endif
-                /* Tell our Window Manager thread to activate the window */
-                wmMsg.msg = WM_WM_ACTIVATE;
-                if (fWMMsgInitialized)
-                    if (!pWin || !pWin->overrideRedirect)       /* for OOo menus */
-                        winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
-            }
             winWindowsWMSendEvent(WindowsWMControllerNotify,
                                   WindowsWMControllerNotifyMask,
                                   1,
@@ -838,14 +746,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                 break;
             }
 
-            if (winIsInternalWMRunning(pScreenInfo) || IsRaiseOnClick(pWin)) {
-#if CYGMULTIWINDOW_DEBUG
-                winDebug("Win %p has WINDOWSWM_RAISE_ON_CLICK.\n",
-                         pRLWinPriv);
-#endif
-                break;
-            }
-
 #if CYGMULTIWINDOW_DEBUG
             winDebug("Win %p forbid to change z order (%p).\n",
                      pRLWinPriv,
@@ -889,9 +789,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                  (short) HIWORD(lParam));
 #endif
         if (!pRLWinPriv->fMovingOrSizing) {
-            if (winIsInternalWMRunning(pScreenInfo))
-                winAdjustXWindow(pWin, hwnd);
-
             winMWExtWMMoveXWindow(pWin, (LOWORD(lParam) - wBorderWidth(pWin)
                                          - GetSystemMetrics(SM_XVIRTUALSCREEN)),
                                   (HIWORD(lParam) - wBorderWidth(pWin)
@@ -909,26 +806,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
         winMWExtWMUpdateWindowDecoration(pRLWinPriv, pScreenInfo);
 
-        if (winIsInternalWMRunning(pScreenInfo)) {
-#if CYGMULTIWINDOW_DEBUG || TRUE
-            winDebug("\tMapWindow\n");
-#endif
-            /* Tell X to map the window */
-            MapWindow(pWin, wClient(pWin));
-
-            if (!pRLWinPriv->pFrame->win->overrideRedirect)
-                /* Bring the Windows window to the foreground */
-                SetForegroundWindow(hwnd);
-
-            /* Setup the Window Manager message */
-            wmMsg.msg = WM_WM_MAP;
-            wmMsg.iWidth = pRLWinPriv->pFrame->width;
-            wmMsg.iHeight = pRLWinPriv->pFrame->height;
-
-            /* Tell our Window Manager thread to map the window */
-            if (fWMMsgInitialized)
-                winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
-        }
         break;
 
     case WM_SIZING:
@@ -964,72 +841,12 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         if (pWinPos->flags & SWP_HIDEWINDOW)
             break;
 
-        /* Reorder if window z order was changed */
-        if ((pScreenPriv != NULL)
-            && !(pWinPos->flags & SWP_NOZORDER)
-            && !(pWinPos->flags & SWP_SHOWWINDOW)
-            && winIsInternalWMRunning(pScreenInfo)) {
-#if CYGMULTIWINDOW_DEBUG
-            winDebug("\twindow z order was changed\n");
-#endif
-            if (pWinPos->hwndInsertAfter == HWND_TOP
-                || pWinPos->hwndInsertAfter == HWND_TOPMOST
-                || pWinPos->hwndInsertAfter == HWND_NOTOPMOST) {
-#if CYGMULTIWINDOW_DEBUG
-                winDebug("\traise to top\n");
-#endif
-                /* Raise the window to the top in Z order */
-                wmMsg.msg = WM_WM_RAISE;
-                if (fWMMsgInitialized)
-                    winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
-            }
-#if 1
-            else if (pWinPos->hwndInsertAfter == HWND_BOTTOM) {
-            }
-            else {
-                /* Check if this window is top of X windows. */
-                HWND hWndAbove = NULL;
-                DWORD dwCurrentProcessID = GetCurrentProcessId();
-                DWORD dwWindowProcessID = 0;
-
-                for (hWndAbove = pWinPos->hwndInsertAfter;
-                     hWndAbove != NULL;
-                     hWndAbove = GetNextWindow(hWndAbove, GW_HWNDPREV)) {
-                    /* Ignore other XWin process's window */
-                    GetWindowThreadProcessId(hWndAbove, &dwWindowProcessID);
-
-                    if ((dwWindowProcessID == dwCurrentProcessID)
-                        && GetProp(hWndAbove, WIN_WINDOW_PROP)
-                        && !IsWindowVisible(hWndAbove)
-                        && !IsIconic(hWndAbove))        /* ignore minimized windows */
-                        break;
-                }
-                /* If this is top of X windows in Windows stack,
-                   raise it in X stack. */
-                if (hWndAbove == NULL) {
-#if CYGMULTIWINDOW_DEBUG
-                    winDebug("\traise to top\n");
-#endif
-                    /* Raise the window to the top in Z order */
-                    wmMsg.msg = WM_WM_RAISE;
-                    if (fWMMsgInitialized)
-                        winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
-                }
-            }
-#endif
-        }
-
         if (!(pWinPos->flags & SWP_NOSIZE)) {
             if (IsIconic(hwnd)) {
 #if CYGMULTIWINDOW_DEBUG
                 winDebug("\tIconic -> MINIMIZED\n");
 #endif
-                if (winIsInternalWMRunning(pScreenInfo)) {
-                    /* Raise the window to the top in Z order */
-                    wmMsg.msg = WM_WM_LOWER;
-                    if (fWMMsgInitialized)
-                        winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
-                }
+
                 winWindowsWMSendEvent(WindowsWMControllerNotify,
                                       WindowsWMControllerNotifyMask,
                                       1,
@@ -1069,8 +886,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 #if CYGMULTIWINDOW_DEBUG
                     winDebug("\tmove & resize\n");
 #endif
-                    if (winIsInternalWMRunning(pScreenInfo))
-                        winAdjustXWindow(pWin, hwnd);
 
                     winMWExtWMMoveResizeXWindow(pWin,
                                                 rcClient.left -
@@ -1092,8 +907,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 #if CYGMULTIWINDOW_DEBUG
                     winDebug("\tmove\n");
 #endif
-                    if (winIsInternalWMRunning(pScreenInfo))
-                        winAdjustXWindow(pWin, hwnd);
 
                     winMWExtWMMoveResizeXWindow(pWin,
                                                 rcClient.left -
@@ -1115,8 +928,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 #if CYGMULTIWINDOW_DEBUG
                     winDebug("\tmove\n");
 #endif
-                    if (winIsInternalWMRunning(pScreenInfo))
-                        winAdjustXWindow(pWin, hwnd);
 
                     winMWExtWMMoveXWindow(pWin,
                                           rcClient.left - wBorderWidth(pWin)
@@ -1129,8 +940,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 #if CYGMULTIWINDOW_DEBUG
                     winDebug("\tresize\n");
 #endif
-                    if (winIsInternalWMRunning(pScreenInfo))
-                        winAdjustXWindow(pWin, hwnd);
 
                     winMWExtWMResizeXWindow(pWin,
                                             rcClient.right - rcClient.left
@@ -1165,12 +974,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 #if CYGMULTIWINDOW_DEBUG
             winDebug("\tSIZE_MINIMIZED\n");
 #endif
-            if (winIsInternalWMRunning(pScreenInfo)) {
-                /* Raise the window to the top in Z order */
-                wmMsg.msg = WM_WM_LOWER;
-                if (fWMMsgInitialized)
-                    winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
-            }
+
             winWindowsWMSendEvent(WindowsWMControllerNotify,
                                   WindowsWMControllerNotifyMask,
                                   1,
@@ -1206,9 +1010,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
         /* Perform the resize and notify the X client */
         if (!pRLWinPriv->fMovingOrSizing) {
-            if (winIsInternalWMRunning(pScreenInfo))
-                winAdjustXWindow(pWin, hwnd);
-
             winMWExtWMResizeXWindow(pWin, (short) LOWORD(lParam)
                                     - wBorderWidth(pWin) * 2,
                                     (short) HIWORD(lParam)
@@ -1221,10 +1022,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         winDebug("winMWExtWMWindowProc - WM_ACTIVATEAPP\n");
 #endif
         if (wParam) {
-            if (winIsInternalWMRunning(pScreenInfo)) {
-            }
-            else {
-            }
             winWindowsWMSendEvent(WindowsWMActivationNotify,
                                   WindowsWMActivationNotifyMask,
                                   1,
@@ -1265,9 +1062,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
         MapWindowPoints(hwnd, HWND_DESKTOP, (LPPOINT) &rcClient, 2);
 
-        if (winIsInternalWMRunning(pScreenInfo))
-            winAdjustXWindow(pWin, hwnd);
-
         winMWExtWMMoveResizeXWindow(pWin, rcClient.left - wBorderWidth(pWin)
                                     - GetSystemMetrics(SM_XVIRTUALSCREEN),
                                     rcClient.top - wBorderWidth(pWin)
commit 2779a28a86a13831b334e8678cd4e838b3b38472
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Mon Nov 2 20:07:04 2015 +0000

    hw/xwin: Remove fInternalWM flag
    
    Remove the fInternalWM flag as it is now always FALSE after removing the
    -internalwm option
    
    v2:
    Also remove then unused pRLWinPriv local from pRLWinPriv()
    
    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/win.h b/hw/xwin/win.h
index 5710ea8..d43771e 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -404,7 +404,6 @@ typedef struct {
     Bool fDecoration;
 #ifdef XWIN_MULTIWINDOWEXTWM
     Bool fMWExtWM;
-    Bool fInternalWM;
     Bool fAnotherWMRunning;
 #endif
     Bool fRootless;
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 8b85785..74d722c 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -811,9 +811,6 @@ winMinimizeWindow(Window id)
     WindowPtr pWin;
     winPrivWinPtr pWinPriv;
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-    win32RootlessWindowPtr pRLWinPriv;
-#endif
     HWND hWnd;
     ScreenPtr pScreen = NULL;
     winPrivScreenPtr pScreenPriv = NULL;
@@ -833,16 +830,7 @@ winMinimizeWindow(Window id)
     if (pScreen)
         pScreenPriv = winGetScreenPriv(pScreen);
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-    if (pScreenPriv && pScreenPriv->pScreenInfo->fInternalWM) {
-        pRLWinPriv =
-            (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE);
-        hWnd = pRLWinPriv->hWnd;
-    }
-    else
-#else
     if (pScreenPriv)
-#endif
     {
         pWinPriv = winGetWindowPriv(pWin);
         hWnd = pWinPriv->hWnd;
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index bf70cf1..5c58480 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -130,7 +130,6 @@ winInitializeScreenDefaults(void)
     defaultScreenInfo.fDecoration = TRUE;
 #ifdef XWIN_MULTIWINDOWEXTWM
     defaultScreenInfo.fMWExtWM = FALSE;
-    defaultScreenInfo.fInternalWM = FALSE;
 #endif
     defaultScreenInfo.fRootless = FALSE;
 #ifdef XWIN_MULTIWINDOW
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 735ce93..f75b2f9 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -534,9 +534,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
 #ifdef XWIN_MULTIWINDOW
         || pScreenInfo->fMultiWindow
 #endif
-#ifdef XWIN_MULTIWINDOWEXTWM
-        || pScreenInfo->fInternalWM
-#endif
         ) {
 #if CYGDEBUG || YES
         winDebug("winFinishScreenInitFB - Calling winInitWM.\n");
@@ -548,9 +545,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
                        &pScreenPriv->ptXMsgProc,
                        &pScreenPriv->pmServerStarted,
                        pScreenInfo->dwScreen, (HWND) &pScreenPriv->hwndScreen,
-#ifdef XWIN_MULTIWINDOWEXTWM
-                       pScreenInfo->fInternalWM ||
-#endif
                        FALSE)) {
             ErrorF("winFinishScreenInitFB - winInitWM () failed.\n");
             return FALSE;
diff --git a/hw/xwin/winwin32rootlesswindow.c b/hw/xwin/winwin32rootlesswindow.c
index ba4fb51..524051f 100644
--- a/hw/xwin/winwin32rootlesswindow.c
+++ b/hw/xwin/winwin32rootlesswindow.c
@@ -350,7 +350,7 @@ winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv,
 Bool
 winIsInternalWMRunning(winScreenInfoPtr pScreenInfo)
 {
-    return pScreenInfo->fInternalWM && !pScreenInfo->fAnotherWMRunning;
+    return FALSE;
 }
 
 /*
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
index 47de608..6618c05 100644
--- a/hw/xwin/winwin32rootlesswndproc.c
+++ b/hw/xwin/winwin32rootlesswndproc.c
@@ -907,9 +907,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         if (!wParam)
             return 0;
 
-        if (!pScreenInfo->fInternalWM)  //XXXX
-            return 0;
-
         winMWExtWMUpdateWindowDecoration(pRLWinPriv, pScreenInfo);
 
         if (winIsInternalWMRunning(pScreenInfo)) {
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 123b84f..5104c7b 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -1192,7 +1192,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 #ifdef XWIN_MULTIWINDOWEXTWM
         if (s_pScreenPriv->fActive) {
             /* Restack all window unless using built-in wm. */
-            if (s_pScreenInfo->fInternalWM && s_pScreenInfo->fAnotherWMRunning)
+            if (s_pScreenInfo->fAnotherWMRunning)
                 winMWExtWMRestackWindows(s_pScreen);
         }
 #endif
@@ -1260,21 +1260,11 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     case WM_MANAGE:
         ErrorF("winWindowProc - WM_MANAGE\n");
         s_pScreenInfo->fAnotherWMRunning = FALSE;
-
-        if (s_pScreenInfo->fInternalWM) {
-            EnumThreadWindows(g_dwCurrentThreadID, winMWExtWMDecorateWindow, 0);
-            //RootlessRepositionWindows (s_pScreen);
-        }
         break;
 
     case WM_UNMANAGE:
         ErrorF("winWindowProc - WM_UNMANAGE\n");
         s_pScreenInfo->fAnotherWMRunning = TRUE;
-
-        if (s_pScreenInfo->fInternalWM) {
-            EnumThreadWindows(g_dwCurrentThreadID, winMWExtWMDecorateWindow, 0);
-            winMWExtWMRestackWindows(s_pScreen);
-        }
         break;
 #endif
 
commit 98238ece5756801a8a67b9235e42cb9ab2318633
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Mon Nov 2 19:37:40 2015 +0000

    hw/xwin: Ignore the obsolete, undocumented -internalwm option
    
    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/InitOutput.c b/hw/xwin/InitOutput.c
index 57e514f..1190124 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -745,10 +745,6 @@ winUseMsg(void)
 
     ErrorF("-ignoreinput\n" "\tIgnore keyboard and mouse input.\n");
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-    ErrorF("-internalwm\n" "\tRun the internal window manager.\n");
-#endif
-
 #ifdef XWIN_XF86CONFIG
     ErrorF("-keyboard\n"
            "\tSpecify a keyboard device from the configuration file.\n");
diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man
index 50fdba2..7ffdd6c 100644
--- a/hw/xwin/man/XWin.man
+++ b/hw/xwin/man/XWin.man
@@ -346,9 +346,6 @@ Color map manipulation is not supported, so the PseudoColor visual will
 not have the correct colors.
 This option is intended to allow applications which only work with a depth 8
 visual to operate in TrueColor modes.
-.TP 8
-.B \-internalwm
-Run the internal window manager.
 
 .SH LOG FILE
 As it runs \fIXWin\fP writes messages indicating the most relevant events
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 2bf6560..bf70cf1 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -577,11 +577,8 @@ ddxProcessArgument(int argc, char *argv[], int i)
      * Look for the '-internalwm' argument
      */
     if (IS_OPTION("-internalwm")) {
-        if (!screenInfoPtr->fMultiMonitorOverride)
-            screenInfoPtr->fMultipleMonitors = TRUE;
-        screenInfoPtr->fMWExtWM = TRUE;
-        screenInfoPtr->fInternalWM = TRUE;
-
+        ErrorF("Ignoring obsolete -internalwm option\n");
+        /* Ignored, but we still accept the arg for backwards compatibility */
         /* Indicate that we have processed this argument */
         return 1;
     }
commit cdeaebad9889d81d2698b8a10fec5e55d8dec7a1
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Tue Mar 1 21:37:05 2016 +0000

    hw/xwin: Remove the long-broken -silent-dup-error option
    
    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/InitOutput.c b/hw/xwin/InitOutput.c
index b6f2583..57e514f 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -76,9 +76,6 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
  * Function prototypes
  */
 
-static Bool
- winCheckDisplayNumber(void);
-
 void
  winLogCommandLine(int argc, char *argv[]);
 
@@ -824,11 +821,6 @@ winUseMsg(void)
            "\t -screen 0 1024x768 at 3        ; 3rd monitor size 1024x768\n"
            "\t -screen 0 @1 ; on 1st monitor using its full resolution (the default)\n");
 
-    ErrorF("-silent-dup-error\n"
-           "\tIf another instance of " EXECUTABLE_NAME
-           " with the same display number is running\n"
-           "\texit silently and don't display any error message.\n");
-
     ErrorF("-swcursor\n"
            "\tDisable the usage of the Windows cursor and use the X11 software\n"
            "\tcursor instead.\n");
@@ -918,14 +910,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
                    "Exiting.\n");
     }
 
-    /* Check for duplicate invocation on same display number. */
-    if (serverGeneration == 1 && !winCheckDisplayNumber()) {
-        if (g_fSilentDupError)
-            g_fSilentFatalError = TRUE;
-        FatalError("InitOutput - Duplicate invocation on display "
-                   "number: %s.  Exiting.\n", display);
-    }
-
 #ifdef XWIN_XF86CONFIG
     /* Try to read the xorg.conf-style configuration file */
     if (!winReadConfigfile())
@@ -1050,70 +1034,3 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
     winDebug("InitOutput - Returning.\n");
 #endif
 }
-
-/*
- * winCheckDisplayNumber - Check if another instance of Cygwin/X is
- * already running on the same display number.  If no one exists,
- * make a mutex to prevent new instances from running on the same display.
- *
- * return FALSE if the display number is already used.
- */
-
-static Bool
-winCheckDisplayNumber(void)
-{
-    int nDisp;
-    HANDLE mutex;
-    char name[MAX_PATH];
-    const char *pszPrefix = '\0';
-    OSVERSIONINFO osvi = { 0 };
-
-    /* Check display range */
-    nDisp = atoi(display);
-    if (nDisp < 0 || nDisp > 65535) {
-        ErrorF("winCheckDisplayNumber - Bad display number: %d\n", nDisp);
-        return FALSE;
-    }
-
-    /* Set first character of mutex name to null */
-    name[0] = '\0';
-
-    /* Get operating system version information */
-    osvi.dwOSVersionInfoSize = sizeof(osvi);
-    GetVersionEx(&osvi);
-
-    /* Want a mutex shared among all terminals on NT > 4.0 */
-    if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5) {
-        pszPrefix = "Global\\";
-    }
-
-    /* Setup Cygwin/X specific part of name */
-    snprintf(name, sizeof(name), "%sCYGWINX_DISPLAY:%d", pszPrefix, nDisp);
-
-    /* Windows automatically releases the mutex when this process exits */
-    mutex = CreateMutex(NULL, FALSE, name);
-    if (!mutex) {
-        LPVOID lpMsgBuf;
-
-        /* Display a fancy error message */
-        FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                      FORMAT_MESSAGE_FROM_SYSTEM |
-                      FORMAT_MESSAGE_IGNORE_INSERTS,
-                      NULL,
-                      GetLastError(),
-                      MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                      (LPTSTR) &lpMsgBuf, 0, NULL);
-        ErrorF("winCheckDisplayNumber - CreateMutex failed: %s\n",
-               (LPSTR) lpMsgBuf);
-        LocalFree(lpMsgBuf);
-
-        return FALSE;
-    }
-    if (GetLastError() == ERROR_ALREADY_EXISTS) {
-        ErrorF("winCheckDisplayNumber - "
-               PROJECT_NAME " is already running on display %d\n", nDisp);
-        return FALSE;
-    }
-
-    return TRUE;
-}
diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man
index d68ee2a..50fdba2 100644
--- a/hw/xwin/man/XWin.man
+++ b/hw/xwin/man/XWin.man
@@ -305,10 +305,6 @@ and for \fIlevel\fP=3 detailed log
 information (including trace and debug output) is produced.  Bigger
 values will yield a still more detailed debug output.
 .TP 8
-.B \-silent-dup-error
-If another instance of \fIXWin\fP with the same display number is found running,
-exit silently and don't display any error message.
-.TP 8
 .B "\-xkblayout \fIlayout\fP"
 .TP 8
 .B "\-xkbmodel \fImodel\fP"
diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c
index 1382c89..66019b4 100644
--- a/hw/xwin/winglobals.c
+++ b/hw/xwin/winglobals.c
@@ -76,7 +76,6 @@ DWORD g_dwCurrentThreadID = 0;
 Bool g_fKeyboardHookLL = FALSE;
 Bool g_fNoHelpMessageBox = FALSE;
 Bool g_fSoftwareCursor = FALSE;
-Bool g_fSilentDupError = FALSE;
 Bool g_fNativeGl = TRUE;
 Bool g_fHostInTitle = TRUE;
 pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER;
diff --git a/hw/xwin/winglobals.h b/hw/xwin/winglobals.h
index d7b813d..d143fb8 100644
--- a/hw/xwin/winglobals.h
+++ b/hw/xwin/winglobals.h
@@ -52,7 +52,6 @@ extern Bool g_fAuthEnabled;
 extern Bool g_fXdmcpEnabled;
 
 extern Bool g_fNoHelpMessageBox;
-extern Bool g_fSilentDupError;
 extern Bool g_fNativeGl;
 extern Bool g_fHostInTitle;
 
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 73aa027..2bf6560 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -1078,11 +1078,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
         return 1;
     }
 
-    if (IS_OPTION("-silent-dup-error")) {
-        g_fSilentDupError = TRUE;
-        return 1;
-    }
-
     if (IS_OPTION("-wgl")) {
         g_fNativeGl = TRUE;
         return 1;


More information about the xorg-commit mailing list