[Xorg-commit] xc/programs/Xserver/hw/xwin win.h,1.1.4.1.2.2,1.1.4.1.2.3 winwindowswm.c,1.1.2.1,1.1.2.2 winwin32rootless.c,1.1.2.1,1.1.2.2 winwin32rootlesswindow.c,1.1.2.1,1.1.2.2 winwin32rootlesswndproc.c,1.1.2.1,1.1.2.2

Kensuke Matsuzaki xorg-commit at pdx.freedesktop.org
Thu Dec 18 03:32:05 EET 2003


Committed by: zakki

Update of /cvs/xorg/xc/programs/Xserver/hw/xwin
In directory pdx:/tmp/cvs-serv7712/programs/Xserver/hw/xwin

Modified Files:
      Tag: CYGWIN
	win.h winwindowswm.c winwin32rootless.c 
	winwin32rootlesswindow.c winwin32rootlesswndproc.c 
Log Message:
improve resizing/moving window
ifdef out debugging message


Index: win.h
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/win.h,v
retrieving revision 1.1.4.1.2.2
retrieving revision 1.1.4.1.2.3
diff -u -d -r1.1.4.1.2.2 -r1.1.4.1.2.3
--- win.h	9 Dec 2003 01:37:16 -0000	1.1.4.1.2.2
+++ win.h	18 Dec 2003 01:32:03 -0000	1.1.4.1.2.3
@@ -568,7 +568,7 @@
 } winPrivScreenRec;
 
 
- typedef struct {
+typedef struct {
   RootlessWindowPtr	pFrame;
   HWND			hWnd;
   int			dwWidthBytes;
@@ -579,6 +579,7 @@
   BOOL			fResized;
   BOOL			fRestackingNow;
   BOOL			fClose;
+  BOOL			fMovingOrSizing;
   BOOL			fDestroyed;//for debug
   char			*pfb;
 } win32RootlessWindowRec, *win32RootlessWindowPtr;
@@ -1515,6 +1516,9 @@
 void
 winResizeXWindow (WindowPtr pWin, int w, int h);
 
+void
+winWin32RootlessMoveResizeXWindow (WindowPtr pWin, int x, int y, int w, int h);
+
 XID
 winGetWindowID (WindowPtr pWin);
 
@@ -1656,6 +1660,10 @@
  */
 
 void
+winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg,
+		       Window window, int x, int y, int w, int h);
+
+void
 winWindowsWMExtensionInit (void);
 
 

Index: winwindowswm.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwindowswm.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- winwindowswm.c	5 Dec 2003 03:37:26 -0000	1.1.2.1
+++ winwindowswm.c	18 Dec 2003 01:32:03 -0000	1.1.2.2
@@ -296,22 +296,27 @@
   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
   pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
   if (!pHead)
     return;
   for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
     {
       client = pEvent->client;
+#if CYGMULTIWINDOW_DEBUG
       ErrorF ("winWindowsWMSendEvent - x%08x\n", (int) client);
+#endif
       if ((pEvent->mask & mask) == 0
 	  || client == serverClient || client->clientGone)
 	{
 	  continue;
 	}
+#if CYGMULTIWINDOW_DEBUG 
       ErrorF ("winWindowsWMSendEvent - send\n");
+#endif
       se.type = type + WMEventBase;
       se.kind = which;
       se.window = window;
@@ -380,8 +385,10 @@
   RECT rcNew;
   REQUEST(xWindowsWMFrameGetRectReq);
 
+#if CYGMULTIWINDOW_DEBUG
   ErrorF ("ProcWindowsWMFrameGetRect %d %d\n",
 	  (sizeof(xWindowsWMFrameGetRectReq) >> 2), (int) client->req_len);
+#endif
   
   REQUEST_SIZE_MATCH(xWindowsWMFrameGetRectReq);
   rep.type = X_Reply;
@@ -400,8 +407,11 @@
   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.
@@ -411,8 +421,10 @@
   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), (char *)&rep);
   return (client->noClientException);
@@ -431,24 +443,30 @@
 
   REQUEST_SIZE_MATCH (xWindowsWMFrameDrawReq);
 
+#if CYGMULTIWINDOW_DEBUG
   ErrorF ("ProcWindowsWMFrameDraw\n");
