mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 16:25:43 +00:00
- 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). svn path=/trunk/; revision=27672
This commit is contained in:
parent
99e20bb44c
commit
5a95124349
3 changed files with 52 additions and 47 deletions
|
@ -82,13 +82,10 @@ IntIntersectWithParents(PWINDOW_OBJECT Child, PRECT WindowRect)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntValidateParent(PWINDOW_OBJECT Child, BOOL Recurse)
|
IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse)
|
||||||
{
|
{
|
||||||
PWINDOW_OBJECT ParentWindow = Child->Parent;
|
PWINDOW_OBJECT ParentWindow = Child->Parent;
|
||||||
|
|
||||||
while (ParentWindow && ParentWindow->Style & WS_CHILD)
|
|
||||||
ParentWindow = ParentWindow->Parent;
|
|
||||||
|
|
||||||
while (ParentWindow)
|
while (ParentWindow)
|
||||||
{
|
{
|
||||||
if (ParentWindow->Style & WS_CLIPCHILDREN)
|
if (ParentWindow->Style & WS_CLIPCHILDREN)
|
||||||
|
@ -99,7 +96,7 @@ IntValidateParent(PWINDOW_OBJECT Child, BOOL Recurse)
|
||||||
if (Recurse)
|
if (Recurse)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
IntInvalidateWindows(ParentWindow, Child->UpdateRegion,
|
IntInvalidateWindows(ParentWindow, hValidateRgn,
|
||||||
RDW_VALIDATE | RDW_NOCHILDREN);
|
RDW_VALIDATE | RDW_NOCHILDREN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +240,7 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
|
||||||
{
|
{
|
||||||
if (Window->UpdateRegion)
|
if (Window->UpdateRegion)
|
||||||
{
|
{
|
||||||
if (!IntValidateParent(Window, Recurse))
|
if (!IntValidateParent(Window, Window->UpdateRegion, Recurse))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -813,6 +810,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
|
||||||
IntGetClientRect(Window, &Ps.rcPaint);
|
IntGetClientRect(Window, &Ps.rcPaint);
|
||||||
}
|
}
|
||||||
GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, PsGetCurrentProcess());
|
GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, PsGetCurrentProcess());
|
||||||
|
/* The region is part of the dc now and belongs to the process! */
|
||||||
Window->UpdateRegion = NULL;
|
Window->UpdateRegion = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -834,6 +832,17 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
|
||||||
{
|
{
|
||||||
Ps.fErase = FALSE;
|
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));
|
Status = MmCopyToCaller(UnsafePs, &Ps, sizeof(PAINTSTRUCT));
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
|
|
@ -167,7 +167,7 @@ co_VIS_WindowLayoutChanged(
|
||||||
|
|
||||||
UserRefObjectCo(Parent, &Ref);
|
UserRefObjectCo(Parent, &Ref);
|
||||||
co_UserRedrawWindow(Parent, NULL, Temp,
|
co_UserRedrawWindow(Parent, NULL, Temp,
|
||||||
RDW_FRAME | RDW_ERASE | RDW_INVALIDATE |
|
RDW_FRAME | RDW_ERASE | RDW_ERASENOW | RDW_INVALIDATE |
|
||||||
RDW_ALLCHILDREN);
|
RDW_ALLCHILDREN);
|
||||||
UserDerefObjectCo(Parent);
|
UserDerefObjectCo(Parent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1197,6 +1197,7 @@ co_WinPosSetWindowPos(
|
||||||
CopyRect.left + (OldWindowRect.left - NewWindowRect.left),
|
CopyRect.left + (OldWindowRect.left - NewWindowRect.left),
|
||||||
CopyRect.top + (OldWindowRect.top - NewWindowRect.top), SRCCOPY, 0, 0);
|
CopyRect.top + (OldWindowRect.top - NewWindowRect.top), SRCCOPY, 0, 0);
|
||||||
UserReleaseDC(Window, Dc, FALSE);
|
UserReleaseDC(Window, Dc, FALSE);
|
||||||
|
IntValidateParent(Window, CopyRgn, FALSE);
|
||||||
NtGdiOffsetRgn(CopyRgn, -NewWindowRect.left, -NewWindowRect.top);
|
NtGdiOffsetRgn(CopyRgn, -NewWindowRect.left, -NewWindowRect.top);
|
||||||
}
|
}
|
||||||
else if(VisRgn)
|
else if(VisRgn)
|
||||||
|
@ -1223,14 +1224,6 @@ co_WinPosSetWindowPos(
|
||||||
}
|
}
|
||||||
if (RgnType != ERROR && RgnType != NULLREGION)
|
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;
|
PWINDOW_OBJECT Parent = Window->Parent;
|
||||||
|
|
||||||
NtGdiOffsetRgn(DirtyRgn,
|
NtGdiOffsetRgn(DirtyRgn,
|
||||||
|
@ -1241,13 +1234,16 @@ co_WinPosSetWindowPos(
|
||||||
!(Parent->Style & WS_CLIPCHILDREN))
|
!(Parent->Style & WS_CLIPCHILDREN))
|
||||||
{
|
{
|
||||||
IntInvalidateWindows(Parent, DirtyRgn,
|
IntInvalidateWindows(Parent, DirtyRgn,
|
||||||
RDW_ERASE | RDW_INVALIDATE);
|
RDW_ERASE | RDW_INVALIDATE | RDW_NOCHILDREN);
|
||||||
co_IntPaintWindows(Parent, RDW_ERASENOW, FALSE);
|
co_IntPaintWindows(Parent, RDW_ERASENOW | RDW_NOCHILDREN, FALSE);
|
||||||
|
IntInvalidateWindows(Window, DirtyRgn,
|
||||||
|
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IntInvalidateWindows(Window, DirtyRgn,
|
IntInvalidateWindows(Window, DirtyRgn,
|
||||||
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
||||||
|
co_IntPaintWindows(Window, RDW_ERASENOW, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NtGdiDeleteObject(DirtyRgn);
|
NtGdiDeleteObject(DirtyRgn);
|
||||||
|
@ -1299,6 +1295,33 @@ co_WinPosSetWindowPos(
|
||||||
if ((WinPos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE)
|
if ((WinPos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE)
|
||||||
co_IntPostOrSendMessage(WinPos.hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM) &WinPos);
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1467,33 +1490,6 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
|
||||||
|
|
||||||
/* FIXME: Check for window destruction. */
|
/* 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 */
|
/* Activate the window if activation is not requested and the window is not minimized */
|
||||||
/*
|
/*
|
||||||
if (!(Swp & (SWP_NOACTIVATE | SWP_HIDEWINDOW)) && !(Window->Style & WS_MINIMIZE))
|
if (!(Swp & (SWP_NOACTIVATE | SWP_HIDEWINDOW)) && !(Window->Style & WS_MINIMIZE))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue