xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed May 1 14:28:53 UTC 2019


 configure.ac                      |   12 
 hw/xwin/InitOutput.c              |    5 
 hw/xwin/Makefile.am               |   15 
 hw/xwin/glx/Makefile.am           |    7 
 hw/xwin/glx/winpriv.c             |   23 
 hw/xwin/man/XWin.man              |    5 
 hw/xwin/win.h                     |  131 ----
 hw/xwin/wincreatewnd.c            |   18 
 hw/xwin/winengine.c               |    3 
 hw/xwin/winglobals.h              |    4 
 hw/xwin/winprocarg.c              |   26 
 hw/xwin/winrandr.c                |    3 
 hw/xwin/winscrinit.c              |   51 -
 hw/xwin/wintrayicon.c             |    5 
 hw/xwin/winvalargs.c              |   31 -
 hw/xwin/winwin32rootless.c        |  965 ---------------------------------
 hw/xwin/winwin32rootlesswindow.c  |  420 --------------
 hw/xwin/winwin32rootlesswndproc.c | 1080 --------------------------------------
 hw/xwin/winwindowswm.c            |  596 --------------------
 hw/xwin/winwndproc.c              |   71 --
 meson.build                       |    2 
 21 files changed, 19 insertions(+), 3454 deletions(-)

New commits:
commit a2302de6feb43dd10b159661d5fe7d2036c6c020
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Thu Oct 13 14:20:14 2016 +0100

    hw/xwin: Remove mwextwm mode
    
    This has always been described as 'experimental'
    
    We don't think this has any users: This mode has been disabled in Cygwin
    packages since March 2016. We've never provided the xwinwm WM for x86_64
    Cygwin. No one has even asked where the option has gone.
    
    This leaves XQuartz as the only user of the rootless extension.
    
    Remove --enable-windowswm configure option
    Remove multiwindowextwm stuff from Makefiles
    Remove -mwextwm option
    Remove -mwextwm from man-page and help
    Un-ifdef XWIN_MULTIWINDOWEXTWM
    
    v2:
    Remove rootless include paths
    Remove windowswmproto from meson.build

diff --git a/configure.ac b/configure.ac
index 79ff7fa64..1107bd8b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -572,7 +572,6 @@ AC_ARG_ENABLE(xfree86-utils,     AS_HELP_STRING([--enable-xfree86-utils], [Build
 AC_ARG_ENABLE(vgahw,          AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes])
 AC_ARG_ENABLE(vbe,            AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes])
 AC_ARG_ENABLE(int10-module,     AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes])
-AC_ARG_ENABLE(windowswm,      AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no])
 AC_ARG_ENABLE(windowsdri,     AS_HELP_STRING([--enable-windowsdri], [Build XWin with WindowsDRI extension (default: auto)]), [WINDOWSDRI=$enableval], [WINDOWSDRI=auto])
 AC_ARG_ENABLE(libdrm,         AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes])
 AC_ARG_ENABLE(clientids,      AS_HELP_STRING([--disable-clientids], [Build Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], [CLIENTIDS=yes])
@@ -738,7 +737,6 @@ DGAPROTO="xf86dgaproto >= 2.0.99.1"
 GLPROTO="glproto >= 1.4.17"
 DMXPROTO="dmxproto >= 2.2.99.1"
 VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
-WINDOWSWMPROTO="windowswmproto"
 APPLEWMPROTO="applewmproto >= 1.4"
 LIBXSHMFENCE="xshmfence >= 1.1"
 
@@ -2079,15 +2077,6 @@ if test "x$XWIN" = xyes; then
 
 	PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm])
 
-	if test "x$WINDOWSWM" = xauto; then
-		PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no])
-	fi
-	if test "x$WINDOWSWM" = xyes ; then
-		PKG_CHECK_MODULES(WINDOWSWM, $WINDOWSWMPROTO)
-		XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS $WINDOWSWM_CFLAGS"
-		AC_DEFINE(ROOTLESS,1,[Build Rootless code])
-	fi
-
 	if test "x$WINDOWSDRI" = xauto; then
 		PKG_CHECK_EXISTS([windowsdriproto], [WINDOWSDRI=yes], [WINDOWSDRI=no])
 	fi
@@ -2144,7 +2133,6 @@ dnl XWin requires OpenGL spec files in order to generate wrapper code for native
 
 fi
 AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
-AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes])
 AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$GLX" = xyes])
 AM_CONDITIONAL(XWIN_WINDOWS_DRI, [test "x$XWIN" = xyes && test "x$WINDOWSDRI" = xyes])
 
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 796b567d1..ddbf04253 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -783,11 +783,6 @@ winUseMsg(void)
 
     ErrorF("-multiwindow\n" "\tRun the server in multi-window mode.\n");
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-    ErrorF("-mwextwm\n"
-           "\tRun the server in multi-window external window manager mode.\n");
-#endif
-
     ErrorF("-nodecoration\n"
            "\tDo not draw a window border, title bar, etc.  Windowed\n"
            "\tmode only.\n");
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 5f67a6eca..42fc9dd68 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -29,17 +29,6 @@ SRCS_MULTIWINDOW = \
 	winSetAppUserModelID.c
 MULTIWINDOW_SYS_LIBS = -lshlwapi -lole32
 
-if XWIN_MULTIWINDOWEXTWM
-SRCS_MULTIWINDOWEXTWM = \
-	winwin32rootless.c \
-	winwin32rootlesswindow.c \
-	winwin32rootlesswndproc.c \
-	winwindowswm.c
-DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM
-MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la
-MULTIWINDOWEXTWM_CFLAGS = -I$(top_srcdir)/miext/rootless
-endif
-
 SRCS_RANDR = \
 	winrandr.c
 
@@ -101,7 +90,6 @@ SRCS =	InitInput.c \
 	$(top_srcdir)/mi/miinitext.c \
 	$(SRCS_CLIPBOARD) \
 	$(SRCS_MULTIWINDOW) \
-	$(SRCS_MULTIWINDOWEXTWM) \
 	$(SRCS_RANDR)
 
 DEFS = \
@@ -117,7 +105,6 @@ XWIN_LIBS += \
 	$(top_builddir)/Xi/libXistubs.la
 
 XWin_DEPENDENCIES = \
-	$(MULTIWINDOWEXTWM_LIBS) \
 	$(XWIN_GLX_LIBS) \
 	$(XWIN_LIBS) \
 	$(CLIPBOARD_LIBS) \
@@ -125,7 +112,6 @@ XWin_DEPENDENCIES = \
 
 
 XWin_LDADD = \
-	$(MULTIWINDOWEXTWM_LIBS) \
 	$(XWIN_GLX_LIBS) \
 	$(XWIN_LIBS) \
 	$(CLIPBOARD_LIBS) \
@@ -154,7 +140,6 @@ AM_LFLAGS = -i
 AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
             $(XWINMODULES_CFLAGS) \
             -I$(top_srcdir) \
-            $(MULTIWINDOWEXTWM_CFLAGS) \
             -Wno-bad-function-cast
 
 xwinconfigdir = $(sysconfdir)/X11
diff --git a/hw/xwin/glx/Makefile.am b/hw/xwin/glx/Makefile.am
index 119fee404..ae9debe5c 100644
--- a/hw/xwin/glx/Makefile.am
+++ b/hw/xwin/glx/Makefile.am
@@ -20,20 +20,13 @@ endif
 libnativeGLthunk_la_SOURCES = \
 	glthunk.c
 
-if XWIN_MULTIWINDOWEXTWM
-DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM
-endif
-
 if XWIN_GLX_WINDOWS
 DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS
 endif
 
 DEFS = \
-	$(DEFS_MULTIWINDOWEXTWM) \
 	$(DEFS_GLX_WINDOWS)
 
-AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless
-
 AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
             $(XWINMODULES_CFLAGS) \
             -I$(top_srcdir) \
diff --git a/hw/xwin/glx/winpriv.c b/hw/xwin/glx/winpriv.c
index 8ed93aba3..d72c04786 100644
--- a/hw/xwin/glx/winpriv.c
+++ b/hw/xwin/glx/winpriv.c
@@ -63,24 +63,6 @@ winGetWindowInfo(WindowPtr pWin)
 
             return hwnd;
         }
-#ifdef XWIN_MULTIWINDOWEXTWM
-        /* check for multiwindow external wm mode */
-        if (pScreenInfo->fMWExtWM) {
-            win32RootlessWindowPtr pRLWinPriv
-                = (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE);
-
-            if (pRLWinPriv == NULL) {
-                ErrorF("winGetWindowInfo: window has no privates\n");
-                return hwnd;
-            }
-
-            if (pRLWinPriv->hWnd != NULL) {
-                /* copy window handle */
-                hwnd = pRLWinPriv->hWnd;
-            }
-            return hwnd;
-        }
-#endif
     }
     else {
         ScreenPtr pScreen = g_ScreenInfo[0].pScreen;
@@ -108,11 +90,6 @@ winCheckScreenAiglxIsSupported(ScreenPtr pScreen)
     if (pScreenInfo->fMultiWindow)
         return TRUE;
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-    if (pScreenInfo->fMWExtWM)
-        return TRUE;
-#endif
-
     return FALSE;
 }
 
diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man
index 2081ea1b9..2401f9f09 100644
--- a/hw/xwin/man/XWin.man
+++ b/hw/xwin/man/XWin.man
@@ -51,11 +51,6 @@ Also start the integrated \fIWindows\fP-based window manager.
 Run the server in rootless mode.
 The X server works on a window covering the whole screen but the root window
 is hidden from view.
-.TP 8
-.B \-mwextwm
-Experimental.
-The mode combines \fB\-rootless\fP mode drawing with native \fIWindows\fP
-window frames managed by the experimental external window manager \fIxwinwm\fP.
 .PP
 \fBNOTE:\fP \fI-multiwindow\fP mode uses its own internal window manager.
 All other modes require an external window manager in order to move, resize, and perform other
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index dda2cb548..27505caad 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -163,9 +163,6 @@
 #include "miline.h"
 #include "shadow.h"
 #include "fb.h"
-#ifdef XWIN_MULTIWINDOWEXTWM
-#include "rootless.h"
-#endif
 
 #include "mipict.h"
 #include "picturestr.h"
@@ -390,9 +387,6 @@ typedef struct {
 #endif
     Bool fFullScreen;
     Bool fDecoration;
-#ifdef XWIN_MULTIWINDOWEXTWM
-    Bool fMWExtWM;
-#endif
     Bool fRootless;
     Bool fMultiWindow;
     Bool fMultiMonitorOverride;
@@ -464,18 +458,10 @@ typedef struct _winPrivScreenRec {
     LPDIRECTDRAWCLIPPER pddcPrimary;
     BOOL fRetryCreateSurface;
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-    /* Privates used by multi-window external window manager */
-    RootlessFrameID widTop;
-    Bool fRestacking;
-#endif
-
     /* Privates used by multi-window */
     pthread_t ptWMProc;
     pthread_t ptXMsgProc;
     void *pWMInfo;
-
-    /* Privates used by both multi-window and rootless */
     Bool fRootWindowShown;
 
     /* Privates used for any module running in a seperate thread */
@@ -527,24 +513,6 @@ typedef struct _winPrivScreenRec {
     Bool fNativeGlActive;
 } winPrivScreenRec;
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-typedef struct {
-    RootlessWindowPtr pFrame;
-    HWND hWnd;
-    int dwWidthBytes;
-    BITMAPINFOHEADER *pbmihShadow;
-    HBITMAP hbmpShadow;
-    HDC hdcShadow;
-    HDC hdcScreen;
-    BOOL fResized;
-    BOOL fRestackingNow;
-    BOOL fClose;
-    BOOL fMovingOrSizing;
-    BOOL fDestroyed;            //for debug
-    char *pfb;
-} win32RootlessWindowRec, *win32RootlessWindowPtr;
-#endif
-
 typedef struct {
     void *value;
     XID id;
@@ -1009,105 +977,6 @@ winHandleIconMessage(HWND hwnd, UINT message,
 LRESULT CALLBACK
 winWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-/*
- * winwin32rootless.c
- */
-
-Bool
-
-winMWExtWMCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
-                      int newX, int newY, RegionPtr pShape);
-
-void
- winMWExtWMDestroyFrame(RootlessFrameID wid);
-
-void
-
-winMWExtWMMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY);
-
-void
-
-winMWExtWMResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
-                      int newX, int newY, unsigned int newW, unsigned int newH,
-                      unsigned int gravity);
-
-void
- winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid);
-
-void
- winMWExtWMReshapeFrame(RootlessFrameID wid, RegionPtr pShape);
-
-void
- winMWExtWMUnmapFrame(RootlessFrameID wid);
-
-void
-
-winMWExtWMStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow);
-
-void
- winMWExtWMStopDrawing(RootlessFrameID wid, Bool flush);
-
-void
- winMWExtWMUpdateRegion(RootlessFrameID wid, RegionPtr pDamage);
-
-void
-
-winMWExtWMDamageRects(RootlessFrameID wid, int count, const BoxRec * rects,
-                      int shift_x, int shift_y);
-
-void
- winMWExtWMRootlessSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin);
-
-void
-
-winMWExtWMCopyBytes(unsigned int width, unsigned int height,
-                    const void *src, unsigned int srcRowBytes,
-                    void *dst, unsigned int dstRowBytes);
-
-void
-
-winMWExtWMCopyWindow(RootlessFrameID wid, int dstNrects,
-                     const BoxRec * dstRects, int dx, int dy);
-#endif
-
-#ifdef XWIN_MULTIWINDOWEXTWM
-/*
- * winwin32rootlesswindow.c
- */
-
-void
- winMWExtWMReorderWindows(ScreenPtr pScreen);
-
-void
- winMWExtWMMoveXWindow(WindowPtr pWin, int x, int y);
-
-void
- winMWExtWMResizeXWindow(WindowPtr pWin, int w, int h);
-
-void
- winMWExtWMMoveResizeXWindow(WindowPtr pWin, int x, int y, int w, int h);
-
-void
-
-winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv,
-                                 winScreenInfoPtr pScreenInfo);
-
-wBOOL CALLBACK winMWExtWMDecorateWindow(HWND hwnd, LPARAM lParam);
-
-void
- winMWExtWMRestackWindows(ScreenPtr pScreen);
-#endif
-
-#ifdef XWIN_MULTIWINDOWEXTWM
-/*
- * winwin32rootlesswndproc.c
- */
-
-LRESULT CALLBACK
-winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
-#endif
-
 /*
  * winwindowswm.c
  */
diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c
index daa6daac9..d304f248f 100644
--- a/hw/xwin/wincreatewnd.c
+++ b/hw/xwin/wincreatewnd.c
@@ -152,9 +152,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
 
     /* Decorated or undecorated window */
     if (pScreenInfo->fDecoration
-#ifdef XWIN_MULTIWINDOWEXTWM
-        && !pScreenInfo->fMWExtWM
-#endif
         && !pScreenInfo->fRootless
         && !pScreenInfo->fMultiWindow
         ) {
@@ -214,9 +211,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
 
     /* Clean up the scrollbars flag, if necessary */
     if ((!pScreenInfo->fDecoration
-#ifdef XWIN_MULTIWINDOWEXTWM
-         || pScreenInfo->fMWExtWM
-#endif
          || pScreenInfo->fRootless
          || pScreenInfo->fMultiWindow
         )
@@ -235,9 +229,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
 
         /* Adjust the window width and height for borders and title bar */
         if (pScreenInfo->fDecoration
-#ifdef XWIN_MULTIWINDOWEXTWM
-            && !pScreenInfo->fMWExtWM
-#endif
             && !pScreenInfo->fRootless
             && !pScreenInfo->fMultiWindow
             ) {
@@ -284,9 +275,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
 
     /* Make sure window is no bigger than work area */
     if (TRUE
-#ifdef XWIN_MULTIWINDOWEXTWM
-        && !pScreenInfo->fMWExtWM
-#endif
         && !pScreenInfo->fMultiWindow
         ) {
         /* Trim window width to fit work area */
@@ -419,9 +407,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
 
     /* Show the window */
     if (FALSE
-#ifdef XWIN_MULTIWINDOWEXTWM
-        || pScreenInfo->fMWExtWM
-#endif
         || pScreenInfo->fMultiWindow
         ) {
         pScreenPriv->fRootWindowShown = FALSE;
@@ -436,9 +421,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
 
     /* Attempt to bring our window to the top of the display */
     if (TRUE
-#ifdef XWIN_MULTIWINDOWEXTWM
-        && !pScreenInfo->fMWExtWM
-#endif
         && !pScreenInfo->fRootless
         && !pScreenInfo->fMultiWindow
         ) {
diff --git a/hw/xwin/winengine.c b/hw/xwin/winengine.c
index 2336442c0..f82232424 100644
--- a/hw/xwin/winengine.c
+++ b/hw/xwin/winengine.c
@@ -147,9 +147,6 @@ winSetEngine(ScreenPtr pScreen)
 
     /* ShadowGDI is the only engine that supports Multi Window Mode */
     if (FALSE
-#ifdef XWIN_MULTIWINDOWEXTWM
-        || pScreenInfo->fMWExtWM
-#endif
         || pScreenInfo->fMultiWindow
         ) {
         winErrorFVerb(2,
diff --git a/hw/xwin/winglobals.h b/hw/xwin/winglobals.h
index 250085fbc..82fc1c5ec 100644
--- a/hw/xwin/winglobals.h
+++ b/hw/xwin/winglobals.h
@@ -82,10 +82,6 @@ extern DWORD g_dwCurrentThreadID;
 extern Bool g_fKeyboardHookLL;
 extern Bool g_fButton[3];
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-extern Bool g_fNoConfigureWindow;
-#endif
-
 extern pthread_mutex_t g_pmTerminating;
 
 #endif                          /* WINGLOBALS_H */
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 803e78f93..5dd878c30 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -126,9 +126,6 @@ winInitializeScreenDefaults(void)
     defaultScreenInfo.pfb = NULL;
     defaultScreenInfo.fFullScreen = FALSE;
     defaultScreenInfo.fDecoration = TRUE;
-#ifdef XWIN_MULTIWINDOWEXTWM
-    defaultScreenInfo.fMWExtWM = FALSE;
-#endif
     defaultScreenInfo.fRootless = FALSE;
     defaultScreenInfo.fMultiWindow = FALSE;
     defaultScreenInfo.fMultiMonitorOverride = FALSE;
@@ -550,29 +547,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
         return 1;
     }
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-    /*
-     * Look for the '-mwextwm' argument
-     */
-    if (IS_OPTION("-mwextwm")) {
-        if (!screenInfoPtr->fMultiMonitorOverride)
-            screenInfoPtr->fMultipleMonitors = TRUE;
-        screenInfoPtr->fMWExtWM = TRUE;
-
-        /* Indicate that we have processed this argument */
-        return 1;
-    }
-    /*
-     * Look for the '-internalwm' argument
-     */
-    if (IS_OPTION("-internalwm")) {
-        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;
-    }
-#endif
-
     /*
      * Look for the '-rootless' argument
      */
diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c
index 3e084221e..16caea742 100644
--- a/hw/xwin/winrandr.c
+++ b/hw/xwin/winrandr.c
@@ -170,9 +170,6 @@ winRandRScreenSetSize(ScreenPtr pScreen,
        resize the native display size
      */
     if (FALSE
-#ifdef XWIN_MULTIWINDOWEXTWM
-        || pScreenInfo->fMWExtWM
-#endif
         || pScreenInfo->fRootless
         || pScreenInfo->fMultiWindow
         ) {
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index c44df565f..d6a1fedc7 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -38,31 +38,6 @@
 #include "win.h"
 #include "winmsg.h"
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-static RootlessFrameProcsRec winMWExtWMProcs = {
-    winMWExtWMCreateFrame,
-    winMWExtWMDestroyFrame,
-
-    winMWExtWMMoveFrame,
-    winMWExtWMResizeFrame,
-    winMWExtWMRestackFrame,
-    winMWExtWMReshapeFrame,
-    winMWExtWMUnmapFrame,
-
-    winMWExtWMStartDrawing,
-    winMWExtWMStopDrawing,
-    winMWExtWMUpdateRegion,
-    winMWExtWMDamageRects,
-    winMWExtWMRootlessSwitchWindow,
-    NULL,                       //winMWExtWMDoReorderWindow,
-    NULL,                       //winMWExtWMHideWindow,
-    NULL,                       //winMWExtWMUpdateColorMap,
-
-    NULL,                       //winMWExtWMCopyBytes,
-    winMWExtWMCopyWindow
-};
-#endif
-
 /*
  * Determine what type of screen we are initializing
  * and call the appropriate procedure to intiailize
@@ -370,11 +345,7 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
 
     /* Initialize the shadow framebuffer layer */
     if ((pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
-         || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)
-#ifdef XWIN_MULTIWINDOWEXTWM
-        && !pScreenInfo->fMWExtWM
-#endif
-        ) {
+         || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)) {
 #if CYGDEBUG
         winDebug("winFinishScreenInitFB - Calling shadowSetup ()\n");
 #endif
@@ -389,23 +360,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
         pScreen->CreateScreenResources = winCreateScreenResources;
     }
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-    /* Handle multi-window external window manager mode */
-    if (pScreenInfo->fMWExtWM) {
-        winDebug("winScreenInit - MultiWindowExtWM - Calling RootlessInit\n");
-
-        RootlessInit(pScreen, &winMWExtWMProcs);
-
-        winDebug("winScreenInit - MultiWindowExtWM - RootlessInit returned\n");
-
-        rootless_CopyBytes_threshold = 0;
-        /* FIXME: How many? Profiling needed? */
-        rootless_CopyWindow_threshold = 1;
-
-        winWindowsWMExtensionInit();
-    }
-#endif
-
     /* Handle rootless mode */
     if (pScreenInfo->fRootless) {
         /* Define the WRAP macro temporarily for local use */
@@ -505,9 +459,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
     /* Set the ServerStarted flag to false */
     pScreenPriv->fServerStarted = FALSE;
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-    pScreenPriv->fRestacking = FALSE;
-#endif
 
     if (pScreenInfo->fMultiWindow) {
 #if CYGDEBUG || YES
diff --git a/hw/xwin/wintrayicon.c b/hw/xwin/wintrayicon.c
index a22ca24f2..5d1e6aefa 100644
--- a/hw/xwin/wintrayicon.c
+++ b/hw/xwin/wintrayicon.c
@@ -115,11 +115,6 @@ winHandleIconMessage(HWND hwnd, UINT message,
     case WM_LBUTTONUP:
         /* Restack and bring all windows to top */
         SetForegroundWindow (pScreenPriv->hwndScreen);
-
-#ifdef XWIN_MULTIWINDOWEXTWM
-        if (pScreenInfo->fMWExtWM)
-            winMWExtWMRestackWindows(pScreenInfo->pScreen);
-#endif
         break;
 
     case WM_LBUTTONDBLCLK:
diff --git a/hw/xwin/winvalargs.c b/hw/xwin/winvalargs.c
index 50587d4b3..585544eab 100644
--- a/hw/xwin/winvalargs.c
+++ b/hw/xwin/winvalargs.c
@@ -80,7 +80,7 @@ winValidateArgs(void)
     for (i = 0; i < g_iNumScreens; ++i) {
         /*
          * Check for any combination of
-         * -multiwindow, -mwextwm, and -rootless.
+         * -multiwindow and -rootless.
          */
         {
             int iCount = 0;
@@ -88,10 +88,7 @@ winValidateArgs(void)
             /* Count conflicting options */
             if (g_ScreenInfo[i].fMultiWindow)
                 ++iCount;
-#ifdef XWIN_MULTIWINDOWEXTWM
-            if (g_ScreenInfo[i].fMWExtWM)
-                ++iCount;
-#endif
+
             if (g_ScreenInfo[i].fRootless)
                 ++iCount;
 
@@ -101,52 +98,42 @@ winValidateArgs(void)
 
             /* Fail if two or more conflicting options */
             if (iCount > 1) {
-                ErrorF("winValidateArgs - Only one of -multiwindow, -mwextwm, "
+                ErrorF("winValidateArgs - Only one of -multiwindow "
                        "and -rootless can be specific at a time.\n");
                 return FALSE;
             }
         }
 
-        /* Check for -multiwindow or -mwextwm and Xdmcp */
+        /* Check for -multiwindow and Xdmcp */
         /* allow xdmcp if screen 0 is normal. */
         if (g_fXdmcpEnabled && !fHasNormalScreen0 && (FALSE
                                                       || g_ScreenInfo[i].
                                                       fMultiWindow
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-                                                      || g_ScreenInfo[i].
-                                                      fMWExtWM
-#endif
             )
             ) {
             ErrorF("winValidateArgs - Xdmcp (-query, -broadcast, or -indirect) "
-                   "is invalid with -multiwindow or -mwextwm.\n");
+                   "is invalid with -multiwindow.\n");
             return FALSE;
         }
 
-        /* Check for -multiwindow, -mwextwm, or -rootless and -fullscreen */
+        /* Check for -multiwindow or -rootless and -fullscreen */
         if (g_ScreenInfo[i].fFullScreen && (FALSE
                                             || g_ScreenInfo[i].fMultiWindow
-#ifdef XWIN_MULTIWINDOWEXTWM
-                                            || g_ScreenInfo[i].fMWExtWM
-#endif
                                             || g_ScreenInfo[i].fRootless)
             ) {
             ErrorF("winValidateArgs - -fullscreen is invalid with "
-                   "-multiwindow, -mwextwm, or -rootless.\n");
+                   "-multiwindow or -rootless.\n");
             return FALSE;
         }
 
-        /* Check for -multiwindow, -mwextwm, or -rootless and -nodecoration */
+        /* Check for -multiwindow or -rootless and -nodecoration */
         if (!g_ScreenInfo[i].fDecoration && (FALSE
                                             || g_ScreenInfo[i].fMultiWindow
-#ifdef XWIN_MULTIWINDOWEXTWM
-                                            || g_ScreenInfo[i].fMWExtWM
-#endif
                                             || g_ScreenInfo[i].fRootless)
             ) {
             ErrorF("winValidateArgs - -nodecoration is invalid with "
-                   "-multiwindow, -mwextwm, or -rootless.\n");
+                   "-multiwindow or -rootless.\n");
             return FALSE;
         }
 
diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
deleted file mode 100644
index 52806887f..000000000
--- a/hw/xwin/winwin32rootless.c
+++ /dev/null
@@ -1,965 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors:	Kensuke Matsuzaki
- *		Earle F. Philhower, III
- *		Harold L Hunt II
- */
-/*
- * Look at hw/darwin/quartz/xpr/xprFrame.c and hw/darwin/quartz/cr/crFrame.c
- */
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include "win.h"
-#include <winuser.h>
-#define _WINDOWSWM_SERVER_
-#include <X11/extensions/windowswmstr.h>
-#include "winmultiwindowclass.h"
-#include "winmultiwindowicons.h"
-#include <X11/Xatom.h>
-
-/*
- * Constant defines
- */
-
-#ifndef ULW_COLORKEY
-#define ULW_COLORKEY	0x00000001
-#endif
-#ifndef ULW_ALPHA
-#define ULW_ALPHA	0x00000002
-#endif
-#ifndef ULW_OPAQUE
-#define ULW_OPAQUE	0x00000004
-#endif
-#define AC_SRC_ALPHA	0x01
-
-/*
- * Local function
- */
-
-DEFINE_ATOM_HELPER(AtmWindowsWmNativeHwnd, WINDOWSWM_NATIVE_HWND)
-static void
-winMWExtWMSetNativeProperty(RootlessWindowPtr pFrame);
-
-/*
- * Global variables
- */
-
-Bool g_fNoConfigureWindow = FALSE;
-
-/*
- * Internal function to get the DIB format that is compatible with the screen
- * Fixme: Share code with winshadgdi.c
- */
-
-static
-Bool
-winMWExtWMQueryDIBFormat(win32RootlessWindowPtr pRLWinPriv,
-                         BITMAPINFOHEADER * pbmih)
-{
-    HBITMAP hbmp;
-
-#if CYGMULTIWINDOW_DEBUG
-    LPDWORD pdw = NULL;
-#endif
-
-    /* Create a memory bitmap compatible with the screen */
-    hbmp = CreateCompatibleBitmap(pRLWinPriv->hdcScreen, 1, 1);
-    if (hbmp == NULL) {
-        ErrorF("winMWExtWMQueryDIBFormat - CreateCompatibleBitmap failed\n");
-        return FALSE;
-    }
-
-    /* Initialize our bitmap info header */
-    ZeroMemory(pbmih, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
-    pbmih->biSize = sizeof(BITMAPINFOHEADER);
-
-    /* Get the biBitCount */
-    if (!GetDIBits(pRLWinPriv->hdcScreen,
-                   hbmp, 0, 1, NULL, (BITMAPINFO *) pbmih, DIB_RGB_COLORS)) {
-        ErrorF("winMWExtWMQueryDIBFormat - First call to GetDIBits failed\n");
-        DeleteObject(hbmp);
-        return FALSE;
-    }
-
-#if CYGMULTIWINDOW_DEBUG
-    /* Get a pointer to bitfields */
-    pdw = (DWORD *) ((CARD8 *) pbmih + sizeof(BITMAPINFOHEADER));
-
-    winDebug("winMWExtWMQueryDIBFormat - First call masks: %08x %08x %08x\n",
-             (unsigned int) pdw[0], (unsigned int) pdw[1],
-             (unsigned int) pdw[2]);
-#endif
-
-    /* Get optimal color table, or the optimal bitfields */
-    if (!GetDIBits(pRLWinPriv->hdcScreen,
-                   hbmp, 0, 1, NULL, (BITMAPINFO *) pbmih, DIB_RGB_COLORS)) {
-        ErrorF("winMWExtWMQueryDIBFormat - Second call to GetDIBits "
-               "failed\n");
-        DeleteObject(hbmp);
-        return FALSE;
-    }
-
-    /* Free memory */
-    DeleteObject(hbmp);
-
-    return TRUE;
-}
-
-static HRGN
-winMWExtWMCreateRgnFromRegion(RegionPtr pShape)
-{
-    int nRects;
-    BoxPtr pRects, pEnd;
-    HRGN hRgn, hRgnRect;
-
-    if (pShape == NULL)
-        return NULL;
-
-    nRects = RegionNumRects(pShape);
-    pRects = RegionRects(pShape);
-
-    hRgn = CreateRectRgn(0, 0, 0, 0);
-    if (hRgn == NULL) {
-        ErrorF("winReshape - Initial CreateRectRgn (%d, %d, %d, %d) "
-               "failed: %d\n", 0, 0, 0, 0, (int) GetLastError());
-    }
-
-    /* Loop through all rectangles in the X region */
-    for (pEnd = pRects + nRects; pRects < pEnd; pRects++) {
-        /* Create a Windows region for the X rectangle */
-        hRgnRect = CreateRectRgn(pRects->x1,
-                                 pRects->y1, pRects->x2, pRects->y2);
-        if (hRgnRect == NULL) {
-            ErrorF("winReshape - Loop CreateRectRgn (%d, %d, %d, %d) "
-                   "failed: %d\n",
-                   pRects->x1,
-                   pRects->y1, pRects->x2, pRects->y2, (int) GetLastError());
-        }
-
-        /* Merge the Windows region with the accumulated region */
-        if (CombineRgn(hRgn, hRgn, hRgnRect, RGN_OR) == ERROR) {
-            ErrorF("winReshape - CombineRgn () failed: %d\n",
-                   (int) GetLastError());
-        }
-
-        /* Delete the temporary Windows region */
-        DeleteObject(hRgnRect);
-    }
-
-    return hRgn;
-}
-
-static void
-InitWin32RootlessEngine(win32RootlessWindowPtr pRLWinPriv)
-{
-    pRLWinPriv->hdcScreen = GetDC(pRLWinPriv->hWnd);
-    pRLWinPriv->hdcShadow = CreateCompatibleDC(pRLWinPriv->hdcScreen);
-    pRLWinPriv->hbmpShadow = NULL;
-
-    /* Allocate bitmap info header */
-    pRLWinPriv->pbmihShadow =
-        malloc(sizeof(BITMAPINFOHEADER)
-               + 256 * sizeof(RGBQUAD));
-    if (pRLWinPriv->pbmihShadow == NULL) {
-        ErrorF("InitWin32RootlessEngine - malloc () failed\n");
-        return;
-    }
-
-    /* Query the screen format */
-    winMWExtWMQueryDIBFormat(pRLWinPriv, pRLWinPriv->pbmihShadow);
-}
-
-Bool
-winMWExtWMCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
-                      int newX, int newY, RegionPtr pShape)
-{
-#define CLASS_NAME_LENGTH 512
-    Bool fResult = TRUE;
-    win32RootlessWindowPtr pRLWinPriv;
-    WNDCLASSEX wc;
-    char pszClass[CLASS_NAME_LENGTH], pszWindowID[12];
-    HICON hIcon;
-    HICON hIconSmall;
-    char *res_name, *res_class, *res_role;
-    static int s_iWindowID = 0;
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMCreateFrame %d %d - %d %d\n",
-             newX, newY, pFrame->width, pFrame->height);
-#endif
-
-    pRLWinPriv = malloc(sizeof(win32RootlessWindowRec));
-    pRLWinPriv->pFrame = pFrame;
-    pRLWinPriv->pfb = NULL;
-    pRLWinPriv->hbmpShadow = NULL;
-    pRLWinPriv->hdcShadow = NULL;
-    pRLWinPriv->hdcScreen = NULL;
-    pRLWinPriv->pbmihShadow = NULL;
-    pRLWinPriv->fResized = TRUE;
-    pRLWinPriv->fClose = FALSE;
-    pRLWinPriv->fRestackingNow = FALSE;
-    pRLWinPriv->fDestroyed = FALSE;
-    pRLWinPriv->fMovingOrSizing = FALSE;
-
-    // Store the implementation private frame ID
-    pFrame->wid = (RootlessFrameID) pRLWinPriv;
-
-    winSelectIcons(&hIcon, &hIconSmall);
-
-    /* Set standard class name prefix so we can identify window easily */
-    strncpy(pszClass, WINDOW_CLASS_X, sizeof(pszClass));
-
-    if (winMultiWindowGetClassHint(pFrame->win, &res_name, &res_class)) {
-        strncat(pszClass, "-", 1);
-        strncat(pszClass, res_name, CLASS_NAME_LENGTH - strlen(pszClass));
-        strncat(pszClass, "-", 1);
-        strncat(pszClass, res_class, CLASS_NAME_LENGTH - strlen(pszClass));
-
-        /* Check if a window class is provided by the WM_WINDOW_ROLE property,
-         * if not use the WM_CLASS information.
-         * For further information see:
-         * http://tronche.com/gui/x/icccm/sec-5.html
-         */
-        if (winMultiWindowGetWindowRole(pFrame->win, &res_role)) {
-            strcat(pszClass, "-");
-            strcat(pszClass, res_role);
-            free(res_role);
-        }
-
-        free(res_name);
-        free(res_class);
-    }
-
-    /* Add incrementing window ID to make unique class name */
-    snprintf(pszWindowID, sizeof(pszWindowID), "-%x", s_iWindowID++);
-    pszWindowID[sizeof(pszWindowID) - 1] = 0;
-    strcat(pszClass, pszWindowID);
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMCreateFrame - Creating class: %s\n", pszClass);
-#endif
-
-    /* Setup our window class */
-    wc.cbSize = sizeof(wc);
-    wc.style = CS_HREDRAW | CS_VREDRAW;
-    wc.lpfnWndProc = winMWExtWMWindowProc;
-    wc.cbClsExtra = 0;
-    wc.cbWndExtra = 0;
-    wc.hInstance = g_hInstance;
-    wc.hIcon = hIcon;
-    wc.hIconSm = hIconSmall;
-    wc.hCursor = 0;
-    wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
-    wc.lpszMenuName = NULL;
-    wc.lpszClassName = pszClass;
-    RegisterClassEx(&wc);
-
-    /* Create the window */
-    g_fNoConfigureWindow = TRUE;
-    pRLWinPriv->hWnd = CreateWindowExA(WS_EX_TOOLWINDOW,        /* Extended styles */
-                                       pszClass,        /* Class name */
-                                       WINDOW_TITLE_X,  /* Window name */
-                                       WS_POPUP | WS_CLIPCHILDREN, newX,        /* Horizontal position */
-                                       newY,    /* Vertical position */
-                                       pFrame->width,   /* Right edge */
-                                       pFrame->height,  /* Bottom edge */
-                                       (HWND) NULL,     /* No parent or owner window */
-                                       (HMENU) NULL,    /* No menu */
-                                       GetModuleHandle(NULL),   /* Instance handle */
-                                       pRLWinPriv);     /* ScreenPrivates */
-    if (pRLWinPriv->hWnd == NULL) {
-        ErrorF("winMWExtWMCreateFrame - CreateWindowExA () failed: %d\n",
-               (int) GetLastError());
-        fResult = FALSE;
-    }
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMCreateFrame - ShowWindow\n");
-#endif
-
-    //ShowWindow (pRLWinPriv->hWnd, SW_SHOWNOACTIVATE);
-    g_fNoConfigureWindow = FALSE;
-
-    if (pShape != NULL) {
-        winMWExtWMReshapeFrame(pFrame->wid, pShape);
-    }
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMCreateFrame - (%p) %p\n",
-             pFrame->wid, pRLWinPriv->hWnd);
-#if 0
-    {
-        WindowPtr pWin2 = NULL;
-        win32RootlessWindowPtr pRLWinPriv2 = NULL;
-
-        /* Check if the Windows window property for our X window pointer is valid */
-        if ((pWin2 =
-             (WindowPtr) GetProp(pRLWinPriv->hWnd, WIN_WINDOW_PROP)) != NULL) {
-            pRLWinPriv2 =
-                (win32RootlessWindowPtr) RootlessFrameForWindow(pWin2, FALSE);
-        }
-        winDebug("winMWExtWMCreateFrame2 (%08x) %08x\n",
-                 pRLWinPriv2, pRLWinPriv2->hWnd);
-        if (pRLWinPriv != pRLWinPriv2 || pRLWinPriv->hWnd != pRLWinPriv2->hWnd) {
-            winDebug("Error param missmatch\n");
-        }
-    }
-#endif
-#endif
-
-    winMWExtWMSetNativeProperty(pFrame);
-
-    return fResult;
-}
-
-void
-winMWExtWMDestroyFrame(RootlessFrameID wid)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-    HICON hIcon;
-    HICON hIconSm;
-    HMODULE hInstance;
-    int iReturn;
-    char pszClass[CLASS_NAME_LENGTH];
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMDestroyFrame (%p) %p\n",
-             pRLWinPriv, pRLWinPriv->hWnd);
-#if 0
-    {
-        WindowPtr pWin2 = NULL;
-        win32RootlessWindowPtr pRLWinPriv2 = NULL;
-
-        /* Check if the Windows window property for our X window pointer is valid */
-        if ((pWin2 =
-             (WindowPtr) GetProp(pRLWinPriv->hWnd, WIN_WINDOW_PROP)) != NULL) {
-            pRLWinPriv2 =
-                (win32RootlessWindowPtr) RootlessFrameForWindow(pWin2, FALSE);
-        }
-        winDebug("winMWExtWMDestroyFrame2 (%08x) %08x\n",
-                 pRLWinPriv2, pRLWinPriv2->hWnd);
-        if (pRLWinPriv != pRLWinPriv2 || pRLWinPriv->hWnd != pRLWinPriv2->hWnd) {
-            winDebug("Error param missmatch\n");
-            *(int *) 0 = 1;     //raise exseption
-        }
-    }
-#endif
-#endif
-
-    /* Store the info we need to destroy after this window is gone */
-    hInstance = (HINSTANCE) GetClassLongPtr(pRLWinPriv->hWnd, GCLP_HMODULE);
-    hIcon = (HICON) SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_BIG, 0);
-    hIconSm = (HICON) SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0);
-    iReturn = GetClassName(pRLWinPriv->hWnd, pszClass, CLASS_NAME_LENGTH);
-
-    pRLWinPriv->fClose = TRUE;
-    pRLWinPriv->fDestroyed = TRUE;
-
-    /* Destroy the Windows window */
-    DestroyWindow(pRLWinPriv->hWnd);
-
-    /* Only if we were able to get the name */
-    if (iReturn) {
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMDestroyFrame - Unregistering %s: ", pszClass);
-#endif
-        iReturn = UnregisterClass(pszClass, hInstance);
-    }
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMDestroyFramew - Deleting Icon\n");
-#endif
-
-    winDestroyIcon(hIcon);
-    winDestroyIcon(hIconSm);
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMDestroyFrame - done\n");
-#endif
-}
-
-void
-winMWExtWMMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int iNewX,
-                    int iNewY)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-    RECT rcNew;
-    DWORD dwExStyle;
-    DWORD dwStyle;
-    int iX, iY, iWidth, iHeight;
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMMoveFrame (%p) (%d %d)\n", pRLWinPriv, iNewX,
-             iNewY);
-#endif
-
-    /* Get the Windows window style and extended style */
-    dwExStyle = GetWindowLongPtr(pRLWinPriv->hWnd, GWL_EXSTYLE);
-    dwStyle = GetWindowLongPtr(pRLWinPriv->hWnd, GWL_STYLE);
-
-    /* Get the X and Y location of the X window */
-    iX = iNewX + GetSystemMetrics(SM_XVIRTUALSCREEN);
-    iY = iNewY + GetSystemMetrics(SM_YVIRTUALSCREEN);
-
-    /* Get the height and width of the X window */
-    iWidth = pRLWinPriv->pFrame->width;
-    iHeight = pRLWinPriv->pFrame->height;
-
-    /* Store the origin, height, and width in a rectangle structure */
-    SetRect(&rcNew, iX, iY, iX + iWidth, iY + iHeight);
-
-#ifdef CYGMULTIWINDOW_DEBUG
-    winDebug("\tWindow {%d, %d, %d, %d}, {%d, %d}\n",
-             rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
-             rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
-#endif
-    /*
-     * Calculate the required size of the Windows window rectangle,
-     * given the size of the Windows window client area.
-     */
-    AdjustWindowRectEx(&rcNew, dwStyle, FALSE, dwExStyle);
-
-#ifdef CYGMULTIWINDOW_DEBUG
-    winDebug("\tAdjusted {%d, %d, %d, %d}, {%d, %d}\n",
-             rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
-             rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
-#endif
-    g_fNoConfigureWindow = TRUE;
-    SetWindowPos(pRLWinPriv->hWnd, NULL, rcNew.left, rcNew.top, 0, 0,
-                 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
-    g_fNoConfigureWindow = FALSE;
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMMoveFrame (%p) done\n", pRLWinPriv);
-#endif
-}
-
-void
-winMWExtWMResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
-                      int iNewX, int iNewY,
-                      unsigned int uiNewWidth, unsigned int uiNewHeight,
-                      unsigned int uiGravity)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-    RECT rcNew;
-    RECT rcOld;
-    DWORD dwExStyle;
-    DWORD dwStyle;
-    int iX, iY;
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMResizeFrame (%p) (%d %d)-(%d %d)\n",
-             pRLWinPriv, iNewX, iNewY, uiNewWidth, uiNewHeight);
-#endif
-
-    pRLWinPriv->fResized = TRUE;
-
-    /* Get the Windows window style and extended style */
-    dwExStyle = GetWindowLongPtr(pRLWinPriv->hWnd, GWL_EXSTYLE);
-    dwStyle = GetWindowLongPtr(pRLWinPriv->hWnd, GWL_STYLE);
-
-    /* Get the X and Y location of the X window */
-    iX = iNewX + GetSystemMetrics(SM_XVIRTUALSCREEN);
-    iY = iNewY + GetSystemMetrics(SM_YVIRTUALSCREEN);
-
-    /* Store the origin, height, and width in a rectangle structure */
-    SetRect(&rcNew, iX, iY, iX + uiNewWidth, iY + uiNewHeight);
-
-    /*
-     * Calculate the required size of the Windows window rectangle,
-     * given the size of the Windows window client area.
-     */
-    AdjustWindowRectEx(&rcNew, dwStyle, FALSE, dwExStyle);
-
-    /* Get a rectangle describing the old Windows window */
-    GetWindowRect(pRLWinPriv->hWnd, &rcOld);
-
-    /* Check if the old rectangle and new rectangle are the same */
-    if (!EqualRect(&rcNew, &rcOld)) {
-
-        g_fNoConfigureWindow = TRUE;
-        MoveWindow(pRLWinPriv->hWnd,
-                   rcNew.left, rcNew.top,
-                   rcNew.right - rcNew.left, rcNew.bottom - rcNew.top, TRUE);
-        g_fNoConfigureWindow = FALSE;
-    }
-}
-
-void
-winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-    win32RootlessWindowPtr pRLNextWinPriv = (win32RootlessWindowPtr) nextWid;
-
-    winScreenPriv(pRLWinPriv->pFrame->win->drawable.pScreen);
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMRestackFrame (%p)\n", pRLWinPriv);
-#endif
-
-    if (pScreenPriv && pScreenPriv->fRestacking)
-        return;
-
-    pRLWinPriv->fRestackingNow = TRUE;
-
-    /* Show window */
-    if (!IsWindowVisible(pRLWinPriv->hWnd))
-        ShowWindow(pRLWinPriv->hWnd, SW_SHOWNOACTIVATE);
-
-    if (pRLNextWinPriv == NULL) {
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("Win %p is top\n", pRLWinPriv);
-#endif
-        pScreenPriv->widTop = wid;
-        SetWindowPos(pRLWinPriv->hWnd, HWND_TOP,
-                     0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
-    }
-    else {
-        /* using general wm like twm, wmaker etc.
-           Interleave X window and Windows window will cause problem. */
-        SetWindowPos(pRLWinPriv->hWnd, pRLNextWinPriv->hWnd,
-                     0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
-    }
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMRestackFrame - done (%p)\n", pRLWinPriv);
-#endif
-
-    pRLWinPriv->fRestackingNow = FALSE;
-}
-
-void
-winMWExtWMReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-    HRGN hRgn, hRgnWindow, hRgnClient;
-    RECT rcWindow, rcClient;
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMReshapeFrame (%p)\n", pRLWinPriv);
-#endif
-
-    hRgn = winMWExtWMCreateRgnFromRegion(pShape);
-
-    /* Create region for non-client area */
-    GetWindowRect(pRLWinPriv->hWnd, &rcWindow);
-    GetClientRect(pRLWinPriv->hWnd, &rcClient);
-    MapWindowPoints(pRLWinPriv->hWnd, HWND_DESKTOP, (LPPOINT) &rcClient, 2);
-    OffsetRgn(hRgn, rcClient.left - rcWindow.left, rcClient.top - rcWindow.top);
-    OffsetRect(&rcClient, -rcWindow.left, -rcWindow.top);
-    OffsetRect(&rcWindow, -rcWindow.left, -rcWindow.top);
-    hRgnWindow = CreateRectRgnIndirect(&rcWindow);
-    hRgnClient = CreateRectRgnIndirect(&rcClient);
-    CombineRgn(hRgnWindow, hRgnWindow, hRgnClient, RGN_DIFF);
-    CombineRgn(hRgn, hRgnWindow, hRgn, RGN_OR);
-
-    SetWindowRgn(pRLWinPriv->hWnd, hRgn, TRUE);
-
-    DeleteObject(hRgnWindow);
-    DeleteObject(hRgnClient);
-}
-
-void
-winMWExtWMUnmapFrame(RootlessFrameID wid)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMUnmapFrame (%p)\n", pRLWinPriv);
-#endif
-
-    g_fNoConfigureWindow = TRUE;
-    //ShowWindow (pRLWinPriv->hWnd, SW_MINIMIZE);
-    ShowWindow(pRLWinPriv->hWnd, SW_HIDE);
-    g_fNoConfigureWindow = FALSE;
-}
-
-/*
- * Fixme: Code sharing with winshadgdi.c and other engine support
- */
-void
-winMWExtWMStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-    winPrivScreenPtr pScreenPriv = NULL;
-    winScreenInfo *pScreenInfo = NULL;
-    ScreenPtr pScreen = NULL;
-    DIBSECTION dibsection;
-    Bool fReturn = TRUE;
-    HDC hdcNew;
-    HBITMAP hbmpNew;
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMStartDrawing (%p) %08x\n", pRLWinPriv,
-             pRLWinPriv->fDestroyed);
-#endif
-
-    if (!pRLWinPriv->fDestroyed) {
-        pScreen = pRLWinPriv->pFrame->win->drawable.pScreen;
-        if (pScreen)
-            pScreenPriv = winGetScreenPriv(pScreen);
-        if (pScreenPriv)
-            pScreenInfo = pScreenPriv->pScreenInfo;
-
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("\tpScreenPriv %p\n", pScreenPriv);
-        winDebug("\tpScreenInfo %p\n", pScreenInfo);
-        winDebug("\t(%d, %d)\n", (int) pRLWinPriv->pFrame->width,
-                 (int) pRLWinPriv->pFrame->height);
-#endif
-        if (pRLWinPriv->hdcScreen == NULL) {
-            InitWin32RootlessEngine(pRLWinPriv);
-        }
-
-        if (pRLWinPriv->fResized) {
-            /* width * bpp must be multiple of 4 to match 32bit alignment */
-            int stridesize;
-            int misalignment;
-
-            pRLWinPriv->pbmihShadow->biWidth = pRLWinPriv->pFrame->width;
-            pRLWinPriv->pbmihShadow->biHeight = -pRLWinPriv->pFrame->height;
-
-            stridesize = pRLWinPriv->pFrame->width * (pScreenInfo->dwBPP >> 3);
-            misalignment = stridesize & 3;
-            if (misalignment != 0) {
-                stridesize += 4 - misalignment;
-                pRLWinPriv->pbmihShadow->biWidth =
-                    stridesize / (pScreenInfo->dwBPP >> 3);
-                winDebug("\tresizing to %d (was %d)\n",
-                         pRLWinPriv->pbmihShadow->biWidth,
-                         pRLWinPriv->pFrame->width);
-            }
-
-            hdcNew = CreateCompatibleDC(pRLWinPriv->hdcScreen);
-            /* Create a DI shadow bitmap with a bit pointer */
-            hbmpNew = CreateDIBSection(pRLWinPriv->hdcScreen,
-                                       (BITMAPINFO *) pRLWinPriv->pbmihShadow,
-                                       DIB_RGB_COLORS,
-                                       (VOID **) &pRLWinPriv->pfb, NULL, 0);
-            if (hbmpNew == NULL || pRLWinPriv->pfb == NULL) {
-                ErrorF("winMWExtWMStartDrawing - CreateDIBSection failed\n");
-                //return FALSE;
-            }
-            else {
-#if CYGMULTIWINDOW_DEBUG
-                winDebug("winMWExtWMStartDrawing - Shadow buffer allocated\n");
-#endif
-            }
-
-            /* Get information about the bitmap that was allocated */
-            GetObject(hbmpNew, sizeof(dibsection), &dibsection);
-
-#if CYGMULTIWINDOW_DEBUG
-            /* Print information about bitmap allocated */
-            winDebug("winMWExtWMStartDrawing - Dibsection width: %d height: %d "
-                     "depth: %d size image: %d\n",
-                     (unsigned int) dibsection.dsBmih.biWidth,
-                     (unsigned int) dibsection.dsBmih.biHeight,
-                     (unsigned int) dibsection.dsBmih.biBitCount,
-                     (unsigned int) dibsection.dsBmih.biSizeImage);
-#endif
-
-            /* Select the shadow bitmap into the shadow DC */
-            SelectObject(hdcNew, hbmpNew);
-
-#if CYGMULTIWINDOW_DEBUG
-            winDebug("winMWExtWMStartDrawing - Attempting a shadow blit\n");
-#endif
-
-            /* Blit from the old shadow to the new shadow */
-            fReturn = BitBlt(hdcNew,
-                             0, 0,
-                             pRLWinPriv->pFrame->width,
-                             pRLWinPriv->pFrame->height, pRLWinPriv->hdcShadow,
-                             0, 0, SRCCOPY);
-            if (fReturn) {
-#if CYGMULTIWINDOW_DEBUG
-                winDebug("winMWExtWMStartDrawing - Shadow blit success\n");
-#endif
-            }
-            else {
-                ErrorF("winMWExtWMStartDrawing - Shadow blit failure\n");
-            }
-
-            /* Look for height weirdness */
-            if (dibsection.dsBmih.biHeight < 0) {
-                /* FIXME: Figure out why biHeight is sometimes negative */
-                ErrorF("winMWExtWMStartDrawing - WEIRDNESS - "
-                       "biHeight still negative: %d\n",
-                       (int) dibsection.dsBmih.biHeight);
-                ErrorF("winMWExtWMStartDrawing - WEIRDNESS - "
-                       "Flipping biHeight sign\n");
-                dibsection.dsBmih.biHeight = -dibsection.dsBmih.biHeight;
-            }
-
-            pRLWinPriv->dwWidthBytes = dibsection.dsBm.bmWidthBytes;
-
-#if CYGMULTIWINDOW_DEBUG
-            winDebug("winMWExtWMStartDrawing - bytesPerRow: %d\n",
-                     (unsigned int) dibsection.dsBm.bmWidthBytes);
-#endif
-
-            /* Free the old shadow bitmap */
-            DeleteObject(pRLWinPriv->hdcShadow);
-            DeleteObject(pRLWinPriv->hbmpShadow);
-
-            pRLWinPriv->hdcShadow = hdcNew;
-            pRLWinPriv->hbmpShadow = hbmpNew;
-
-            pRLWinPriv->fResized = FALSE;
-#if CYGMULTIWINDOW_DEBUG && FALSE
-            winDebug("winMWExtWMStartDrawing - 0x%08x %d\n",
-                     (unsigned int) pRLWinPriv->pfb,
-                     (unsigned int) dibsection.dsBm.bmWidthBytes);
-#endif
-        }
-    }
-    else {
-        ErrorF("winMWExtWMStartDrawing - Already window was destroyed \n");
-    }
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMStartDrawing - done (%p) %p %d\n",
-             pRLWinPriv,
-             pRLWinPriv->pfb,
-             (unsigned int) pRLWinPriv->dwWidthBytes);
-#endif
-    *pixelData = pRLWinPriv->pfb;
-    *bytesPerRow = pRLWinPriv->dwWidthBytes;
-}
-
-void
-winMWExtWMStopDrawing(RootlessFrameID wid, Bool fFlush)
-{
-#if 0
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-    BLENDFUNCTION bfBlend;
-    SIZE szWin;
-    POINT ptSrc;
-
-#if CYGMULTIWINDOW_DEBUG || TRUE
-    winDebug("winMWExtWMStopDrawing (%08x)\n", pRLWinPriv);
-#endif
-    szWin.cx = pRLWinPriv->dwWidth;
-    szWin.cy = pRLWinPriv->dwHeight;
-    ptSrc.x = 0;
-    ptSrc.y = 0;
-    bfBlend.BlendOp = AC_SRC_OVER;
-    bfBlend.BlendFlags = 0;
-    bfBlend.SourceConstantAlpha = 255;
-    bfBlend.AlphaFormat = AC_SRC_ALPHA;
-
-    if (!UpdateLayeredWindow(pRLWinPriv->hWnd,
-                             NULL, NULL, &szWin,
-                             pRLWinPriv->hdcShadow, &ptSrc,
-                             0, &bfBlend, ULW_ALPHA)) {
-        ErrorF("winMWExtWMStopDrawing - UpdateLayeredWindow failed\n");
-    }
-#endif
-}
-
-void
-winMWExtWMUpdateRegion(RootlessFrameID wid, RegionPtr pDamage)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-
-#if 0
-    BLENDFUNCTION bfBlend;
-    SIZE szWin;
-    POINT ptSrc;
-#endif
-#if CYGMULTIWINDOW_DEBUG && 0
-    winDebug("winMWExtWMUpdateRegion (%08x)\n", pRLWinPriv);
-#endif
-#if 0
-    szWin.cx = pRLWinPriv->dwWidth;
-    szWin.cy = pRLWinPriv->dwHeight;
-    ptSrc.x = 0;
-    ptSrc.y = 0;
-    bfBlend.BlendOp = AC_SRC_OVER;
-    bfBlend.BlendFlags = 0;
-    bfBlend.SourceConstantAlpha = 255;
-    bfBlend.AlphaFormat = AC_SRC_ALPHA;
-
-    if (!UpdateLayeredWindow(pRLWinPriv->hWnd,
-                             NULL, NULL, &szWin,
-                             pRLWinPriv->hdcShadow, &ptSrc,
-                             0, &bfBlend, ULW_ALPHA)) {
-        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("winMWExtWMUpdateRegion - UpdateLayeredWindow failed: %s\n",
-               (LPSTR) lpMsgBuf);
-        LocalFree(lpMsgBuf);
-    }
-#endif
-    if (!g_fNoConfigureWindow)
-        UpdateWindow(pRLWinPriv->hWnd);
-}
-
-void
-winMWExtWMDamageRects(RootlessFrameID wid, int nCount, const BoxRec * pRects,
-                      int shift_x, int shift_y)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-    const BoxRec *pEnd;
-
-#if CYGMULTIWINDOW_DEBUG && 0
-    winDebug("winMWExtWMDamageRects (%08x, %d, %08x, %d, %d)\n",
-             pRLWinPriv, nCount, pRects, shift_x, shift_y);
-#endif
-
-    for (pEnd = pRects + nCount; pRects < pEnd; pRects++) {
-        RECT rcDmg;
-
-        rcDmg.left = pRects->x1 + shift_x;
-        rcDmg.top = pRects->y1 + shift_y;
-        rcDmg.right = pRects->x2 + shift_x;
-        rcDmg.bottom = pRects->y2 + shift_y;
-
-        InvalidateRect(pRLWinPriv->hWnd, &rcDmg, FALSE);
-    }
-}
-
-void
-winMWExtWMRootlessSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) pFrame->wid;
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMRootlessSwitchWindow (%p) %p\n",
-             pRLWinPriv, pRLWinPriv->hWnd);
-#endif
-    pRLWinPriv->pFrame = pFrame;
-    pRLWinPriv->fResized = TRUE;
-
-    /* Set the window extended style flags */
-    SetWindowLongPtr(pRLWinPriv->hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
-
-    /* Set the window standard style flags */
-    SetWindowLongPtr(pRLWinPriv->hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN);
-
-    DeleteProperty(serverClient, oldWin, AtmWindowsWmNativeHwnd());
-    winMWExtWMSetNativeProperty(pFrame);
-#if CYGMULTIWINDOW_DEBUG
-#if 0
-    {
-        WindowPtr pWin2 = NULL;
-        win32RootlessWindowPtr pRLWinPriv2 = NULL;
-
-        /* Check if the Windows window property for our X window pointer is valid */
-        if ((pWin2 =
-             (WindowPtr) GetProp(pRLWinPriv->hWnd, WIN_WINDOW_PROP)) != NULL) {
-            pRLWinPriv2 =
-                (win32RootlessWindowPtr) RootlessFrameForWindow(pWin2, FALSE);
-        }
-        winDebug("winMWExtWMSwitchFrame2 (%08x) %08x\n",
-                 pRLWinPriv2, pRLWinPriv2->hWnd);
-        if (pRLWinPriv != pRLWinPriv2 || pRLWinPriv->hWnd != pRLWinPriv2->hWnd) {
-            winDebug("Error param missmatch\n");
-        }
-    }
-#endif
-#endif
-}
-
-void
-winMWExtWMCopyBytes(unsigned int width, unsigned int height,
-                    const void *src, unsigned int srcRowBytes,
-                    void *dst, unsigned int dstRowBytes)
-{
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMCopyBytes - Not implemented\n");
-#endif
-}
-
-void
-winMWExtWMCopyWindow(RootlessFrameID wid, int nDstRects,
-                     const BoxRec * pDstRects, int nDx, int nDy)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
-    const BoxRec *pEnd;
-    RECT rcDmg;
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMCopyWindow (%p, %d, %p, %d, %d)\n",
-             pRLWinPriv, nDstRects, pDstRects, nDx, nDy);
-#endif
-
-    for (pEnd = pDstRects + nDstRects; pDstRects < pEnd; pDstRects++) {
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("BitBlt (%d, %d, %d, %d) (%d, %d)\n",
-                 pDstRects->x1, pDstRects->y1,
-                 pDstRects->x2 - pDstRects->x1,
-                 pDstRects->y2 - pDstRects->y1,
-                 pDstRects->x1 + nDx, pDstRects->y1 + nDy);
-#endif
-
-        if (!BitBlt(pRLWinPriv->hdcShadow,
-                    pDstRects->x1, pDstRects->y1,
-                    pDstRects->x2 - pDstRects->x1,
-                    pDstRects->y2 - pDstRects->y1,
-                    pRLWinPriv->hdcShadow,
-                    pDstRects->x1 + nDx, pDstRects->y1 + nDy, SRCCOPY)) {
-            ErrorF("winMWExtWMCopyWindow - BitBlt failed.\n");
-        }
-
-        rcDmg.left = pDstRects->x1;
-        rcDmg.top = pDstRects->y1;
-        rcDmg.right = pDstRects->x2;
-        rcDmg.bottom = pDstRects->y2;
-
-        InvalidateRect(pRLWinPriv->hWnd, &rcDmg, FALSE);
-    }
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMCopyWindow - done\n");
-#endif
-}
-
-/*
- * winMWExtWMSetNativeProperty
- */
-
-static void
-winMWExtWMSetNativeProperty(RootlessWindowPtr pFrame)
-{
-    win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) pFrame->wid;
-    long lData;
-
-    /* FIXME: move this to WindowsWM extension */
-
-    lData = (long) pRLWinPriv->hWnd;
-    dixChangeWindowProperty(serverClient, pFrame->win, AtmWindowsWmNativeHwnd(),
-                            XA_INTEGER, 32, PropModeReplace, 1, &lData, TRUE);
-}
diff --git a/hw/xwin/winwin32rootlesswindow.c b/hw/xwin/winwin32rootlesswindow.c
deleted file mode 100644
index 817cd093e..000000000
--- a/hw/xwin/winwin32rootlesswindow.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors:	Kensuke Matsuzaki
- *		Earle F. Philhower, III
- *		Harold L Hunt II
- */
-
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include "win.h"
-#include "winprefs.h"
-
-#if 0
-/*
- * winMWExtWMReorderWindows
- */
-
-void
-winMWExtWMReorderWindows(ScreenPtr pScreen)
-{
-    winScreenPriv(pScreen);
-    HWND hwnd = NULL;
-    win32RootlessWindowPtr pRLWin = NULL;
-    win32RootlessWindowPtr pRLWinSib = NULL;
-    DWORD dwCurrentProcessID = GetCurrentProcessId();
-    DWORD dwWindowProcessID = 0;
-    XID vlist[2];
-
-#if CYGMULTIWINDOW_DEBUG && FALSE
-    winDebug("winMWExtWMReorderWindows\n");
-#endif
-
-    pScreenPriv->fRestacking = TRUE;
-
-    if (pScreenPriv->fWindowOrderChanged) {
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMReorderWindows - Need to restack\n");
-#endif
-        hwnd = GetTopWindow(NULL);
-
-        while (hwnd) {
-            GetWindowThreadProcessId(hwnd, &dwWindowProcessID);
-
-            if ((dwWindowProcessID == dwCurrentProcessID)
-                && GetProp(hwnd, WIN_WINDOW_PROP)) {
-                pRLWinSib = pRLWin;
-                pRLWin =
-                    (win32RootlessWindowPtr) GetProp(hwnd, WIN_WINDOW_PROP);
-
-                if (pRLWinSib) {
-                    vlist[0] = pRLWinSib->pFrame->win->drawable.id;
-                    vlist[1] = Below;
-
-                    ConfigureWindow(pRLWin->pFrame->win,
-                                    CWSibling | CWStackMode, vlist,
-                                    wClient(pRLWin->pFrame->win));
-                }
-                else {
-                    /* 1st window - raise to the top */
-                    vlist[0] = Above;
-
-                    ConfigureWindow(pRLWin->pFrame->win, CWStackMode,
-                                    vlist, wClient(pRLWin->pFrame->win));
-                }
-            }
-            hwnd = GetNextWindow(hwnd, GW_HWNDNEXT);
-        }
-    }
-
-    pScreenPriv->fRestacking = FALSE;
-    pScreenPriv->fWindowOrderChanged = FALSE;
-}
-#endif
-
-/*
- * winMWExtWMMoveXWindow
- */
-
-void
-winMWExtWMMoveXWindow(WindowPtr pWin, int x, int y)
-{
-    CARD32 *vlist = malloc(sizeof(CARD32) * 2);
-
-    vlist[0] = x;
-    vlist[1] = y;
-    ConfigureWindow(pWin, CWX | CWY, vlist, wClient(pWin));
-    free(vlist);
-}
-
-/*
- * winMWExtWMResizeXWindow
- */
-
-void
-winMWExtWMResizeXWindow(WindowPtr pWin, int w, int h)
-{
-    CARD32 *vlist = malloc(sizeof(CARD32) * 2);
-
-    vlist[0] = w;
-    vlist[1] = h;
-    ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin));
-    free(vlist);
-}
-
-/*
- * winMWExtWMMoveResizeXWindow
- */
-
-void
-winMWExtWMMoveResizeXWindow(WindowPtr pWin, int x, int y, int w, int h)
-{
-    CARD32 *vlist = malloc(sizeof(long) * 4);
-
-    vlist[0] = x;
-    vlist[1] = y;
-    vlist[2] = w;
-    vlist[3] = h;
-
-    ConfigureWindow(pWin, CWX | CWY | CWWidth | CWHeight, vlist, wClient(pWin));
-    free(vlist);
-}
-
-/*
-
-
- * winMWExtWMDecorateWindow - Update window style. Called by EnumWindows.
- */
-
-wBOOL CALLBACK
-winMWExtWMDecorateWindow(HWND hwnd, LPARAM lParam)
-{
-    win32RootlessWindowPtr pRLWinPriv = NULL;
-    ScreenPtr pScreen = NULL;
-    winPrivScreenPtr pScreenPriv = NULL;
-    winScreenInfo *pScreenInfo = NULL;
-
-    /* Check if the Windows window property for our X window pointer is valid */
-    if ((pRLWinPriv =
-         (win32RootlessWindowPtr) GetProp(hwnd, WIN_WINDOW_PROP)) != NULL) {
-        if (pRLWinPriv != NULL && pRLWinPriv->pFrame != NULL &&
-            pRLWinPriv->pFrame->win != NULL)
-            pScreen = pRLWinPriv->pFrame->win->drawable.pScreen;
-        if (pScreen)
-            pScreenPriv = winGetScreenPriv(pScreen);
-        if (pScreenPriv)
-            pScreenInfo = pScreenPriv->pScreenInfo;
-        if (pRLWinPriv && pScreenInfo)
-            winMWExtWMUpdateWindowDecoration(pRLWinPriv, pScreenInfo);
-    }
-    return TRUE;
-}
-
-/*
- * winMWExtWMUpdateWindowDecoration - Update window style.
- */
-
-void
-winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv,
-                                 winScreenInfoPtr pScreenInfo)
-{
-    Bool fDecorate = FALSE;
-    DWORD dwExStyle = 0;
-    WINDOWPLACEMENT wndPlace;
-    UINT showCmd = 0;
-
-    wndPlace.length = sizeof(WINDOWPLACEMENT);
-
-    /* Get current window placement */
-    GetWindowPlacement(pRLWinPriv->hWnd, &wndPlace);
-
-#if 0
-    if (wndPlace.showCmd == SW_HIDE)
-        return;                 //showCmd = SWP_HIDEWINDOW;
-    else
-        showCmd = SWP_SHOWWINDOW;
-#else
-    if (wndPlace.showCmd == SW_HIDE)
-        return;
-
-    if (IsWindowVisible(pRLWinPriv->hWnd))
-        showCmd = SWP_SHOWWINDOW;
-#endif
-
-    showCmd |= SWP_NOMOVE | SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOZORDER;
-
-    winDebug("winMWExtWMUpdateWindowDecoration %p %s\n",
-             pRLWinPriv, fDecorate ? "Decorate" : "Bare");
-
-    /* Get the extended window style information */
-    dwExStyle = GetWindowLongPtr(pRLWinPriv->hWnd, GWL_EXSTYLE);
-
-    if (fDecorate) {
-        RECT rcNew;
-        int iDx, iDy;
-        winWMMessageRec wmMsg;
-
-        winScreenPriv(pScreenInfo->pScreen);
-
-        /* */
-        if (!(dwExStyle & WS_EX_APPWINDOW)) {
-            winDebug("\tBare=>Decorate\n");
-            /* Setup a rectangle with the X window position and size */
-            SetRect(&rcNew,
-                    pRLWinPriv->pFrame->x,
-                    pRLWinPriv->pFrame->y,
-                    pRLWinPriv->pFrame->x + pRLWinPriv->pFrame->width,
-                    pRLWinPriv->pFrame->y + pRLWinPriv->pFrame->height);
-
-#ifdef CYGMULTIWINDOW_DEBUG
-            winDebug("\tWindow extend {%d, %d, %d, %d}, {%d, %d}\n",
-                     rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
-                     rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
-#endif
-            /* */
-            AdjustWindowRectEx(&rcNew,
-                               WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW,
-                               FALSE, WS_EX_APPWINDOW);
-
-#ifdef CYGMULTIWINDOW_DEBUG
-            winDebug("\tAdjusted {%d, %d, %d, %d}, {%d, %d}\n",
-                     rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
-                     rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
-#endif
-            /* Calculate position deltas */
-            iDx = pRLWinPriv->pFrame->x - rcNew.left;
-            iDy = pRLWinPriv->pFrame->y - rcNew.top;
-
-            /* Calculate new rectangle */
-            rcNew.left += iDx;
-            rcNew.right += iDx;
-            rcNew.top += iDy;
-            rcNew.bottom += iDy;
-
-            /* Set the window extended style flags */
-            SetWindowLongPtr(pRLWinPriv->hWnd, GWL_EXSTYLE, WS_EX_APPWINDOW);
-
-            /* Set the window standard style flags */
-            SetWindowLongPtr(pRLWinPriv->hWnd, GWL_STYLE,
-                             WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW);
-
-#ifdef CYGMULTIWINDOW_DEBUG
-            winDebug("\tWindowStyle: %08x %08x\n",
-                     WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW,
-                     WS_EX_APPWINDOW);
-#endif
-            /* Position the Windows window */
-#ifdef CYGMULTIWINDOW_DEBUG
-            winDebug("\tMoved {%d, %d, %d, %d}, {%d, %d}\n",
-                     rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
-                     rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
-#endif
-            SetWindowPos(pRLWinPriv->hWnd, NULL,
-                         rcNew.left, rcNew.top,
-                         rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
-                         showCmd);
-
-            wmMsg.hwndWindow = pRLWinPriv->hWnd;
-            wmMsg.iWindow = (Window) pRLWinPriv->pFrame->win->drawable.id;
-            wmMsg.msg = WM_WM_NAME_EVENT;
-            winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg);
-
-            winMWExtWMReshapeFrame((RootlessFrameID) pRLWinPriv,
-                                   wBoundingShape(pRLWinPriv->pFrame->win));
-        }
-    }
-    else {
-        RECT rcNew;
-
-        /* */
-        if (dwExStyle & WS_EX_APPWINDOW) {
-            winDebug("\tDecorate=>Bare\n");
-            /* Setup a rectangle with the X window position and size */
-            SetRect(&rcNew,
-                    pRLWinPriv->pFrame->x,
-                    pRLWinPriv->pFrame->y,
-                    pRLWinPriv->pFrame->x + pRLWinPriv->pFrame->width,
-                    pRLWinPriv->pFrame->y + pRLWinPriv->pFrame->height);
-#if 0
-            /* */
-            AdjustWindowRectEx(&rcNew,
-                               WS_POPUP | WS_CLIPCHILDREN,
-                               FALSE, WS_EX_TOOLWINDOW);
-
-            /* Calculate position deltas */
-            iDx = pRLWinPriv->pFrame->x - rcNew.left;
-            iDy = pRLWinPriv->pFrame->y - rcNew.top;
-
-            /* Calculate new rectangle */
-            rcNew.left += iDx;
-            rcNew.right += iDx;
-            rcNew.top += iDy;
-            rcNew.bottom += iDy;
-#endif
-
-            /* Hide window temporary to remove from taskbar. */
-            ShowWindow(pRLWinPriv->hWnd, SW_HIDE);
-
-            /* Set the window extended style flags */
-            SetWindowLongPtr(pRLWinPriv->hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
-
-            /* Set the window standard style flags */
-            SetWindowLongPtr(pRLWinPriv->hWnd, GWL_STYLE,
-                             WS_POPUP | WS_CLIPCHILDREN);
-
-            /* Position the Windows window */
-            SetWindowPos(pRLWinPriv->hWnd, NULL,
-                         rcNew.left, rcNew.top,
-                         rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
-                         showCmd);
-
-            winMWExtWMReshapeFrame((RootlessFrameID) pRLWinPriv,
-                                   wBoundingShape(pRLWinPriv->pFrame->win));
-        }
-    }
-}
-
-/*
- * winMWExtWMRestackWindows
- */
-
-void
-winMWExtWMRestackWindows(ScreenPtr pScreen)
-{
-    winScreenPriv(pScreen);
-    WindowPtr pRoot = pScreen->root;
-    WindowPtr pWin = NULL;
-    WindowPtr pWinPrev = NULL;
-    win32RootlessWindowPtr pRLWin = NULL;
-    win32RootlessWindowPtr pRLWinPrev = NULL;
-    int nWindow = 0;
-    HDWP hWinPosInfo = NULL;
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMRestackWindows\n");
-#endif
-
-    pScreenPriv->fRestacking = TRUE;
-
-    if (pRoot != NULL) {
-        for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib)
-            nWindow++;
-
-        hWinPosInfo = BeginDeferWindowPos(nWindow);
-
-        for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib) {
-            if (pWin->realized) {
-                UINT uFlags;
-
-                pRLWin =
-                    (win32RootlessWindowPtr) RootlessFrameForWindow(pWin,
-                                                                    FALSE);
-                if (pRLWin == NULL)
-                    continue;
-
-                if (pWinPrev)
-                    pRLWinPrev =
-                        (win32RootlessWindowPtr)
-                        RootlessFrameForWindow(pWinPrev, FALSE);
-
-                uFlags = SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW;
-                if (pRLWinPrev != NULL)
-                    uFlags |= SWP_NOACTIVATE;
-
-#if CYGMULTIWINDOW_DEBUG
-                winDebug
-                    ("winMWExtWMRestackWindows - DeferWindowPos (%p, %p)\n",
-                     pRLWin->hWnd, pRLWinPrev ? pRLWinPrev->hWnd : HWND_TOP);
-#endif
-                hWinPosInfo = DeferWindowPos(hWinPosInfo, pRLWin->hWnd,
-                                             pRLWinPrev ? pRLWinPrev->
-                                             hWnd : HWND_TOP, 0, 0, 0, 0,
-                                             uFlags);
-                if (hWinPosInfo == NULL) {
-                    ErrorF
-                        ("winMWExtWMRestackWindows - DeferWindowPos () failed: %d\n",
-                         (int) GetLastError());
-                    return;
-                }
-                pWinPrev = pWin;
-            }
-        }
-        if (!EndDeferWindowPos(hWinPosInfo)) {
-            ErrorF
-                ("winMWExtWMRestackWindows - EndDeferWindowPos () failed: %d\n",
-                 (int) GetLastError());
-            return;
-        }
-    }
-
-#if CYGMULTIWINDOW_DEBUG
-    winDebug("winMWExtWMRestackWindows - done\n");
-#endif
-    pScreenPriv->fRestacking = FALSE;
-}
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
deleted file mode 100644
index 5575f4ba8..000000000
--- a/hw/xwin/winwin32rootlesswndproc.c
+++ /dev/null
@@ -1,1080 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors:	Kensuke Matsuzaki
- *		Earle F. Philhower, III
- *		Harold L Hunt II
- */
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include "win.h"
-#include <winuser.h>
-#define _WINDOWSWM_SERVER_
-#include <X11/extensions/windowswmstr.h>
-#include "dixevents.h"
-#include "propertyst.h"
-#include <X11/Xatom.h>
-#include "winmultiwindowclass.h"
-#include "winmsg.h"
-#include "inputstr.h"
-
-/*
- * Constant defines
- */
-
-#define MOUSE_ACTIVATE_DEFAULT		TRUE
-#define RAISE_ON_CLICK_DEFAULT		FALSE
-
-/*
- * Local globals
- */
-
-static UINT_PTR g_uipMousePollingTimerID = 0;
-
-/*
- * Local function
- */
-
-DEFINE_ATOM_HELPER(AtmWindowsWMMouseActivate, WINDOWSWM_MOUSE_ACTIVATE)
-/* DEFINE_ATOM_HELPER(AtmWindowsWMClientWindow, WINDOWSWM_CLIENT_WINDOW) */
-
-/*
- * ConstrainSize - Taken from TWM sources - Respects hints for sizing
- */
-#define makemult(a,b) ((b==1) ? (a) : (((int)((a)/(b))) * (b)) )
-static void
-ConstrainSize(WinXSizeHints hints, int *widthp, int *heightp)
-{
-    int minWidth, minHeight, maxWidth, maxHeight, xinc, yinc, delta;
-    int baseWidth, baseHeight;
-    int dwidth = *widthp, dheight = *heightp;
-
-    if (hints.flags & PMinSize) {
-        minWidth = hints.min_width;
-        minHeight = hints.min_height;
-    }
-    else if (hints.flags & PBaseSize) {
-        minWidth = hints.base_width;
-        minHeight = hints.base_height;
-    }
-    else
-        minWidth = minHeight = 1;
-
-    if (hints.flags & PBaseSize) {
-        baseWidth = hints.base_width;
-        baseHeight = hints.base_height;
-    }
-    else if (hints.flags & PMinSize) {
-        baseWidth = hints.min_width;
-        baseHeight = hints.min_height;
-    }
-    else
-        baseWidth = baseHeight = 0;
-
-    if (hints.flags & PMaxSize) {
-        maxWidth = hints.max_width;
-        maxHeight = hints.max_height;
-    }
-    else {
-        maxWidth = MAXINT;
-        maxHeight = MAXINT;
-    }
-
-    if (hints.flags & PResizeInc) {
-        xinc = hints.width_inc;
-        yinc = hints.height_inc;
-    }
-    else
-        xinc = yinc = 1;
-
-    /*
-     * First, clamp to min and max values
-     */
-    if (dwidth < minWidth)
-        dwidth = minWidth;
-    if (dheight < minHeight)
-        dheight = minHeight;
-
-    if (dwidth > maxWidth)
-        dwidth = maxWidth;
-    if (dheight > maxHeight)
-        dheight = maxHeight;
-
-    /*
-     * Second, fit to base + N * inc
-     */
-    dwidth = ((dwidth - baseWidth) / xinc * xinc) + baseWidth;
-    dheight = ((dheight - baseHeight) / yinc * yinc) + baseHeight;
-
-    /*
-     * Third, adjust for aspect ratio
-     */
-
-    /*
-     * The math looks like this:
-     *
-     * minAspectX    dwidth     maxAspectX
-     * ---------- <= ------- <= ----------
-     * minAspectY    dheight    maxAspectY
-     *
-     * If that is multiplied out, then the width and height are
-     * invalid in the following situations:
-     *
-     * minAspectX * dheight > minAspectY * dwidth
-     * maxAspectX * dheight < maxAspectY * dwidth
-     *
-     */
-
-    if (hints.flags & PAspect) {
-        if (hints.min_aspect.x * dheight > hints.min_aspect.y * dwidth) {
-            delta =
-                makemult(hints.min_aspect.x * dheight / hints.min_aspect.y -
-                         dwidth, xinc);
-            if (dwidth + delta <= maxWidth)
-                dwidth += delta;
-            else {
-                delta =
-                    makemult(dheight -
-                             dwidth * hints.min_aspect.y / hints.min_aspect.x,
-                             yinc);
-                if (dheight - delta >= minHeight)
-                    dheight -= delta;
-            }
-        }
-
-        if (hints.max_aspect.x * dheight < hints.max_aspect.y * dwidth) {
-            delta =
-                makemult(dwidth * hints.max_aspect.y / hints.max_aspect.x -
-                         dheight, yinc);
-            if (dheight + delta <= maxHeight)
-                dheight += delta;
-            else {
-                delta =
-                    makemult(dwidth -
-                             hints.max_aspect.x * dheight / hints.max_aspect.y,
-                             xinc);
-                if (dwidth - delta >= minWidth)
-                    dwidth -= delta;
-            }
-        }
-    }
-
-    /* Return computed values */
-    *widthp = dwidth;
-    *heightp = dheight;
-}
-
-#undef makemult
-
-/*
- * ValidateSizing - Ensures size request respects hints
- */
-static int
-ValidateSizing(HWND hwnd, WindowPtr pWin, WPARAM wParam, LPARAM lParam)
-{
-    WinXSizeHints sizeHints;
-    RECT *rect;
-    int iWidth, iHeight, iTopBorder;
-    POINT pt;
-
-    /* Invalid input checking */
-    if (pWin == NULL || lParam == 0) {
-        ErrorF("Invalid input checking\n");
-        return FALSE;
-    }
-
-    /* No size hints, no checking */
-    if (!winMultiWindowGetWMNormalHints(pWin, &sizeHints)) {
-        ErrorF("No size hints, no checking\n");
-        return FALSE;
-    }
-
-    /* Avoid divide-by-zero */
-    if (sizeHints.flags & PResizeInc) {
-        if (sizeHints.width_inc == 0)
-            sizeHints.width_inc = 1;
-        if (sizeHints.height_inc == 0)
-            sizeHints.height_inc = 1;
-    }
-
-    rect = (RECT *) lParam;
-
-    iWidth = rect->right - rect->left;
-    iHeight = rect->bottom - rect->top;
-
-    /* Get title bar height, there must be an easier way?! */
-    pt.x = pt.y = 0;
-    ClientToScreen(hwnd, &pt);
-    iTopBorder = pt.y - rect->top;
-
-    /* Now remove size of any borders */
-    iWidth -= 2 * GetSystemMetrics(SM_CXSIZEFRAME);
-    iHeight -= GetSystemMetrics(SM_CYSIZEFRAME) + iTopBorder;
-
-    /* Constrain the size to legal values */
-    ConstrainSize(sizeHints, &iWidth, &iHeight);
-
-    /* Add back the borders */
-    iWidth += 2 * GetSystemMetrics(SM_CXSIZEFRAME);
-    iHeight += GetSystemMetrics(SM_CYSIZEFRAME) + iTopBorder;
-
-    /* Adjust size according to where we're dragging from */
-    switch (wParam) {
-    case WMSZ_TOP:
-    case WMSZ_TOPRIGHT:
-    case WMSZ_BOTTOM:
-    case WMSZ_BOTTOMRIGHT:
-    case WMSZ_RIGHT:
-        rect->right = rect->left + iWidth;
-        break;
-    default:
-        rect->left = rect->right - iWidth;
-        break;
-    }
-    switch (wParam) {
-    case WMSZ_BOTTOM:
-    case WMSZ_BOTTOMRIGHT:
-    case WMSZ_BOTTOMLEFT:
-    case WMSZ_RIGHT:
-    case WMSZ_LEFT:
-        rect->bottom = rect->top + iHeight;
-        break;
-    default:
-        rect->top = rect->bottom - iHeight;
-        break;
-    }
-    return TRUE;
-}
-
-/*
- * IsMouseActive
- */
-
-static Bool
-IsMouseActive(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("IsMouseActive - pWin was NULL use default value:%d\n",
-               MOUSE_ACTIVATE_DEFAULT);
-        return MOUSE_ACTIVATE_DEFAULT;
-    }
-
-    pwin = (struct _Window *) pWin;
-
-    if (pwin->optional)
-        prop = (struct _Property *) pwin->optional->userProps;
-    else
-        prop = NULL;
-
-    while (prop) {
-        if (prop->propertyName == AtmWindowsWMMouseActivate()
-            && prop->type == XA_INTEGER && prop->format == 32) {
-            return *(int *) prop->data;
-        }
-        else
-            prop = prop->next;
-    }
-
-    if (pWin != pRoot) {
-        return IsMouseActive(pRoot);
-    }
-    else {
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("IsMouseActive - no prop use default value:%d\n",
-                 MOUSE_ACTIVATE_DEFAULT);
-#endif
-        return MOUSE_ACTIVATE_DEFAULT;
-    }
-}
-
-/*
- * winMWExtWMWindowProc - Window procedure
- */
-
-LRESULT CALLBACK
-winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
-    WindowPtr pWin = NULL;
-    win32RootlessWindowPtr pRLWinPriv = NULL;
-    ScreenPtr pScreen = NULL;
-    winPrivScreenPtr pScreenPriv = NULL;
-    winScreenInfo *pScreenInfo = NULL;
-    HWND hwndScreen = NULL;
-    POINT ptMouse;
-    static Bool s_fTracking = FALSE;
-    HDC hdcUpdate;
-    PAINTSTRUCT ps;
-    LPWINDOWPOS pWinPos = NULL;
-    RECT rcClient;
-
-    /* Check if the Windows window property for our X window pointer is valid */
-    if ((pRLWinPriv =
-         (win32RootlessWindowPtr) GetProp(hwnd, WIN_WINDOW_PROP)) != NULL) {
-        pWin = pRLWinPriv->pFrame->win;
-        pScreen = pWin->drawable.pScreen;
-        if (pScreen)
-            pScreenPriv = winGetScreenPriv(pScreen);
-        if (pScreenPriv)
-            pScreenInfo = pScreenPriv->pScreenInfo;
-        if (pScreenPriv)
-            hwndScreen = pScreenPriv->hwndScreen;
-
-#if CYGDEBUG
-        winDebugWin32Message("winMWExtWMWindowProc", hwnd, 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 */
-    switch (message) {
-    case WM_CREATE:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_CREATE\n");
-#endif
-        /* */
-        SetProp(hwnd,
-                WIN_WINDOW_PROP,
-                (HANDLE) ((LPCREATESTRUCT) lParam)->lpCreateParams);
-        return 0;
-
-    case WM_CLOSE:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_CLOSE %d\n", pRLWinPriv->fClose);
-#endif
-        /* Tell window-manager to close window */
-        if (pRLWinPriv->fClose) {
-            DestroyWindow(hwnd);
-        }
-        else {
-            winWindowsWMSendEvent(WindowsWMControllerNotify,
-                                  WindowsWMControllerNotifyMask,
-                                  1,
-                                  WindowsWMCloseWindow,
-                                  pWin->drawable.id, 0, 0, 0, 0);
-        }
-        return 0;
-
-    case WM_DESTROY:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_DESTROY\n");
-#endif
-        /* Free the shaodw DC; which allows the bitmap to be freed */
-        DeleteDC(pRLWinPriv->hdcShadow);
-        pRLWinPriv->hdcShadow = NULL;
-
-        /* Free the shadow bitmap */
-        DeleteObject(pRLWinPriv->hbmpShadow);
-        pRLWinPriv->hbmpShadow = NULL;
-
-        /* Free the screen DC */
-        ReleaseDC(pRLWinPriv->hWnd, pRLWinPriv->hdcScreen);
-        pRLWinPriv->hdcScreen = NULL;
-
-        /* Free shadow buffer info header */
-        free(pRLWinPriv->pbmihShadow);
-        pRLWinPriv->pbmihShadow = NULL;
-
-        pRLWinPriv->fResized = FALSE;
-        pRLWinPriv->pfb = NULL;
-        free(pRLWinPriv);
-        RemoveProp(hwnd, WIN_WINDOW_PROP);
-        break;
-
-    case WM_MOUSEMOVE:
-#if CYGMULTIWINDOW_DEBUG && 0
-        winDebug("winMWExtWMWindowProc - WM_MOUSEMOVE\n");
-#endif
-        /* Unpack the client area mouse coordinates */
-        ptMouse.x = GET_X_LPARAM(lParam);
-        ptMouse.y = GET_Y_LPARAM(lParam);
-
-        /* Translate the client area mouse coordinates to screen coordinates */
-        ClientToScreen(hwnd, &ptMouse);
-
-        /* Screen Coords from (-X, -Y) -> Root Window (0, 0) */
-        ptMouse.x -= GetSystemMetrics(SM_XVIRTUALSCREEN);
-        ptMouse.y -= GetSystemMetrics(SM_YVIRTUALSCREEN);
-
-        /* We can't do anything without privates */
-        if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
-            break;
-
-        /* Has the mouse pointer crossed screens? */
-        if (pScreen != miPointerGetScreen(inputInfo.pointer))
-             miPointerSetScreen(inputInfo.pointer, pScreenInfo->dwScreen,
-                                ptMouse.x - pScreenInfo->dwXOffset,
-                                ptMouse.y - pScreenInfo->dwYOffset);
-
-        /* Are we tracking yet? */
-        if (!s_fTracking) {
-            TRACKMOUSEEVENT tme;
-
-            /* Setup data structure */
-            ZeroMemory(&tme, sizeof(tme));
-            tme.cbSize = sizeof(tme);
-            tme.dwFlags = TME_LEAVE;
-            tme.hwndTrack = hwnd;
-
-            /* Call the tracking function */
-            if (!TrackMouseEvent(&tme))
-                ErrorF("winMWExtWMWindowProc - TrackMouseEvent failed\n");
-
-            /* Flag that we are tracking now */
-            s_fTracking = TRUE;
-        }
-
-        /* Kill the timer used to poll mouse events */
-        if (g_uipMousePollingTimerID != 0) {
-            KillTimer(pScreenPriv->hwndScreen, WIN_POLLING_MOUSE_TIMER_ID);
-            g_uipMousePollingTimerID = 0;
-        }
-
-        /* Deliver absolute cursor position to X Server */
-        winEnqueueMotion(ptMouse.x - pScreenInfo->dwXOffset,
-                         ptMouse.y - pScreenInfo->dwYOffset);
-
-        return 0;
-
-    case WM_NCMOUSEMOVE:
-#if CYGMULTIWINDOW_DEBUG && 0
-        winDebug("winMWExtWMWindowProc - WM_NCMOUSEMOVE\n");
-#endif
-        /*
-         * We break instead of returning 0 since we need to call
-         * DefWindowProc to get the mouse cursor changes
-         * and min/max/close button highlighting in Windows XP.
-         * The Platform SDK says that you should return 0 if you
-         * process this message, but it fails to mention that you
-         * will give up any default functionality if you do return 0.
-         */
-
-        /* We can't do anything without privates */
-        if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
-            break;
-
-        /*
-         * Timer to poll mouse events.  This is needed to make
-         * programs like xeyes follow the mouse properly.
-         */
-        if (g_uipMousePollingTimerID == 0)
-            g_uipMousePollingTimerID = SetTimer(pScreenPriv->hwndScreen,
-                                                WIN_POLLING_MOUSE_TIMER_ID,
-                                                MOUSE_POLLING_INTERVAL, NULL);
-        break;
-
-    case WM_MOUSELEAVE:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_MOUSELEAVE\n");
-#endif
-        /* Mouse has left our client area */
-
-        /* Flag that we are no longer tracking */
-        s_fTracking = FALSE;
-
-        /*
-         * Timer to poll mouse events.  This is needed to make
-         * programs like xeyes follow the mouse properly.
-         */
-        if (g_uipMousePollingTimerID == 0)
-            g_uipMousePollingTimerID = SetTimer(pScreenPriv->hwndScreen,
-                                                WIN_POLLING_MOUSE_TIMER_ID,
-                                                MOUSE_POLLING_INTERVAL, NULL);
-        return 0;
-
-    case WM_LBUTTONDBLCLK:
-    case WM_LBUTTONDOWN:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_LBUTTONDBLCLK\n");
-#endif
-        if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
-            break;
-        SetCapture(hwnd);
-        return winMouseButtonsHandle(pScreen, ButtonPress, Button1, wParam);
-
-    case WM_LBUTTONUP:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_LBUTTONUP\n");
-#endif
-        if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
-            break;
-        ReleaseCapture();
-        return winMouseButtonsHandle(pScreen, ButtonRelease, Button1, wParam);
-
-    case WM_MBUTTONDBLCLK:
-    case WM_MBUTTONDOWN:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_MBUTTONDBLCLK\n");
-#endif
-        if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
-            break;
-        SetCapture(hwnd);
-        return winMouseButtonsHandle(pScreen, ButtonPress, Button2, wParam);
-
-    case WM_MBUTTONUP:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_MBUTTONUP\n");
-#endif
-        if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
-            break;
-        ReleaseCapture();
-        return winMouseButtonsHandle(pScreen, ButtonRelease, Button2, wParam);
-
-    case WM_RBUTTONDBLCLK:
-    case WM_RBUTTONDOWN:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_RBUTTONDBLCLK\n");
-#endif
-        if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
-            break;
-        SetCapture(hwnd);
-        return winMouseButtonsHandle(pScreen, ButtonPress, Button3, wParam);
-
-    case WM_RBUTTONUP:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_RBUTTONUP\n");
-#endif
-        if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
-            break;
-        ReleaseCapture();
-        return winMouseButtonsHandle(pScreen, ButtonRelease, Button3, wParam);
-
-    case WM_XBUTTONDBLCLK:
-    case WM_XBUTTONDOWN:
-        if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
-            break;
-        SetCapture(hwnd);
-        return winMouseButtonsHandle(pScreen, ButtonPress, HIWORD(wParam) + 7,
-                                     wParam);
-    case WM_XBUTTONUP:
-        if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
-            break;
-        ReleaseCapture();
-        return winMouseButtonsHandle(pScreen, ButtonRelease, HIWORD(wParam) + 7,
-                                     wParam);
-
-    case WM_MOUSEWHEEL:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_MOUSEWHEEL\n");
-#endif
-
-        /* Pass the message to the root window */
-        SendMessage(hwndScreen, message, wParam, lParam);
-        return 0;
-
-    case WM_MOUSEHWHEEL:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_MOUSEHWHEEL\n");
-#endif
-
-        /* Pass the message to the root window */
-        SendMessage(hwndScreen, message, wParam, lParam);
-        return 0;
-
-    case WM_MOUSEACTIVATE:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_MOUSEACTIVATE\n");
-#endif
-        if (!IsMouseActive(pWin))
-            return MA_NOACTIVATE;
-
-        break;
-
-    case WM_KILLFOCUS:
-        /* Pop any pressed keys since we are losing keyboard focus */
-        winKeybdReleaseKeys();
-        return 0;
-
-    case WM_SYSDEADCHAR:
-    case WM_DEADCHAR:
-        /*
-         * NOTE: We do nothing with WM_*CHAR messages,
-         * nor does the root window, so we can just toss these messages.
-         */
-        return 0;
-
-    case WM_SYSKEYDOWN:
-    case WM_KEYDOWN:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_*KEYDOWN\n");
-#endif
-
-        /*
-         * Don't pass Alt-F4 key combo to root window,
-         * let Windows translate to WM_CLOSE and close this top-level window.
-         *
-         * NOTE: We purposely don't check the fUseWinKillKey setting because
-         * it should only apply to the key handling for the root window,
-         * not for top-level window-manager windows.
-         *
-         * ALSO NOTE: We do pass Ctrl-Alt-Backspace to the root window
-         * because that is a key combo that no X app should be expecting to
-         * receive, since it has historically been used to shutdown the X server.
-         * Passing Ctrl-Alt-Backspace to the root window preserves that
-         * behavior, assuming that -unixkill has been passed as a parameter.
-         */
-        if (wParam == VK_F4 && (GetKeyState(VK_MENU) & 0x8000))
-            break;
-
-        /* Pass the message to the root window */
-        SendMessage(hwndScreen, message, wParam, lParam);
-        return 0;
-
-    case WM_SYSKEYUP:
-    case WM_KEYUP:
-
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_*KEYUP\n");
-#endif
-
-        /* Pass the message to the root window */
-        SendMessage(hwndScreen, message, wParam, lParam);
-        return 0;
-
-    case WM_HOTKEY:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_HOTKEY\n");
-#endif
-
-        /* Pass the message to the root window */
-        SendMessage(hwndScreen, message, wParam, lParam);
-        return 0;
-
-    case WM_ERASEBKGND:
-#if CYGDEBUG
-        winDebug("winMWExtWMWindowProc - WM_ERASEBKGND\n");
-#endif
-        /*
-         * Pretend that we did erase the background but we don't care,
-         * since we repaint the entire region anyhow
-         * This avoids some flickering when resizing.
-         */
-        return TRUE;
-
-    case WM_PAINT:
-
-        /* BeginPaint gives us an hdc that clips to the invalidated region */
-        hdcUpdate = BeginPaint(hwnd, &ps);
-
-        /* Try to copy from the shadow buffer */
-        if (!BitBlt(hdcUpdate,
-                    ps.rcPaint.left, ps.rcPaint.top,
-                    ps.rcPaint.right - ps.rcPaint.left,
-                    ps.rcPaint.bottom - ps.rcPaint.top,
-                    pRLWinPriv->hdcShadow,
-                    ps.rcPaint.left, ps.rcPaint.top, SRCCOPY)) {
-            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("winMWExtWMWindowProc - BitBlt failed: %s\n",
-                   (LPSTR) lpMsgBuf);
-            LocalFree(lpMsgBuf);
-        }
-
-        /* EndPaint frees the DC */
-        EndPaint(hwnd, &ps);
-        break;
-
-    case WM_ACTIVATE:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_ACTIVATE\n");
-#endif
-        if (LOWORD(wParam) != WA_INACTIVE) {
-            winWindowsWMSendEvent(WindowsWMControllerNotify,
-                                  WindowsWMControllerNotifyMask,
-                                  1,
-                                  WindowsWMActivateWindow,
-                                  pWin->drawable.id, 0, 0, 0, 0);
-        }
-        return 0;
-
-#if 1
-    case WM_WINDOWPOSCHANGING:
-        pWinPos = (LPWINDOWPOS) lParam;
-        if (!(pWinPos->flags & SWP_NOZORDER)) {
-            if (pRLWinPriv->fRestackingNow || pScreenPriv->fRestacking) {
-#if CYGMULTIWINDOW_DEBUG
-                winDebug("Win %p is now restacking.\n",
-                         pRLWinPriv);
-#endif
-                break;
-            }
-
-#if CYGMULTIWINDOW_DEBUG
-            winDebug("Win %p forbid to change z order (%p).\n",
-                     pRLWinPriv,
-                     pWinPos->hwndInsertAfter);
-#endif
-            pWinPos->flags |= SWP_NOZORDER;
-        }
-        break;
-#endif
-
-    case WM_MOVE:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_MOVE\n");
-#endif
-        if (g_fNoConfigureWindow)
-            break;
-#if 0
-        /* Bail if Windows window is not actually moving */
-        if (pRLWinPriv->dwX == (short) LOWORD(lParam)
-            && pRLWinPriv->dwY == (short) HIWORD(lParam))
-            break;
-
-        /* Also bail if we're maximizing, we'll do the whole thing in WM_SIZE */
-        {
-            WINDOWPLACEMENT windPlace;
-
-            windPlace.length = sizeof(WINDOWPLACEMENT);
-
-            /* Get current window placement */
-            GetWindowPlacement(hwnd, &windPlace);
-
-            /* Bail if maximizing */
-            if (windPlace.showCmd == SW_MAXIMIZE
-                || windPlace.showCmd == SW_SHOWMAXIMIZED)
-                break;
-        }
-#endif
-
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("\t(%d, %d)\n", (short) LOWORD(lParam),
-                 (short) HIWORD(lParam));
-#endif
-        if (!pRLWinPriv->fMovingOrSizing) {
-            winMWExtWMMoveXWindow(pWin, (LOWORD(lParam) - wBorderWidth(pWin)
-                                         - GetSystemMetrics(SM_XVIRTUALSCREEN)),
-                                  (HIWORD(lParam) - wBorderWidth(pWin)
-                                   - GetSystemMetrics(SM_YVIRTUALSCREEN)));
-        }
-        return 0;
-
-    case WM_SHOWWINDOW:
-#if CYGMULTIWINDOW_DEBUG || TRUE
-        winDebug("winMWExtWMWindowProc - WM_SHOWWINDOW\n");
-#endif
-        /* Bail out if the window is being hidden */
-        if (!wParam)
-            return 0;
-
-        winMWExtWMUpdateWindowDecoration(pRLWinPriv, pScreenInfo);
-
-        break;
-
-    case WM_SIZING:
-        /* Need to legalize the size according to WM_NORMAL_HINTS */
-        /* for applications like xterm */
-        return ValidateSizing(hwnd, pWin, wParam, lParam);
-
-    case WM_WINDOWPOSCHANGED:
-    {
-        pWinPos = (LPWINDOWPOS) lParam;
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_WINDOWPOSCHANGED\n");
-        winDebug("\tflags: %s%s%s%s%s%s%s%s%s%s%s%s\n",
-                 (pWinPos->flags & SWP_DRAWFRAME) ? "SWP_DRAWFRAME " : "",
-                 (pWinPos->flags & SWP_FRAMECHANGED) ? "SWP_FRAMECHANGED " : "",
-                 (pWinPos->flags & SWP_HIDEWINDOW) ? "SWP_HIDEWINDOW " : "",
-                 (pWinPos->flags & SWP_NOACTIVATE) ? "SWP_NOACTIVATE " : "",
-                 (pWinPos->flags & SWP_NOCOPYBITS) ? "SWP_NOCOPYBITS " : "",
-                 (pWinPos->flags & SWP_NOMOVE) ? "SWP_NOMOVE " : "",
-                 (pWinPos->
-                  flags & SWP_NOOWNERZORDER) ? "SWP_NOOWNERZORDER " : "",
-                 (pWinPos->flags & SWP_NOSIZE) ? "SWP_NOSIZE " : "",
-                 (pWinPos->flags & SWP_NOREDRAW) ? "SWP_NOREDRAW " : "",
-                 (pWinPos->
-                  flags & SWP_NOSENDCHANGING) ? "SWP_NOSENDCHANGING " : "",
-                 (pWinPos->flags & SWP_NOZORDER) ? "SWP_NOZORDER " : "",
-                 (pWinPos->flags & SWP_SHOWWINDOW) ? "SWP_SHOWWINDOW " : "");
-        winDebug("\tno_configure: %s\n", (g_fNoConfigureWindow ? "Yes" : "No"));
-        winDebug("\textend: (%d, %d, %d, %d)\n",
-                 pWinPos->x, pWinPos->y, pWinPos->cx, pWinPos->cy);
-
-#endif
-        if (pWinPos->flags & SWP_HIDEWINDOW)
-            break;
-
-        if (!(pWinPos->flags & SWP_NOSIZE)) {
-            if (IsIconic(hwnd)) {
-#if CYGMULTIWINDOW_DEBUG
-                winDebug("\tIconic -> MINIMIZED\n");
-#endif
-
-                winWindowsWMSendEvent(WindowsWMControllerNotify,
-                                      WindowsWMControllerNotifyMask,
-                                      1,
-                                      WindowsWMMinimizeWindow,
-                                      pWin->drawable.id, 0, 0, 0, 0);
-            }
-            else if (IsZoomed(hwnd)) {
-#if CYGMULTIWINDOW_DEBUG
-                winDebug("\tZoomed -> MAXIMIZED\n");
-#endif
-                winWindowsWMSendEvent(WindowsWMControllerNotify,
-                                      WindowsWMControllerNotifyMask,
-                                      1,
-                                      WindowsWMMaximizeWindow,
-                                      pWin->drawable.id, 0, 0, 0, 0);
-            }
-            else {
-#if CYGMULTIWINDOW_DEBUG
-                winDebug("\tnone -> RESTORED\n");
-#endif
-                winWindowsWMSendEvent(WindowsWMControllerNotify,
-                                      WindowsWMControllerNotifyMask,
-                                      1,
-                                      WindowsWMRestoreWindow,
-                                      pWin->drawable.id, 0, 0, 0, 0);
-            }
-        }
-        if (!g_fNoConfigureWindow) {
-
-            if (!pRLWinPriv->fMovingOrSizing
-                /*&& (pWinPos->flags & SWP_SHOWWINDOW) */ ) {
-                GetClientRect(hwnd, &rcClient);
-                MapWindowPoints(hwnd, HWND_DESKTOP, (LPPOINT) &rcClient, 2);
-
-                if (!(pWinPos->flags & SWP_NOMOVE)
-                    && !(pWinPos->flags & SWP_NOSIZE)) {
-#if CYGMULTIWINDOW_DEBUG
-                    winDebug("\tmove & resize\n");
-#endif
-
-                    winMWExtWMMoveResizeXWindow(pWin,
-                                                rcClient.left -
-                                                wBorderWidth(pWin)
-                                                -
-                                                GetSystemMetrics
-                                                (SM_XVIRTUALSCREEN),
-                                                rcClient.top -
-                                                wBorderWidth(pWin)
-                                                -
-                                                GetSystemMetrics
-                                                (SM_YVIRTUALSCREEN),
-                                                rcClient.right - rcClient.left -
-                                                wBorderWidth(pWin) * 2,
-                                                rcClient.bottom - rcClient.top -
-                                                wBorderWidth(pWin) * 2);
-                }
-                else if (!(pWinPos->flags & SWP_NOMOVE)) {
-#if CYGMULTIWINDOW_DEBUG
-                    winDebug("\tmove\n");
-#endif
-
-                    winMWExtWMMoveResizeXWindow(pWin,
-                                                rcClient.left -
-                                                wBorderWidth(pWin)
-                                                -
-                                                GetSystemMetrics
-                                                (SM_XVIRTUALSCREEN),
-                                                rcClient.top -
-                                                wBorderWidth(pWin)
-                                                -
-                                                GetSystemMetrics
-                                                (SM_YVIRTUALSCREEN),
-                                                rcClient.right - rcClient.left -
-                                                wBorderWidth(pWin) * 2,
-                                                rcClient.bottom - rcClient.top -
-                                                wBorderWidth(pWin) * 2);
-                }
-                else if (!(pWinPos->flags & SWP_NOMOVE)) {
-#if CYGMULTIWINDOW_DEBUG
-                    winDebug("\tmove\n");
-#endif
-
-                    winMWExtWMMoveXWindow(pWin,
-                                          rcClient.left - wBorderWidth(pWin)
-                                          - GetSystemMetrics(SM_XVIRTUALSCREEN),
-                                          rcClient.top - wBorderWidth(pWin)
-                                          -
-                                          GetSystemMetrics(SM_YVIRTUALSCREEN));
-                }
-                else if (!(pWinPos->flags & SWP_NOSIZE)) {
-#if CYGMULTIWINDOW_DEBUG
-                    winDebug("\tresize\n");
-#endif
-
-                    winMWExtWMResizeXWindow(pWin,
-                                            rcClient.right - rcClient.left
-                                            - wBorderWidth(pWin) * 2,
-                                            rcClient.bottom - rcClient.top
-                                            - wBorderWidth(pWin) * 2);
-                }
-            }
-        }
-    }
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_WINDOWPOSCHANGED - done.\n");
-#endif
-        return 0;
-
-    case WM_SIZE:
-        /* see dix/window.c */
-        /* FIXME: Maximize/Restore? */
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_SIZE\n");
-#endif
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("\t(%d, %d) %d\n", (short) LOWORD(lParam),
-                 (short) HIWORD(lParam), g_fNoConfigureWindow);
-#endif
-        if (g_fNoConfigureWindow)
-            break;
-
-        /* Branch on type of resizing occurring */
-        switch (wParam) {
-        case SIZE_MINIMIZED:
-#if CYGMULTIWINDOW_DEBUG
-            winDebug("\tSIZE_MINIMIZED\n");
-#endif
-
-            winWindowsWMSendEvent(WindowsWMControllerNotify,
-                                  WindowsWMControllerNotifyMask,
-                                  1,
-                                  WindowsWMMinimizeWindow,
-                                  pWin->drawable.id,
-                                  0, 0, LOWORD(lParam), HIWORD(lParam));
-            break;
-
-        case SIZE_RESTORED:
-#if CYGMULTIWINDOW_DEBUG
-            winDebug("\tSIZE_RESTORED\n");
-#endif
-            winWindowsWMSendEvent(WindowsWMControllerNotify,
-                                  WindowsWMControllerNotifyMask,
-                                  1,
-                                  WindowsWMRestoreWindow,
-                                  pWin->drawable.id,
-                                  0, 0, LOWORD(lParam), HIWORD(lParam));
-            break;
-
-        case SIZE_MAXIMIZED:
-#if CYGMULTIWINDOW_DEBUG
-            winDebug("\tSIZE_MAXIMIZED\n");
-#endif
-            winWindowsWMSendEvent(WindowsWMControllerNotify,
-                                  WindowsWMControllerNotifyMask,
-                                  1,
-                                  WindowsWMMaximizeWindow,
-                                  pWin->drawable.id,
-                                  0, 0, LOWORD(lParam), HIWORD(lParam));
-            break;
-        }
-
-        /* Perform the resize and notify the X client */
-        if (!pRLWinPriv->fMovingOrSizing) {
-            winMWExtWMResizeXWindow(pWin, (short) LOWORD(lParam)
-                                    - wBorderWidth(pWin) * 2,
-                                    (short) HIWORD(lParam)
-                                    - wBorderWidth(pWin) * 2);
-        }
-        break;
-
-    case WM_ACTIVATEAPP:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_ACTIVATEAPP\n");
-#endif
-        if (wParam) {
-            winWindowsWMSendEvent(WindowsWMActivationNotify,
-                                  WindowsWMActivationNotifyMask,
-                                  1,
-                                  WindowsWMIsActive,
-                                  pWin->drawable.id, 0, 0, 0, 0);
-        }
-        else {
-            winWindowsWMSendEvent(WindowsWMActivationNotify,
-                                  WindowsWMActivationNotifyMask,
-                                  1,
-                                  WindowsWMIsInactive,
-                                  pWin->drawable.id, 0, 0, 0, 0);
-        }
-        break;
-
-    case WM_SETCURSOR:
-        if (LOWORD(lParam) == HTCLIENT) {
-            if (!g_fSoftwareCursor)
-                SetCursor(pScreenPriv->cursor.handle);
-            return TRUE;
-        }
-        break;
-
-    case WM_ENTERSIZEMOVE:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_ENTERSIZEMOVE\n");
-#endif
-        pRLWinPriv->fMovingOrSizing = TRUE;
-        break;
-
-    case WM_EXITSIZEMOVE:
-#if CYGMULTIWINDOW_DEBUG
-        winDebug("winMWExtWMWindowProc - WM_EXITSIZEMOVE\n");
-#endif
-        pRLWinPriv->fMovingOrSizing = FALSE;
-
-        GetClientRect(hwnd, &rcClient);
-
-        MapWindowPoints(hwnd, HWND_DESKTOP, (LPPOINT) &rcClient, 2);
-
-        winMWExtWMMoveResizeXWindow(pWin, rcClient.left - wBorderWidth(pWin)
-                                    - GetSystemMetrics(SM_XVIRTUALSCREEN),
-                                    rcClient.top - wBorderWidth(pWin)
-                                    - GetSystemMetrics(SM_YVIRTUALSCREEN),
-                                    rcClient.right - rcClient.left
-                                    - wBorderWidth(pWin) * 2,
-                                    rcClient.bottom - rcClient.top
-                                    - wBorderWidth(pWin) * 2);
-        break;
-
-    default:
-        break;
-    }
-
-    return DefWindowProc(hwnd, message, wParam, lParam);
-}
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
deleted file mode 100644
index b9399fae3..000000000
--- a/hw/xwin/winwindowswm.c
+++ /dev/null
@@ -1,596 +0,0 @@
-/* WindowsWM extension is based on AppleWM extension */
-/**************************************************************************
-
-Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
-Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include "win.h"
-
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#include "swaprep.h"
-#define _WINDOWSWM_SERVER_
-#include <X11/extensions/windowswmstr.h>
-#include "protocol-versions.h"
-
-static int WMErrorBase;
-static unsigned char WMReqCode = 0;
-static int WMEventBase = 0;
-
-static RESTYPE ClientType, eventResourceType;   /* resource types for event masks */
-static XID eventResource;
-
-/* Currently selected events */
-static unsigned int eventMask = 0;
-
-static int WMFreeClient(void *data, XID id);
-static int WMFreeEvents(void *data, XID id);
-static void SNotifyEvent(xWindowsWMNotifyEvent * from,
-                         xWindowsWMNotifyEvent * to);
-
-typedef struct _WMEvent *WMEventPtr;
-typedef struct _WMEvent {
-    WMEventPtr next;
-    ClientPtr client;
-    XID clientResource;
-    unsigned int mask;
-} WMEventRec;
-
-static int
-ProcWindowsWMQueryVersion(ClientPtr client)
-{
-    xWindowsWMQueryVersionReply rep;
-
-    REQUEST_SIZE_MATCH(xWindowsWMQueryVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-    rep.majorVersion = SERVER_WINDOWSWM_MAJOR_VERSION;
-    rep.minorVersion = SERVER_WINDOWSWM_MINOR_VERSION;
-    rep.patchVersion = SERVER_WINDOWSWM_PATCH_VERSION;
-    if (client->swapped) {
-        swaps(&rep.sequenceNumber);
-        swapl(&rep.length);
-    }
-    WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), &rep);
-    return Success;
-}
-
-/* events */
-
-static inline void
-updateEventMask(WMEventPtr * pHead)
-{
-    WMEventPtr pCur;
-
-    eventMask = 0;
-    for (pCur = *pHead; pCur != NULL; pCur = pCur->next)
-        eventMask |= pCur->mask;
-}
-
- /*ARGSUSED*/ static int
-WMFreeClient(void *data, XID id)
-{
-    WMEventPtr pEvent;
-    WMEventPtr *pHead, pCur, pPrev;
-
-    pEvent = (WMEventPtr) data;
-    dixLookupResourceByType((void *) &pHead, eventResource, eventResourceType,
-                            NullClient, DixUnknownAccess);
-    if (pHead) {
-        pPrev = 0;
-        for (pCur = *pHead; pCur && pCur != pEvent; pCur = pCur->next)
-            pPrev = pCur;
-        if (pCur) {
-            if (pPrev)
-                pPrev->next = pEvent->next;
-            else
-                *pHead = pEvent->next;
-        }
-        updateEventMask(pHead);
-    }
-    free((void *) pEvent);
-    return 1;
-}
-
- /*ARGSUSED*/ static int
-WMFreeEvents(void *data, XID id)
-{
-    WMEventPtr *pHead, pCur, pNext;
-
-    pHead = (WMEventPtr *) data;
-    for (pCur = *pHead; pCur; pCur = pNext) {
-        pNext = pCur->next;
-        FreeResource(pCur->clientResource, ClientType);
-        free((void *) pCur);
-    }
-    free((void *) pHead);
-    eventMask = 0;
-    return 1;
-}
-
-static int
-ProcWindowsWMSelectInput(ClientPtr client)
-{
-    REQUEST(xWindowsWMSelectInputReq);
-    WMEventPtr pEvent, pNewEvent, *pHead;
-    XID clientResource;
-
-    REQUEST_SIZE_MATCH(xWindowsWMSelectInputReq);
-    dixLookupResourceByType((void *) &pHead, eventResource, eventResourceType,
-                            client, DixWriteAccess);
-    if (stuff->mask != 0) {
-        if (pHead) {
-            /* check for existing entry. */
-            for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
-                if (pEvent->client == client) {
-                    pEvent->mask = stuff->mask;
-                    updateEventMask(pHead);
-                    return Success;
-                }
-            }
-        }
-
-        /* build the entry */
-        pNewEvent = malloc(sizeof(WMEventRec));
-        if (!pNewEvent)
-            return BadAlloc;
-        pNewEvent->next = 0;
-        pNewEvent->client = client;
-        pNewEvent->mask = stuff->mask;
-        /*
-         * add a resource that will be deleted when
-         * the client goes away
-         */
-        clientResource = FakeClientID(client->index);
-        pNewEvent->clientResource = clientResource;
-        if (!AddResource(clientResource, ClientType, (void *) pNewEvent))
-            return BadAlloc;
-        /*
-         * create a resource to contain a pointer to the list
-         * of clients selecting input.  This must be indirect as
-         * the list may be arbitrarily rearranged which cannot be
-         * done through the resource database.
-         */
-        if (!pHead) {
-            pHead = malloc(sizeof(WMEventPtr));
-            if (!pHead ||
-                !AddResource(eventResource, eventResourceType, (void *) pHead))
-            {
-                FreeResource(clientResource, RT_NONE);
-                return BadAlloc;
-            }
-            *pHead = 0;
-        }
-        pNewEvent->next = *pHead;
-        *pHead = pNewEvent;
-        updateEventMask(pHead);
-    }
-    else if (stuff->mask == 0) {
-        /* delete the interest */
-        if (pHead) {
-            pNewEvent = 0;
-            for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
-                if (pEvent->client == client)
-                    break;
-                pNewEvent = pEvent;
-            }
-            if (pEvent) {
-                FreeResource(pEvent->clientResource, ClientType);
-                if (pNewEvent)
-                    pNewEvent->next = pEvent->next;
-                else
-                    *pHead = pEvent->next;
-                free(pEvent);
-                updateEventMask(pHead);
-            }
-        }
-    }
-    else {
-        client->errorValue = stuff->mask;
-        return BadValue;
-    }
-    return Success;
-}
-
-/*
- * deliver the event
- */
-
-void
-winWindowsWMSendEvent(int type, unsigned int mask, int which, int arg,
-                      Window window, int x, int y, int w, int h)
-{
-    WMEventPtr *pHead, pEvent;
-    ClientPtr client;
-    xWindowsWMNotifyEvent se;
-
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("winWindowsWMSendEvent %d %d %d %d,  %d %d - %d %d\n",
-           type, mask, which, arg, x, y, w, h);
-#endif
-    dixLookupResourceByType((void *) &pHead, eventResource, eventResourceType,
-                            NullClient, DixUnknownAccess);
-    if (!pHead)
-        return;
-    for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
-        client = pEvent->client;
-#if CYGMULTIWINDOW_DEBUG
-        ErrorF("winWindowsWMSendEvent - %p\n", client);
-#endif
-        if ((pEvent->mask & mask) == 0) {
-            continue;
-        }
-#if CYGMULTIWINDOW_DEBUG
-        ErrorF("winWindowsWMSendEvent - send\n");
-#endif
-        se.type = type + WMEventBase;
-        se.kind = which;
-        se.window = window;
-        se.arg = arg;
-        se.x = x;
-        se.y = y;
-        se.w = w;
-        se.h = h;
-        se.time = currentTime.milliseconds;
-        WriteEventsToClient(client, 1, (xEvent *) &se);
-    }
-}
-
-/* general utility functions */
-
-static int
-ProcWindowsWMDisableUpdate(ClientPtr client)
-{
-    REQUEST_SIZE_MATCH(xWindowsWMDisableUpdateReq);
-
-    //winDisableUpdate();
-
-    return Success;
-}
-
-static int
-ProcWindowsWMReenableUpdate(ClientPtr client)
-{
-    REQUEST_SIZE_MATCH(xWindowsWMReenableUpdateReq);
-
-    //winEnableUpdate();
-
-    return Success;
-}
-
-/* window functions */
-
-static int
-ProcWindowsWMSetFrontProcess(ClientPtr client)
-{
-    REQUEST_SIZE_MATCH(xWindowsWMSetFrontProcessReq);
-
-    //QuartzMessageMainThread(kWindowsSetFrontProcess, NULL, 0);
-
-    return Success;
-}
-
-/* frame functions */
-
-static int
-ProcWindowsWMFrameGetRect(ClientPtr client)
-{
-    xWindowsWMFrameGetRectReply rep;
-    RECT rcNew;
-
-    REQUEST(xWindowsWMFrameGetRectReq);
-
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameGetRect %zu %d\n",
-           (sizeof(xWindowsWMFrameGetRectReq) >> 2), (int) client->req_len);
-#endif
-
-    REQUEST_SIZE_MATCH(xWindowsWMFrameGetRectReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
-
-    if (stuff->frame_rect != 0) {
-        ErrorF("ProcWindowsWMFrameGetRect - stuff->frame_rect != 0\n");
-        return BadValue;
-    }
-
-    /* Store the origin, height, and width in a rectangle structure */
-    SetRect(&rcNew, stuff->ix, stuff->iy,
-            stuff->ix + stuff->iw, stuff->iy + stuff->ih);
-
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
-           stuff->ix, stuff->iy, stuff->ix + stuff->iw, stuff->iy + stuff->ih);
-#endif
-
-    /*
-     * Calculate the required size of the Windows window rectangle,
-     * given the size of the Windows window client area.
-     */
-    AdjustWindowRectEx(&rcNew, stuff->frame_style, FALSE,
-                       stuff->frame_style_ex);
-    rep.x = rcNew.left;
-    rep.y = rcNew.top;
-    rep.w = rcNew.right - rcNew.left;
-    rep.h = rcNew.bottom - rcNew.top;
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
-           rep.x, rep.y, rep.w, rep.h);
-#endif
-
-    WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), &rep);
-    return Success;
-}
-
-static int
-ProcWindowsWMFrameDraw(ClientPtr client)
-{
-    REQUEST(xWindowsWMFrameDrawReq);
-    WindowPtr pWin;
-    win32RootlessWindowPtr pRLWinPriv;
-    RECT rcNew;
-    int nCmdShow, rc;
-    RegionRec newShape;
-
-    REQUEST_SIZE_MATCH(xWindowsWMFrameDrawReq);
-
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameDraw\n");
-#endif
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
-    if (rc != Success)
-        return rc;
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameDraw - Window found\n");
-#endif
-
-    pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, TRUE);
-    if (pRLWinPriv == 0)
-        return BadWindow;
-
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameDraw - HWND %p 0x%08x 0x%08x\n",
-           pRLWinPriv->hWnd, (int) stuff->frame_style,
-           (int) stuff->frame_style_ex);
-    ErrorF("ProcWindowsWMFrameDraw - %d %d %d %d\n",
-           stuff->ix, stuff->iy, stuff->iw, stuff->ih);
-#endif
-
-    /* Store the origin, height, and width in a rectangle structure */
-    SetRect(&rcNew, stuff->ix, stuff->iy,
-            stuff->ix + stuff->iw, stuff->iy + stuff->ih);
-
-    /*
-     * Calculate the required size of the Windows window rectangle,
-     * given the size of the Windows window client area.
-     */
-    AdjustWindowRectEx(&rcNew, stuff->frame_style, FALSE,
-                       stuff->frame_style_ex);
-
-    /* Set the window extended style flags */
-    if (!SetWindowLongPtr(pRLWinPriv->hWnd, GWL_EXSTYLE, stuff->frame_style_ex)) {
-        return BadValue;
-    }
-
-    /* Set the window standard style flags */
-    if (!SetWindowLongPtr(pRLWinPriv->hWnd, GWL_STYLE, stuff->frame_style)) {
-        return BadValue;
-    }
-
-    /* Flush the window style */
-    if (!SetWindowPos(pRLWinPriv->hWnd, NULL,
-                      rcNew.left, rcNew.top,
-                      rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
-                      SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOACTIVATE)) {
-        return BadValue;
-    }
-    if (!IsWindowVisible(pRLWinPriv->hWnd))
-        nCmdShow = SW_HIDE;
-    else
-        nCmdShow = SW_SHOWNA;
-
-    ShowWindow(pRLWinPriv->hWnd, nCmdShow);
-
-    if (wBoundingShape(pWin) != NULL) {
-        /* wBoundingShape is relative to *inner* origin of window.
-           Translate by borderWidth to get the outside-relative position. */
-
-        RegionNull(&newShape);
-        RegionCopy(&newShape, wBoundingShape(pWin));
-        RegionTranslate(&newShape, pWin->borderWidth, pWin->borderWidth);
-        winMWExtWMReshapeFrame(pRLWinPriv, &newShape);
-        RegionUninit(&newShape);
-    }
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameDraw - done\n");
-#endif
-
-    return Success;
-}
-
-static int
-ProcWindowsWMFrameSetTitle(ClientPtr client)
-{
-    unsigned int title_length, title_max;
-    char *title_bytes;
-
-    REQUEST(xWindowsWMFrameSetTitleReq);
-    WindowPtr pWin;
-    win32RootlessWindowPtr pRLWinPriv;
-    int rc;
-
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameSetTitle\n");
-#endif
-
-    REQUEST_AT_LEAST_SIZE(xWindowsWMFrameSetTitleReq);
-
-    rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
-    if (rc != Success)
-        return rc;
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameSetTitle - Window found\n");
-#endif
-
-    title_length = stuff->title_length;
-    title_max = (stuff->length << 2) - sizeof(xWindowsWMFrameSetTitleReq);
-
-    if (title_max < title_length)
-        return BadValue;
-
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameSetTitle - length is valid\n");
-#endif
-
-    title_bytes = malloc(title_length + 1);
-    strncpy(title_bytes, (char *) &stuff[1], title_length);
-    title_bytes[title_length] = '\0';
-
-    pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE);
-
-    if (pRLWinPriv == 0) {
-        free(title_bytes);
-        return BadWindow;
-    }
-
-    /* Flush the window style */
-    SetWindowText(pRLWinPriv->hWnd, title_bytes);
-
-    free(title_bytes);
-
-#if CYGMULTIWINDOW_DEBUG
-    ErrorF("ProcWindowsWMFrameSetTitle - done\n");
-#endif
-
-    return Success;
-}
-
-/* dispatch */
-
-static int
-ProcWindowsWMDispatch(ClientPtr client)
-{
-    REQUEST(xReq);
-
-    switch (stuff->data) {
-    case X_WindowsWMQueryVersion:
-        return ProcWindowsWMQueryVersion(client);
-    }
-
-    if (!client->local)
-        return WMErrorBase + WindowsWMClientNotLocal;
-
-    switch (stuff->data) {
-    case X_WindowsWMSelectInput:
-        return ProcWindowsWMSelectInput(client);
-    case X_WindowsWMDisableUpdate:
-        return ProcWindowsWMDisableUpdate(client);
-    case X_WindowsWMReenableUpdate:
-        return ProcWindowsWMReenableUpdate(client);
-    case X_WindowsWMSetFrontProcess:
-        return ProcWindowsWMSetFrontProcess(client);
-    case X_WindowsWMFrameGetRect:
-        return ProcWindowsWMFrameGetRect(client);
-    case X_WindowsWMFrameDraw:
-        return ProcWindowsWMFrameDraw(client);
-    case X_WindowsWMFrameSetTitle:
-        return ProcWindowsWMFrameSetTitle(client);
-    default:
-        return BadRequest;
-    }
-}
-
-static void
-SNotifyEvent(xWindowsWMNotifyEvent * from, xWindowsWMNotifyEvent * to)
-{
-    to->type = from->type;
-    to->kind = from->kind;
-    cpswaps(from->sequenceNumber, to->sequenceNumber);
-    cpswapl(from->window, to->window);
-    cpswapl(from->time, to->time);
-    cpswapl(from->arg, to->arg);
-}
-
-static int
-SProcWindowsWMQueryVersion(ClientPtr client)
-{
-    REQUEST(xWindowsWMQueryVersionReq);
-    swaps(&stuff->length);
-    return ProcWindowsWMQueryVersion(client);
-}
-
-static int
-SProcWindowsWMDispatch(ClientPtr client)
-{
-    REQUEST(xReq);
-
-    /* It is bound to be non-local when there is byte swapping */
-    if (!client->local)
-        return WMErrorBase + WindowsWMClientNotLocal;
-
-    /* only local clients are allowed WM access */
-    switch (stuff->data) {
-    case X_WindowsWMQueryVersion:
-        return SProcWindowsWMQueryVersion(client);
-    default:
-        return BadRequest;
-    }
-}
-
-void
-winWindowsWMExtensionInit(void)
-{
-    ExtensionEntry *extEntry;
-
-    ClientType = CreateNewResourceType(WMFreeClient, "WMClient");
-    eventResourceType = CreateNewResourceType(WMFreeEvents, "WMEvent");
-    eventResource = FakeClientID(0);
-
-    if (ClientType && eventResourceType &&
-        (extEntry = AddExtension(WINDOWSWMNAME,
-                                 WindowsWMNumberEvents,
-                                 WindowsWMNumberErrors,
-                                 ProcWindowsWMDispatch,
-                                 SProcWindowsWMDispatch,
-                                 NULL, StandardMinorOpcode))) {
-        size_t i;
-
-        WMReqCode = (unsigned char) extEntry->base;
-        WMErrorBase = extEntry->errorBase;
-        WMEventBase = extEntry->eventBase;
-        for (i = 0; i < WindowsWMNumberEvents; i++)
-            EventSwapVector[WMEventBase + i] = (EventSwapPtr) SNotifyEvent;
-    }
-}
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 02186b13e..16b5f0565 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -220,14 +220,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                use RandR to resize the X screen
              */
             if ((!s_pScreenInfo->fUserGaveHeightAndWidth) &&
-                (s_pScreenInfo->iResizeMode == resizeWithRandr) && (FALSE
-#ifdef XWIN_MULTIWINDOWEXTWM
-                                                                    ||
-                                                                    s_pScreenInfo->
-                                                                    fMWExtWM
-#endif
-                                                                    ||
-                                                                    s_pScreenInfo->
+                (s_pScreenInfo->iResizeMode == resizeWithRandr) && (s_pScreenInfo->
                                                                     fRootless
                                                                     ||
                                                                     s_pScreenInfo->
@@ -315,9 +308,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         /* Break if we do not allow resizing */
         if ((s_pScreenInfo->iResizeMode == resizeNotAllowed)
             || !s_pScreenInfo->fDecoration
-#ifdef XWIN_MULTIWINDOWEXTWM
-            || s_pScreenInfo->fMWExtWM
-#endif
             || s_pScreenInfo->fRootless
             || s_pScreenInfo->fMultiWindow
             || s_pScreenInfo->fFullScreen)
@@ -616,9 +606,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         if (s_pScreenInfo == NULL
             || (s_pScreenInfo->iResizeMode != resizeWithScrollbars)
             || s_pScreenInfo->fFullScreen || !s_pScreenInfo->fDecoration
-#ifdef XWIN_MULTIWINDOWEXTWM
-            || s_pScreenInfo->fMWExtWM
-#endif
             || s_pScreenInfo->fRootless
             || s_pScreenInfo->fMultiWindow
             )
@@ -799,22 +786,14 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     case WM_LBUTTONDOWN:
         if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
             break;
-        if (s_pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOWEXTWM
-            || s_pScreenInfo->fMWExtWM
-#endif
-            )
+        if (s_pScreenInfo->fRootless)
             SetCapture(hwnd);
         return winMouseButtonsHandle(s_pScreen, ButtonPress, Button1, wParam);
 
     case WM_LBUTTONUP:
         if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
             break;
-        if (s_pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOWEXTWM
-            || s_pScreenInfo->fMWExtWM
-#endif
-            )
+        if (s_pScreenInfo->fRootless)
             ReleaseCapture();
         return winMouseButtonsHandle(s_pScreen, ButtonRelease, Button1, wParam);
 
@@ -822,22 +801,14 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     case WM_MBUTTONDOWN:
         if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
             break;
-        if (s_pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOWEXTWM
-            || s_pScreenInfo->fMWExtWM
-#endif
-            )
+        if (s_pScreenInfo->fRootless)
             SetCapture(hwnd);
         return winMouseButtonsHandle(s_pScreen, ButtonPress, Button2, wParam);
 
     case WM_MBUTTONUP:
         if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
             break;
-        if (s_pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOWEXTWM
-            || s_pScreenInfo->fMWExtWM
-#endif
-            )
+        if (s_pScreenInfo->fRootless)
             ReleaseCapture();
         return winMouseButtonsHandle(s_pScreen, ButtonRelease, Button2, wParam);
 
@@ -845,22 +816,14 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     case WM_RBUTTONDOWN:
         if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
             break;
-        if (s_pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOWEXTWM
-            || s_pScreenInfo->fMWExtWM
-#endif
-            )
+        if (s_pScreenInfo->fRootless)
             SetCapture(hwnd);
         return winMouseButtonsHandle(s_pScreen, ButtonPress, Button3, wParam);
 
     case WM_RBUTTONUP:
         if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
             break;
-        if (s_pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOWEXTWM
-            || s_pScreenInfo->fMWExtWM
-#endif
-            )
+        if (s_pScreenInfo->fRootless)
             ReleaseCapture();
         return winMouseButtonsHandle(s_pScreen, ButtonRelease, Button3, wParam);
 
@@ -868,22 +831,14 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     case WM_XBUTTONDOWN:
         if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
             break;
-        if (s_pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOWEXTWM
-            || s_pScreenInfo->fMWExtWM
-#endif
-            )
+        if (s_pScreenInfo->fRootless)
             SetCapture(hwnd);
         return winMouseButtonsHandle(s_pScreen, ButtonPress, HIWORD(wParam) + 7,
                                      wParam);
     case WM_XBUTTONUP:
         if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
             break;
-        if (s_pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOWEXTWM
-            || s_pScreenInfo->fMWExtWM
-#endif
-            )
+        if (s_pScreenInfo->fRootless)
             ReleaseCapture();
         return winMouseButtonsHandle(s_pScreen, ButtonRelease,
                                      HIWORD(wParam) + 7, wParam);
@@ -1166,14 +1121,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         /* Call engine specific screen activation/deactivation function */
         (*s_pScreenPriv->pwinActivateApp) (s_pScreen);
 
-#ifdef XWIN_MULTIWINDOWEXTWM
-        if (s_pScreenPriv->fActive) {
-            /* Restack all window unless using built-in wm. */
-            if (s_pScreenInfo->fMWExtWM)
-                winMWExtWMRestackWindows(s_pScreen);
-        }
-#endif
-
         return 0;
 
     case WM_COMMAND:
diff --git a/meson.build b/meson.build
index 80f353e0c..e835e2d31 100644
--- a/meson.build
+++ b/meson.build
@@ -82,7 +82,6 @@ dri3proto_dep = dependency('dri3proto', version: '>= 1.2', required: get_option(
 xineramaproto_dep = dependency('xineramaproto')
 xf86bigfontproto_dep = dependency('xf86bigfontproto', version: '>= 1.2.0')
 xf86vidmodeproto_dep = dependency('xf86vidmodeproto', version: '>= 2.2.99.1')
-windowswmproto_dep = dependency('windowswmproto', required: false)
 applewmproto_dep = dependency('applewmproto', version: '>= 1.4', required: false)
 xshmfence_dep = dependency('xshmfence', version: '>= 1.1', required: false)
 
@@ -477,7 +476,6 @@ common_dep = [
     xf86bigfontproto_dep,
     xf86dgaproto_dep,
     xf86vidmodeproto_dep,
-    windowswmproto_dep,
     applewmproto_dep,
 
     pixman_dep,


More information about the xorg-commit mailing list