+#endif
   if (!(pWin = SecurityLookupWindow((Drawable)stuff->window,
 				    client, SecurityReadAccess)))
     {
       return BadValue;
     }
+#if CYGMULTIWINDOW_DEBUG
   ErrorF ("ProcWindowsWMFrameDraw - Window found\n");
+#endif
 
   ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
 
   pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, TRUE);
   if (pRLWinPriv == 0) return BadWindow;
 
+#if CYGMULTIWINDOW_DEBUG
   ErrorF ("ProcWindowsWMFrameDraw - HWND 0x%08x 0x%08x 0x%08x",
 	  (int) 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
     
   GetWindowPlacement (pRLWinPriv->hWnd, &wndpl);
 
@@ -488,7 +506,9 @@
 
   winWin32RootlessUpdateIcon (pWin->drawable.id);
 
+#if CYGMULTIWINDOW_DEBUG
   ErrorF ("ProcWindowsWMFrameDraw - done\n");
+#endif
 
   return (client->noClientException);
 }
@@ -504,7 +524,9 @@
   WindowPtr pWin;
   win32RootlessWindowPtr pRLWinPriv;
 
+#if CYGMULTIWINDOW_DEBUG
   ErrorF ("ProcWindowsWMFrameSetTitle\n");
+#endif
 
   REQUEST_AT_LEAST_SIZE(xWindowsWMFrameSetTitleReq);
 
@@ -513,7 +535,9 @@
     {
       return BadValue;
     }
+#if CYGMULTIWINDOW_DEBUG
   ErrorF ("ProcWindowsWMFrameSetTitle - Window found\n");
+#endif
 
   title_length = stuff->title_length;
   title_max = (stuff->length << 2) - sizeof(xWindowsWMFrameSetTitleReq);
@@ -521,7 +545,9 @@
   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, (unsigned char *) &stuff[1], title_length);
@@ -540,7 +566,9 @@
 
   free (title_bytes);
 
+#if CYGMULTIWINDOW_DEBUG
   ErrorF ("ProcWindowsWMFrameSetTitle - done\n");
+#endif
 
   return (client->noClientException);
 }

Index: winwin32rootless.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwin32rootless.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- winwin32rootless.c	5 Dec 2003 03:37:26 -0000	1.1.2.1
+++ winwin32rootless.c	18 Dec 2003 01:32:03 -0000	1.1.2.2
@@ -51,7 +51,6 @@
 #define ULW_ALPHA	0x00000002
 #define ULW_OPAQUE	0x00000004
 #define AC_SRC_ALPHA	0x01
-#define CYGMULTIWINDOW_DEBUG    YES
 
 /*
  * Global variables
@@ -77,7 +76,7 @@
 winWin32RootlessQueryDIBFormat (win32RootlessWindowPtr pRLWinPriv, BITMAPINFOHEADER *pbmih)
 {
   HBITMAP		hbmp;
-#if CYGDEBUG
+#if CYGMULTIWINDOW_DEBUG
   LPDWORD		pdw = NULL;
 #endif
   
@@ -106,12 +105,12 @@
       return FALSE;
     }
 
-#if CYGDEBUG
+#if CYGMULTIWINDOW_DEBUG
   /* Get a pointer to bitfields */
   pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER));
 
   ErrorF ("winWin32RootlessQueryDIBFormat - First call masks: %08x %08x %08x\n",
-	  pdw[0], pdw[1], pdw[2]);
+	  (unsigned int)pdw[0], (unsigned int)pdw[1], (unsigned int)pdw[2]);
 #endif
 
   /* Get optimal color table, or the optimal bitfields */
@@ -236,6 +235,7 @@
   pRLWinPriv->fClose = FALSE;
   pRLWinPriv->fRestackingNow = FALSE;
   pRLWinPriv->fDestroyed = FALSE;
+  pRLWinPriv->fMovingOrSizing = FALSE;
   
   // Store the implementation private frame ID
   pFrame->wid = (RootlessFrameID) pRLWinPriv;
@@ -616,7 +616,7 @@
 	    }
 	  else
 	    {
-#if CYGDEBUG
+#if CYGMULTIWINDOW_DEBUG
 	      ErrorF ("winWin32RootlessStartDrawing - Shadow buffer allocated\n");
 #endif
 	    }
