[Win32k]
authorJames Tabor <james.tabor@reactos.org>
Thu, 3 Mar 2011 13:59:17 +0000 (13:59 +0000)
committerJames Tabor <james.tabor@reactos.org>
Thu, 3 Mar 2011 13:59:17 +0000 (13:59 +0000)
- Fix the select of the clip region for a window. Apologies to Rafal Harabien select works like select, also don't
assume the original author is always right.

svn path=/trunk/; revision=50961

reactos/subsystems/win32/win32k/ntuser/window.c

index 981d446..00d454b 100644 (file)
@@ -4052,7 +4052,7 @@ NtUserSetWindowRgn(
    }
    else
    {
-      hrgnCopy = IntSysCreateRectRgnIndirect(&Window->rcWindow); //HRGN_WINDOW;
+      hrgnCopy = NULL;
    }
 
    if (Window->hrgnClip)
@@ -4061,12 +4061,14 @@ NtUserSetWindowRgn(
       GreDeleteObject(Window->hrgnClip);
    }
 
-   if (Window->fnid != FNID_DESKTOP)
-      NtGdiOffsetRgn(hrgnCopy, Window->rcWindow.left, Window->rcWindow.top);
-
-   /* Set public ownership */
-   IntGdiSetRegionOwner(hrgnCopy, GDI_OBJ_HMGR_PUBLIC);
+   if (hrgnCopy)
+   {
+      if (Window->fnid != FNID_DESKTOP)
+         NtGdiOffsetRgn(hrgnCopy, Window->rcWindow.left, Window->rcWindow.top);
 
+      /* Set public ownership */
+      IntGdiSetRegionOwner(hrgnCopy, GDI_OBJ_HMGR_PUBLIC);
+   }
    Window->hrgnClip = hrgnCopy;
 
    Ret = co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, bRedraw ? flags : (flags|SWP_NOREDRAW) );