[ros-diffs] [jmorlan] 34923: NtUserBeginPaint: Taking the bounding box of the update region first and clipping it to the client area afterwards was making rcPaint contain the entire client area when scrolling. It should be done the other way around: clip to the client area first, then box. Since there is already a clipped update region in the DC, this is easy; just use GdiGetClipBox.

jmorlan at svn.reactos.org jmorlan at svn.reactos.org
Tue Jul 29 04:08:57 CEST 2008


Author: jmorlan
Date: Mon Jul 28 21:08:56 2008
New Revision: 34923

URL: http://svn.reactos.org/svn/reactos?rev=34923&view=rev
Log:
NtUserBeginPaint: Taking the bounding box of the update region first and clipping it to the client area afterwards was making rcPaint contain the entire client area when scrolling. It should be done the other way around: clip to the client area first, then box. Since there is already a clipped update region in the DC, this is easy; just use GdiGetClipBox.

Modified:
    trunk/reactos/subsystems/win32/win32k/ntuser/painting.c

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/painting.c?rev=34923&r1=34922&r2=34923&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1] Mon Jul 28 21:08:56 2008
@@ -770,7 +770,6 @@
 {
    PWINDOW_OBJECT Window = NULL;
    PAINTSTRUCT Ps;
-   PROSRGNDATA Rgn;
    NTSTATUS Status;
    DECLARE_RETURN(HDC);
    USER_REFERENCE_ENTRY Ref;
@@ -816,23 +815,7 @@
    if (Window->UpdateRegion != NULL)
    {
       MsqDecPaintCountQueue(Window->MessageQueue);
-      Rgn = REGION_LockRgn(Window->UpdateRegion);
-      if (NULL != Rgn)
-      {
-         REGION_GetRgnBox(Rgn, &Ps.rcPaint);
-         REGION_UnlockRgn(Rgn);
-         IntGdiIntersectRect(&Ps.rcPaint, &Ps.rcPaint, &Window->Wnd->ClientRect);
-         if (! IntGdiIsEmptyRect(&Ps.rcPaint))
-         {
-            IntGdiOffsetRect(&Ps.rcPaint,
-                             -Window->Wnd->ClientRect.left,
-                             -Window->Wnd->ClientRect.top);
-         }
-      }
-      else
-      {
-         IntGetClientRect(Window, &Ps.rcPaint);
-      }
+      GdiGetClipBox(Ps.hdc, &Ps.rcPaint);
       GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess());
       /* The region is part of the dc now and belongs to the process! */
       Window->UpdateRegion = NULL;



More information about the Ros-diffs mailing list