Author: jimtabor
Date: Sat May 10 11:38:52 2014
New Revision: 63215
URL:
http://svn.reactos.org/svn/reactos?rev=63215&view=rev
Log:
[Win32k]
- Patch by Huw Campbell : Fixes maximizing Explorer window, the horizontal scroll bar is
not painted correctly. See CORE-6249.
Modified:
trunk/reactos/win32ss/user/ntuser/winpos.c
Modified: trunk/reactos/win32ss/user/ntuser/winpos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winpos…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] Sat May 10 11:38:52 2014
@@ -1710,6 +1710,7 @@
RECTL valid_rects[2];
PROSRGNDATA VisRgn;
HRGN VisBefore = NULL;
+ HRGN VisBeforeJustClient = NULL;
HRGN VisAfter = NULL;
HRGN DirtyRgn = NULL;
HRGN ExposedRgn = NULL;
@@ -1806,6 +1807,28 @@
RGNOBJAPI_Unlock(VisRgn);
NtGdiOffsetRgn(VisBefore, -Window->rcWindow.left,
-Window->rcWindow.top);
}
+
+ /* Calculate the non client area for resizes, as this is used in the copy region
*/
+ if (!(WinPos.flags & SWP_NOSIZE))
+ {
+ VisBeforeJustClient = VIS_ComputeVisibleRegion(Window, TRUE, FALSE,
+ (Window->style & WS_CLIPSIBLINGS) ? TRUE : FALSE);
+ VisRgn = NULL;
+
+ if ( VisBeforeJustClient != NULL &&
+ (VisRgn = (PROSRGNDATA)RGNOBJAPI_Lock(VisBeforeJustClient, NULL))
&&
+ REGION_Complexity(VisRgn) == NULLREGION )
+ {
+ RGNOBJAPI_Unlock(VisRgn);
+ GreDeleteObject(VisBeforeJustClient);
+ VisBeforeJustClient = NULL;
+ }
+ else if(VisRgn)
+ {
+ RGNOBJAPI_Unlock(VisRgn);
+ NtGdiOffsetRgn(VisBeforeJustClient, -Window->rcWindow.left,
-Window->rcWindow.top);
+ }
+ }
}
}
@@ -1909,8 +1932,6 @@
((WinPos.flags & SWP_NOSIZE) || !(WvrFlags & WVR_REDRAW)) &&
!(Window->ExStyle & WS_EX_TRANSPARENT) )
{
- CopyRgn = IntSysCreateRectRgn(0, 0, 0, 0);
- RgnType = NtGdiCombineRgn(CopyRgn, VisAfter, VisBefore, RGN_AND);
/*
* If this is (also) a window resize, the whole nonclient area
@@ -1920,19 +1941,14 @@
* we don't have to crop (can't take anything away from an empty
* region...)
*/
- if (!(WinPos.flags & SWP_NOSIZE) &&
- RgnType != ERROR &&
- RgnType != NULLREGION )
+
+ CopyRgn = IntSysCreateRectRgn(0, 0, 0, 0);
+ if (WinPos.flags & SWP_NOSIZE)
+ RgnType = NtGdiCombineRgn(CopyRgn, VisAfter, VisBefore, RGN_AND);
+ else if (VisBeforeJustClient != NULL)
{
- PROSRGNDATA pCopyRgn;
- RECTL ORect = OldClientRect;
- RECTL NRect = NewClientRect;
- RECTL_vOffsetRect(&ORect, - OldWindowRect.left, - OldWindowRect.top);
- RECTL_vOffsetRect(&NRect, - NewWindowRect.left, - NewWindowRect.top);
- RECTL_bIntersectRect(&CopyRect, &ORect, &NRect);
- pCopyRgn = RGNOBJAPI_Lock(CopyRgn, NULL);
- REGION_CropAndOffsetRegion(pCopyRgn, pCopyRgn, &CopyRect, NULL);
- RGNOBJAPI_Unlock(pCopyRgn);
+ RgnType = NtGdiCombineRgn(CopyRgn, VisAfter, VisBeforeJustClient, RGN_AND);
+ GreDeleteObject(VisBeforeJustClient);
}
/* No use in copying bits which are in the update region. */