Author: tkreuzer
Date: Sun Jul 15 07:30:03 2007
New Revision: 27672
URL:
http://svn.reactos.org/svn/reactos?rev=27672&view=rev
Log:
- fix IntValidateParent
- validate Parent windows on moving pixels
(both was fine earlier, but has been messed up recently)
- move sending of WM_SIZE and WM_MOVE from co_WinPosShowWindow to co_WinPosSetWindowPos
co_WinPosSetWindowPos:
- instantly erase when drawing windows or exposing region
- Invalidate child windows on BeginPaint
This should fix most window redrawing bugs and also (hopefully) speed up the gui (less
redrawing).
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/painting.c
trunk/reactos/subsystems/win32/win32k/ntuser/vis.c
trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/painting.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/painting.c Sun Jul 15 07:30:03 2007
@@ -82,12 +82,9 @@
}
BOOL FASTCALL
-IntValidateParent(PWINDOW_OBJECT Child, BOOL Recurse)
+IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse)
{
PWINDOW_OBJECT ParentWindow = Child->Parent;
-
- while (ParentWindow && ParentWindow->Style & WS_CHILD)
- ParentWindow = ParentWindow->Parent;
while (ParentWindow)
{
@@ -99,7 +96,7 @@
if (Recurse)
return FALSE;
- IntInvalidateWindows(ParentWindow, Child->UpdateRegion,
+ IntInvalidateWindows(ParentWindow, hValidateRgn,
RDW_VALIDATE | RDW_NOCHILDREN);
}
@@ -243,7 +240,7 @@
{
if (Window->UpdateRegion)
{
- if (!IntValidateParent(Window, Recurse))
+ if (!IntValidateParent(Window, Window->UpdateRegion, Recurse))
return;
}
@@ -813,6 +810,7 @@
IntGetClientRect(Window, &Ps.rcPaint);
}
GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion,
PsGetCurrentProcess());
+ /* The region is part of the dc now and belongs to the process! */
Window->UpdateRegion = NULL;
}
else
@@ -833,6 +831,17 @@
else
{
Ps.fErase = FALSE;
+ }
+ if (Window->UpdateRegion)
+ {
+ if (!(Window->Style & WS_CLIPCHILDREN))
+ {
+ PWINDOW_OBJECT Child;
+ for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
+ {
+ IntInvalidateWindows(Child, Window->UpdateRegion, RDW_FRAME | RDW_ERASE |
RDW_INVALIDATE | RDW_ALLCHILDREN);
+ }
+ }
}
Status = MmCopyToCaller(UnsafePs, &Ps, sizeof(PAINTSTRUCT));
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/vis.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/vis.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/vis.c Sun Jul 15 07:30:03 2007
@@ -167,7 +167,7 @@
UserRefObjectCo(Parent, &Ref);
co_UserRedrawWindow(Parent, NULL, Temp,
- RDW_FRAME | RDW_ERASE | RDW_INVALIDATE |
+ RDW_FRAME | RDW_ERASE | RDW_ERASENOW | RDW_INVALIDATE |
RDW_ALLCHILDREN);
UserDerefObjectCo(Parent);
}
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c Sun Jul 15 07:30:03 2007
@@ -969,7 +969,7 @@
}
WvrFlags = co_WinPosDoNCCALCSize(Window, &WinPos, &NewWindowRect,
&NewClientRect);
-
+
//DPRINT1("co_WinPosDoNCCALCSize");
/* Relink windows. (also take into account shell window in hwndShellWindow) */
@@ -1197,6 +1197,7 @@
CopyRect.left + (OldWindowRect.left - NewWindowRect.left),
CopyRect.top + (OldWindowRect.top - NewWindowRect.top), SRCCOPY,
0, 0);
UserReleaseDC(Window, Dc, FALSE);
+ IntValidateParent(Window, CopyRgn, FALSE);
NtGdiOffsetRgn(CopyRgn, -NewWindowRect.left, -NewWindowRect.top);
}
else if(VisRgn)
@@ -1223,14 +1224,6 @@
}
if (RgnType != ERROR && RgnType != NULLREGION)
{
- /* old code
- NtGdiOffsetRgn(DirtyRgn, Window->WindowRect.left,
Window->WindowRect.top);
- IntInvalidateWindows(Window, DirtyRgn,
- RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
- }
- NtGdiDeleteObject(DirtyRgn);
- */
-
PWINDOW_OBJECT Parent = Window->Parent;
NtGdiOffsetRgn(DirtyRgn,
@@ -1241,13 +1234,16 @@
!(Parent->Style & WS_CLIPCHILDREN))
{
IntInvalidateWindows(Parent, DirtyRgn,
- RDW_ERASE | RDW_INVALIDATE);
- co_IntPaintWindows(Parent, RDW_ERASENOW, FALSE);
+ RDW_ERASE | RDW_INVALIDATE | RDW_NOCHILDREN);
+ co_IntPaintWindows(Parent, RDW_ERASENOW | RDW_NOCHILDREN, FALSE);
+ IntInvalidateWindows(Window, DirtyRgn,
+ RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
}
else
{
- IntInvalidateWindows(Window, DirtyRgn,
- RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
+ IntInvalidateWindows(Window, DirtyRgn,
+ RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
+ co_IntPaintWindows(Window, RDW_ERASENOW, FALSE);
}
}
NtGdiDeleteObject(DirtyRgn);
@@ -1298,6 +1294,33 @@
if ((WinPos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE)
co_IntPostOrSendMessage(WinPos.hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM)
&WinPos);
+
+ if ((Window->Flags & WINDOWOBJECT_NEED_SIZE) &&
+ !(Window->Status & WINDOWSTATUS_DESTROYING))
+ {
+ WPARAM wParam = SIZE_RESTORED;
+
+ Window->Flags &= ~WINDOWOBJECT_NEED_SIZE;
+ if (Window->Style & WS_MAXIMIZE)
+ {
+ wParam = SIZE_MAXIMIZED;
+ }
+ else if (Window->Style & WS_MINIMIZE)
+ {
+ wParam = SIZE_MINIMIZED;
+ }
+
+ co_IntSendMessage(Window->hSelf, WM_SIZE, wParam,
+ MAKELONG(Window->ClientRect.right -
+ Window->ClientRect.left,
+ Window->ClientRect.bottom -
+ Window->ClientRect.top));
+ co_IntSendMessage(Window->hSelf, WM_MOVE, 0,
+ MAKELONG(Window->ClientRect.left,
+ Window->ClientRect.top));
+ IntEngWindowChanged(Window, WOC_RGN_CLIENT);
+
+ }
return TRUE;
}
@@ -1467,33 +1490,6 @@
/* FIXME: Check for window destruction. */
- if ((Window->Flags & WINDOWOBJECT_NEED_SIZE) &&
- !(Window->Status & WINDOWSTATUS_DESTROYING))
- {
- WPARAM wParam = SIZE_RESTORED;
-
- Window->Flags &= ~WINDOWOBJECT_NEED_SIZE;
- if (Window->Style & WS_MAXIMIZE)
- {
- wParam = SIZE_MAXIMIZED;
- }
- else if (Window->Style & WS_MINIMIZE)
- {
- wParam = SIZE_MINIMIZED;
- }
-
- co_IntSendMessage(Window->hSelf, WM_SIZE, wParam,
- MAKELONG(Window->ClientRect.right -
- Window->ClientRect.left,
- Window->ClientRect.bottom -
- Window->ClientRect.top));
- co_IntSendMessage(Window->hSelf, WM_MOVE, 0,
- MAKELONG(Window->ClientRect.left,
- Window->ClientRect.top));
- IntEngWindowChanged(Window, WOC_RGN_CLIENT);
-
- }
-
/* Activate the window if activation is not requested and the window is not minimized
*/
/*
if (!(Swp & (SWP_NOACTIVATE | SWP_HIDEWINDOW)) && !(Window->Style
& WS_MINIMIZE))