@@ -624,19 +624,20 @@
 	  /* Get information about the bitmap that was allocated */
 	  GetObject (hbmpNew, sizeof (dibsection), &dibsection);
 	  
-#if CYGDEBUG
+#if CYGMULTIWINDOW_DEBUG
 	  /* Print information about bitmap allocated */
 	  ErrorF ("winWin32RootlessStartDrawing - Dibsection width: %d height: %d "
 		  "depth: %d size image: %d\n",
-		  dibsection.dsBmih.biWidth, dibsection.dsBmih.biHeight,
-		  dibsection.dsBmih.biBitCount,
-		  dibsection.dsBmih.biSizeImage);
+		  (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 CYGDEBUG
+#if CYGMULTIWINDOW_DEBUG
 	  ErrorF ("winWin32RootlessStartDrawing - Attempting a shadow blit\n");
 #endif
 	  
@@ -649,7 +650,7 @@
 			    SRCCOPY);
 	  if (fReturn)
 	    {
-#if CYGDEBUG
+#if CYGMULTIWINDOW_DEBUG
 	      ErrorF ("winWin32RootlessStartDrawing - Shadow blit success\n");
 #endif
 	    }
@@ -671,9 +672,9 @@
 	  
 	  pRLWinPriv->dwWidthBytes = dibsection.dsBm.bmWidthBytes;
 	  
-#if CYGDEBUG
+#if CYGMULTIWINDOW_DEBUG
 	  ErrorF ("winWin32RootlessStartDrawing - bytesPerRow: %d\n",
-		  dibsection.dsBm.bmWidthBytes);
+		  (unsigned int)dibsection.dsBm.bmWidthBytes);
 #endif
 	  
 	  /* Free the old shadow bitmap */
@@ -690,9 +691,9 @@
     {
       ErrorF ("winWin32RootlessStartDrawing - Already window was destoroyed \n"); 
     }
-#if CYGDEBUG
+#if CYGMULTIWINDOW_DEBUG
   ErrorF ("winWin32RootlessStartDrawing - 0x%08x %d\n",
-	  pRLWinPriv->pfb, dibsection.dsBm.bmWidthBytes);
+	  (unsigned int)pRLWinPriv->pfb, (unsigned int)dibsection.dsBm.bmWidthBytes);
 #endif
   *pixelData = pRLWinPriv->pfb;
   *bytesPerRow = pRLWinPriv->dwWidthBytes;
