Index: win32ss/user/ntuser/winpos.c
===================================================================
--- win32ss/user/ntuser/winpos.c	(revision 67478)
+++ win32ss/user/ntuser/winpos.c	(working copy)
@@ -1810,6 +1810,27 @@
       }
    }
 
+   
+    if (Window->hrgnNewFrame)
+    {
+        if (Window->hrgnClip)
+        {
+            /* Delete no longer needed region handle   */
+            IntGdiSetRegionOwner(Window->hrgnClip, GDI_OBJ_HMGR_POWNED);
+            GreDeleteObject(Window->hrgnClip);
+            Window->hrgnClip = NULL;
+        }
+
+        if (((INT) Window->hrgnNewFrame) != 1)
+        {
+            /* Set public ownership */
+            IntGdiSetRegionOwner(Window->hrgnNewFrame, GDI_OBJ_HMGR_PUBLIC);
+            Window->hrgnClip = Window->hrgnNewFrame;
+        }
+        Window->hrgnNewFrame = NULL;
+    }
+   
+   
    WvrFlags = co_WinPosDoNCCALCSize(Window, &WinPos, &NewWindowRect, &NewClientRect, valid_rects);
 
 //   ERR("co_WinPosDoNCCALCSize returned 0x%x\n valid dest: %d %d %d %d\n valid src : %d %d %d %d\n", WvrFlags,
@@ -2049,6 +2070,7 @@
       if (VisBefore != NULL)
       {
          PREGION ExposedRgn = IntSysCreateRectpRgn(0, 0, 0, 0);
+         //PREGION FullClip = IntSysCreateRectpRgn(0,0,NewWindowRect.right-NewWindowRect.left,NewWindowRect.bottom-NewWindowRect.top);
          if (ExposedRgn)
          {
              RgnType = IntGdiCombineRgn(ExposedRgn, VisBefore, NULL, RGN_COPY);
@@ -3221,7 +3243,7 @@
    INT flags = (SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE);
    BOOLEAN Ret = FALSE;
    DECLARE_RETURN(INT);
-
+   
    TRACE("Enter NtUserSetWindowRgn\n");
    UserEnterExclusive();
 
@@ -3244,10 +3266,10 @@
       else
          RETURN( 0);
    }
-
+   /*
    if (Window->hrgnClip)
    {
-      /* Delete no longer needed region handle */
+        Delete no longer needed region handle  
       IntGdiSetRegionOwner(Window->hrgnClip, GDI_OBJ_HMGR_POWNED);
       GreDeleteObject(Window->hrgnClip);
    }
@@ -3254,11 +3276,20 @@
 
    if (hrgnCopy)
    {
-      /* Set public ownership */
+       Set public ownership 
       IntGdiSetRegionOwner(hrgnCopy, GDI_OBJ_HMGR_PUBLIC);
    }
    Window->hrgnClip = hrgnCopy;
-
+   
+   */
+   if (hrgnCopy)
+   {
+       Window->hrgnNewFrame = hrgnCopy;
+   }
+   else
+   {
+       Window->hrgnNewFrame = (HRGN) 1;
+   }
    Ret = co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, bRedraw ? flags : (flags|SWP_NOREDRAW) );
 
    RETURN( (INT)Ret);