@@ -876,12 +877,14 @@
 
   for (pEnd = pDstRects + nDstRects; pDstRects < pEnd; pDstRects++)
     {
+#if CYGMULTIWINDOW_DEBUG
       ErrorF ("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,

Index: winwin32rootlesswindow.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwin32rootlesswindow.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- winwin32rootlesswindow.c	5 Dec 2003 03:37:26 -0000	1.1.2.1
+++ winwin32rootlesswindow.c	18 Dec 2003 01:32:03 -0000	1.1.2.2
@@ -136,6 +136,25 @@
 
 
 /*
+ * winWin32RootlessMoveResizeXWindow
+ */
+
+void
+winWin32RootlessMoveResizeXWindow (WindowPtr pWin, int x, int y, int w, int h)
+{
+  XID *vlist = malloc(sizeof(long)*4);
+
+  (CARD32*)vlist[0] = x;
+  (CARD32*)vlist[1] = y;
+  (CARD32*)vlist[2] = w;
+  (CARD32*)vlist[3] = h;
+
+  ConfigureWindow (pWin, CWX | CWY | CWWidth | CWHeight, vlist, wClient(pWin));
+  free(vlist);
+}
+
+
+/*
  * winWin32RootlessUpdateIcon
  * Change the Windows window icon 
  */

Index: winwin32rootlesswndproc.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwin32rootlesswndproc.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- winwin32rootlesswndproc.c	5 Dec 2003 03:37:26 -0000	1.1.2.1
+++ winwin32rootlesswndproc.c	18 Dec 2003 01:32:03 -0000	1.1.2.2
@@ -34,6 +34,8 @@
 #define _WINDOWSWM_SERVER_
 #include "windowswmstr.h"
 #include "dixevents.h"
+#include "propertyst.h"
+#include "Xatom.h"
 #include "winmultiwindowclass.h"
 
 
@@ -42,7 +44,8 @@
  */
 
 #define MOUSE_POLLING_INTERVAL		500
-#define CYGMULTIWINDOW_DEBUG    YES
+
+
 
 /*
  * Global variables
@@ -274,6 +277,163 @@
 
 
 /*
+ * IsRaiseOnClick
+ */
+
+static Bool
+IsRaiseOnClick (WindowPtr pWin)
+{
+
+  struct _Window	*pwin;
+  struct _Property	*prop;  
+  static Atom		atmWindowsWmRaiseOnClick = 0;
+  WindowPtr		pRoot = GetCurrentRootWindow ();
+
+  if (!pWin)
+    {
+      ErrorF ("IsRaiseOnClick - pWin was NULL\n");
+      return 0;
+    } 
+
+  if (!atmWindowsWmRaiseOnClick)
+    atmWindowsWmRaiseOnClick = MakeAtom (WINDOWSWM_RAISE_ON_CLICK,
+					 strlen(WINDOWSWM_RAISE_ON_CLICK),
+					 1);
+  
+  pwin = (struct _Window*) pWin;
+
+  if (pwin->optional)
+    prop = (struct _Property *) pwin->optional->userProps;
+  else
+    prop = NULL;
+
+  while (prop)
+    {
+      if (prop->propertyName == atmWindowsWmRaiseOnClick
+	  && prop->type == XA_INTEGER
+	  && prop->format == 32)
+	{
+	  return *(int*)prop->data;
+	}
+      else
+	prop = prop->next;
+    }
+
+  if (pWin != pRoot)
+    {
+      IsRaiseOnClick (pRoot);
+    }
+  else
+    {
+      return 0;
+    }
+}
+
+
+/*
+ * IsMouseActive
+ */
+
+static Bool
+IsMouseActive (WindowPtr pWin)
+{
+
+  struct _Window	*pwin;
+  struct _Property	*prop;
+  static Atom		atmWindowsWMMouseActivate = 0;
+  WindowPtr		pRoot = GetCurrentRootWindow ();
+
+  if (!pWin)
+    {
+      ErrorF ("IsMouseActive - pWin was NULL\n");
+      return 0;
+    } 
+
+  if (!atmWindowsWMMouseActivate)
+    atmWindowsWMMouseActivate = MakeAtom (WINDOWSWM_MOUSE_ACTIVATE,
+					 strlen(WINDOWSWM_MOUSE_ACTIVATE),
+					 1);
+  
+  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)
+    {
+      IsMouseActive (pRoot);
+    }
+  else
+    {
+      return 0;
+    }
+  
+  return 0;
+}
+
+
+/*
+ * WWMPropClientWindow
+ */
+
+static WindowPtr
+WWMPropClientWindow (WindowPtr pWin)
+{
+
+  struct _Window	*pwin;
+  struct _Property	*prop;  
+  static Atom		atmWindowsWMClientWindow = 0;
+
+  if (!pWin)
+    {
+      ErrorF ("WWMPropClientWindow - pWin was NULL\n");
+      return 0;
+    } 
+
+  if (!atmWindowsWMClientWindow)
+    atmWindowsWMClientWindow = MakeAtom (WINDOWSWM_CLIENT_WINDOW,
+					 strlen(WINDOWSWM_CLIENT_WINDOW),
+					 1);
+  
+  pwin = (struct _Window*) pWin;
+
+  if (pwin->optional)
+    prop = (struct _Property *) pwin->optional->userProps;
+  else
+    prop = NULL;
+
+  while (prop)
+    {
+      if (prop->propertyName == atmWindowsWMClientWindow
+	  && prop->type == XA_INTEGER
+	  && prop->format == 32)
+	{
+	  pWin = LookupIDByType (*(int*)prop->data, RT_WINDOW);
+	  return pWin;
+	}
+      else
+	prop = prop->next;
+    }
+  
+  return 0;
+}
+
+
+/*
  * winWin32RootlessWindowProc - Window procedure
  */
 
@@ -291,6 +451,9 @@
   static Bool		s_fTracking = FALSE;
   HDC			hdcUpdate;
   PAINTSTRUCT		ps;
+  LPWINDOWPOS		pWinPos = NULL;
+  RECT			rcClient;
+  WindowPtr		pClientWin = NULL;
   
   /* Check if the Windows window property for our X window pointer is valid */
   if ((pRLWinPriv = (win32RootlessWindowPtr)GetProp (hwnd, WIN_WINDOW_PROP)) != NULL)
@@ -300,14 +463,14 @@
       if (pScreen) pScreenPriv		= winGetScreenPriv(pScreen);
       if (pScreenPriv) pScreenInfo	= pScreenPriv->pScreenInfo;
       if (pScreenPriv) hwndScreen	= pScreenPriv->hwndScreen;
-#if 1
+#if 0
       ErrorF ("hWnd %08X\n", hwnd);
       ErrorF ("pScreenPriv %08X\n", pScreenPriv);
       ErrorF ("pScreenInfo %08X\n", pScreenInfo);
       ErrorF ("hwndScreen %08X\n", hwndScreen);
-#endif
       ErrorF ("winWin32RootlessWindowProc (%08x) %08x %08x %08x\n",
 	      pRLWinPriv, message, wParam, lParam);
+#endif
     }
   /* Branch on message type */
   switch (message)
@@ -346,7 +509,7 @@
 #if CYGMULTIWINDOW_DEBUG
       ErrorF ("winWin32RootlessWindowProc - WM_DESTROY\n");
 #endif
-      /* Free the shadow DC; which allows the bitmap to be freed */
+      /* Free the shaodw DC; which allows the bitmap to be freed */
       DeleteDC (pRLWinPriv->hdcShadow);
       pRLWinPriv->hdcShadow = NULL;
       
@@ -552,6 +715,8 @@
 	  return MA_NOACTIVATE;
 	}
 #endif
+      if (!IsMouseActive (pWin)) return MA_NOACTIVATE;
+
       break;
       
     case WM_KILLFOCUS:
@@ -665,47 +830,31 @@
 	}
       return 0;
       
-#if 0
+#if 1
     case WM_WINDOWPOSCHANGING:
       pWinPos = (LPWINDOWPOS)lParam;
-      /* Window manager does restacking */
       if (!(pWinPos->flags & SWP_NOZORDER))
 	{
 	  if (pRLWinPriv->fRestackingNow)
 	    {
-	      ErrorF ("Win %08x is now restacking.\n", pRLWinPriv);
+#if CYGMULTIWINDOW_DEBUG
+	      ErrorF ("Win %08x is now restacking.\n", (unsigned int)pRLWinPriv);
+#endif
 	      return 0;
 	    }
 
-	  //if (pRLWinPriv->fXTop)
-	  if (pScreenPriv->widTop == pRLWinPriv)
+	  if (IsRaiseOnClick (pWin))
 	    {
-#if 0
-	      if ((pWinPos->hwndInsertAfter == HWND_TOP)||
-		  (pWinPos->hwndInsertAfter == HWND_TOPMOST)||
-		  (pWinPos->hwndInsertAfter == HWND_NOTOPMOST))
-		{
-		  ErrorF ("Win %08x is top and become top/topmost/notopmost.\n", pRLWinPriv);
-		  return 0;
-		}
-
-	      for (hInsWnd = GetNextWindow (hwnd, GW_HWNDPREV);
-		   hInsWnd; hInsWnd = GetNextWindow (hInsWnd, GW_HWNDPREV))
-		{
-		  if (hInsWnd == pWinPos->hwndInsertAfter)
-		    {
-		      ErrorF ("Win %08x is top and go above.\n",
-			      pRLWinPriv);
-		      return 0;
-		    }
-		  hInsWnd = GetNextWindow (hInsWnd, GW_HWNDPREV);
-		}
-	      ErrorF ("Win %08x is top but forbid.\n", pRLWinPriv);
+#if CYGMULTIWINDOW_DEBUG
+	      ErrorF ("Win %08x has WINDOWSWM_RAISE_ON_CLICK.\n", (unsigned int)pRLWinPriv);
 #endif
 	      return 0;
 	    }
+
+#if CYGMULTIWINDOW_DEBUG
 	  ErrorF ("Win %08x forbid to change z order (%08x).\n",
-		  pRLWinPriv, pWinPos->hwndInsertAfter);
+		  (unsigned int)pRLWinPriv, (unsigned int)pWinPos->hwndInsertAfter);
+#endif
 	  pWinPos->flags |= SWP_NOZORDER;
 	}
       break;
@@ -713,7 +862,8 @@
 
     case WM_MOVE:
 #if CYGMULTIWINDOW_DEBUG
-      ErrorF ("winWin32RootlessWindowProc - WM_MOVE - %d ms\n", GetTickCount ());
+      ErrorF ("winWin32RootlessWindowProc - WM_MOVE - %d ms\n",
+	      (unsigned int)GetTickCount ());
 #endif
       if (g_fNoConfigureWindow) break;
 #if 0
@@ -750,17 +900,25 @@
 			    (HIWORD(lParam) - wBorderWidth (pWin) - GetSystemMetrics (SM_YVIRTUALSCREEN)),
 			    0, 0);
 #else
-      winWin32RootlessMoveXWindow (pWin,
-		      (LOWORD(lParam) - wBorderWidth (pWin)
-		       - GetSystemMetrics (SM_XVIRTUALSCREEN)),
-		      (HIWORD(lParam) - wBorderWidth (pWin)
-		       - GetSystemMetrics (SM_YVIRTUALSCREEN)));
+      if (!pRLWinPriv->fMovingOrSizing)
+	{
+	  WindowPtr pClientWin = WWMPropClientWindow (pWin);
+	  
+	  if (pClientWin == NULL) pClientWin = pWin;
+	  
+	  winWin32RootlessMoveXWindow (pClientWin,
+				       (LOWORD(lParam) - wBorderWidth (pWin)
+					- GetSystemMetrics (SM_XVIRTUALSCREEN)),
+				       (HIWORD(lParam) - wBorderWidth (pWin)
+					- GetSystemMetrics (SM_YVIRTUALSCREEN)));
+	}
 #endif
       return 0;
 
     case WM_SHOWWINDOW:
 #if CYGMULTIWINDOW_DEBUG
-      ErrorF ("winWin32RootlessWindowProc - WM_SHOWWINDOW - %d ms\n", GetTickCount ());
+      ErrorF ("winWin32RootlessWindowProc - WM_SHOWWINDOW - %d ms\n",
+	      (unsigned int)GetTickCount ());
 #endif
       /* Bail out if the window is being hidden */
       if (!wParam)
@@ -800,7 +958,8 @@
       /* see dix/window.c */
       /* FIXME: Maximize/Restore? */
 #if CYGMULTIWINDOW_DEBUG
-      ErrorF ("winWin32RootlessWindowProc - WM_SIZE - %d ms\n", GetTickCount ());
+      ErrorF ("winWin32RootlessWindowProc - WM_SIZE - %d ms\n",
+	      (unsigned int)GetTickCount ());
 #endif
 #if CYGMULTIWINDOW_DEBUG
       ErrorF ("\t(%d, %d) %d\n", (short) LOWORD(lParam), (short) HIWORD(lParam), g_fNoConfigureWindow);
@@ -863,9 +1022,16 @@
 			    0, 0,
 			    LOWORD(lParam), HIWORD(lParam));
 #else
-      winWin32RootlessResizeXWindow (pWin,
-			(short) LOWORD(lParam),
-			(short) HIWORD(lParam));
+      if (!pRLWinPriv->fMovingOrSizing)
+	{
+	  WindowPtr pClientWin = WWMPropClientWindow (pWin);
+	  
+	  if (pClientWin == NULL) pClientWin = pWin;
+	  
+	  winWin32RootlessResizeXWindow (pClientWin,
+					 (short) LOWORD(lParam),
+					 (short) HIWORD(lParam));
+	}
 #endif
       break;
 
@@ -900,6 +1066,30 @@
 	}
       break;
 
+    case WM_ENTERSIZEMOVE:
+      pRLWinPriv->fMovingOrSizing = TRUE;
+      break;
+
+    case WM_EXITSIZEMOVE:
+      pRLWinPriv->fMovingOrSizing = FALSE;
+
+      GetClientRect (hwnd, &rcClient);
+      
+      pClientWin = WWMPropClientWindow (pWin);
+      if (pClientWin == NULL) pClientWin = pWin;
+
+      MapWindowPoints (hwnd, HWND_DESKTOP, (LPPOINT)&rcClient, 2);
+      winWin32RootlessMoveResizeXWindow (pClientWin,
+					 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;
     }





More information about the xorg-commit mailing list