- Fixed multiwin.exe painting problem.

- Reverted my fix to cursoricon.c.

svn path=/trunk/; revision=6741
This commit is contained in:
Filip Navara 2003-11-21 21:12:09 +00:00
parent 824b2303c4
commit ba0efcb546
4 changed files with 89 additions and 56 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: painting.c,v 1.37 2003/11/21 17:01:16 navaraf Exp $
* $Id: painting.c,v 1.38 2003/11/21 21:12:08 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -169,6 +169,10 @@ IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags)
#ifndef DESKTOP_IN_CSRSS
VIS_RepaintDesktop(hWnd, Window->UpdateRegion);
Window->Flags &= ~(WINDOWOBJECT_NEED_NCPAINT |
WINDOWOBJECT_NEED_INTERNALPAINT | WINDOWOBJECT_NEED_ERASEBKGND);
NtGdiDeleteObject(Window->UpdateRegion);
Window->UpdateRegion = NULL;
#else
if (Window->Flags & WINDOWOBJECT_NEED_NCPAINT)
{
@ -189,8 +193,8 @@ IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags)
{
NtUserSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)hDC, 0);
NtUserReleaseDC(hWnd, hDC);
DeleteObject(WindowObject->UpdateRegion);
WindowObject->UpdateRegion = NULL;
NtGdiDeleteObject(Window->UpdateRegion);
Window->UpdateRegion = NULL;
}
}
#endif
@ -279,11 +283,13 @@ IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags)
*/
VOID FASTCALL
IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags,
BOOL ValidateParent)
{
INT RgnType;
BOOL HadPaintMessage, HadNCPaintMessage;
BOOL HasPaintMessage, HasNCPaintMessage;
HRGN hRgnWindow;
/*
* Clip the given region with window rectangle (or region)
@ -293,7 +299,6 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
if (!Window->WindowRegion)
#endif
{
HRGN hRgnWindow;
hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Window->WindowRect);
NtGdiOffsetRgn(hRgnWindow,
-Window->WindowRect.left,
@ -372,6 +377,68 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
}
/*
* Validate parent covered by region
*/
if (ValidateParent)
{
IntValidateParent(Window);
}
/*
* Process children if needed
*/
if (!(Flags & RDW_NOCHILDREN) && !(Window->Style & WS_MINIMIZE) &&
((Flags & RDW_ALLCHILDREN) || !(Window->Style & WS_CLIPCHILDREN)))
{
HWND *List, *phWnd;
PWINDOW_OBJECT Child;
if ((List = IntWinListChildren(Window)))
{
for (phWnd = List; *phWnd; ++phWnd)
{
Child = IntGetWindowObject(*phWnd);
if ((Child->Style & (WS_VISIBLE | WS_MINIMIZE)) == WS_VISIBLE)
{
/*
* Recursive call to update children UpdateRegion
*/
HRGN hRgnTemp = NtGdiCreateRectRgn(0, 0, 0, 0);
NtGdiCombineRgn(hRgnTemp, hRgn, 0, RGN_COPY);
NtGdiOffsetRgn(hRgnTemp,
Window->WindowRect.left - Child->WindowRect.left,
Window->WindowRect.top - Child->WindowRect.top);
IntInvalidateWindows(Child, hRgnTemp, Flags, FALSE);
/*
* Update our UpdateRegion depending on children
*/
NtGdiCombineRgn(hRgnTemp, Child->UpdateRegion, 0, RGN_COPY);
NtGdiOffsetRgn(hRgnTemp,
Child->WindowRect.left - Window->WindowRect.left,
Child->WindowRect.top - Window->WindowRect.top);
hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Window->ClientRect);
NtGdiOffsetRgn(hRgnWindow,
-Window->WindowRect.left,
-Window->WindowRect.top);
NtGdiCombineRgn(hRgnTemp, hRgnTemp, hRgnWindow, RGN_AND);
if (NtGdiCombineRgn(Window->UpdateRegion, Window->UpdateRegion,
hRgnTemp, RGN_DIFF) == NULLREGION)
{
NtGdiDeleteObject(Window->UpdateRegion);
Window->UpdateRegion = NULL;
}
NtGdiDeleteObject(hRgnTemp);
}
IntReleaseWindowObject(Child);
}
ExFreePool(List);
}
}
/*
* Fake post paint messages to window message queue if needed
*/
@ -402,38 +469,6 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
#ifndef DESKTOP_IN_CSRSS
}
#endif
/*
* Process children if needed
*/
if (!(Flags & RDW_NOCHILDREN) && !(Window->Style & WS_MINIMIZE) &&
((Flags & RDW_ALLCHILDREN) || !(Window->Style & WS_CLIPCHILDREN)))
{
HWND *List, *phWnd;
PWINDOW_OBJECT Child;
if ((List = IntWinListChildren(Window)))
{
for (phWnd = List; *phWnd; ++phWnd)
{
Child = IntGetWindowObject(*phWnd);
if ((Child->Style & (WS_VISIBLE | WS_MINIMIZE)) == WS_VISIBLE)
{
HRGN hRgnTemp = NtGdiCreateRectRgn(0, 0, 0, 0);
Child = IntGetWindowObject(*phWnd);
NtGdiCombineRgn(hRgnTemp, hRgn, 0, RGN_COPY);
NtGdiOffsetRgn(hRgnTemp,
Window->WindowRect.left - Child->WindowRect.left,
Window->WindowRect.top - Child->WindowRect.top);
IntInvalidateWindows(Child, hRgnTemp, Flags);
NtGdiDeleteObject(hRgnTemp);
}
IntReleaseWindowObject(Child);
}
ExFreePool(List);
}
}
}
/*
@ -528,15 +563,11 @@ IntRedrawWindow(PWINDOW_OBJECT Window, const RECT* UpdateRect, HRGN UpdateRgn,
if (Flags & (RDW_INVALIDATE | RDW_VALIDATE | RDW_INTERNALPAINT | RDW_NOINTERNALPAINT))
{
IntInvalidateWindows(Window, hRgn, Flags);
}
/*
* Validate parent covered by region.
*/
if (Window->UpdateRegion != NULL && Flags & (RDW_ERASENOW | RDW_VALIDATE))
IntInvalidateWindows(Window, hRgn, Flags, TRUE);
} else
if (Window->UpdateRegion != NULL && Flags & RDW_ERASENOW)
{
/* Validate parent covered by region. */
IntValidateParent(Window);
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: vis.c,v 1.11 2003/11/21 17:01:16 navaraf Exp $
* $Id: vis.c,v 1.12 2003/11/21 21:12:08 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -215,9 +215,12 @@ VOID FASTCALL
VIS_RepaintDesktop(HWND Desktop, HRGN RepaintRgn)
{
HDC dc = NtUserGetDC(Desktop);
HBRUSH DesktopBrush = NtGdiCreateSolidBrush(RGB(58, 110, 165));
NtGdiFillRgn(dc, RepaintRgn, DesktopBrush);
NtGdiDeleteObject(DesktopBrush);
if (dc)
{
HBRUSH DesktopBrush = NtGdiCreateSolidBrush(RGB(58, 110, 165));
NtGdiFillRgn(dc, RepaintRgn, DesktopBrush);
NtGdiDeleteObject(DesktopBrush);
}
NtUserReleaseDC(Desktop, dc);
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: window.c,v 1.141 2003/11/21 17:01:16 navaraf Exp $
/* $Id: window.c,v 1.142 2003/11/21 21:12:08 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -666,6 +666,8 @@ IntInitDesktopWindow(ULONG Width, ULONG Height)
{
return;
}
DesktopWindow->WindowRect.left = 0;
DesktopWindow->WindowRect.top = 0;
DesktopWindow->WindowRect.right = Width;
DesktopWindow->WindowRect.bottom = Height;
DesktopWindow->ClientRect = DesktopWindow->WindowRect;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: cursoricon.c,v 1.22 2003/11/21 16:36:26 weiden Exp $ */
/* $Id: cursoricon.c,v 1.23 2003/11/21 21:12:09 navaraf Exp $ */
#undef WIN32_LEAN_AND_MEAN
@ -82,7 +82,6 @@ IntSendSetCursorMessage(PWINDOW_OBJECT Window, USHORT Msg, USHORT HitTest)
HCURSOR FASTCALL
IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL ForceChange)
{
HDC hDC;
PDC dc;
PSURFOBJ SurfObj;
PSURFGDI SurfGDI;
@ -106,13 +105,11 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL Fo
goto done;
/* FIXME use the desktop's HDC instead of using ScreenDeviceContext */
hDC = NtUserGetDC(0);
dc = DC_LockDc(hDC);
dc = DC_LockDc(ScreenDeviceContext);
SurfObj = (PSURFOBJ)AccessUserObject((ULONG) dc->Surface);
SurfGDI = (PSURFGDI)AccessInternalObject((ULONG) dc->Surface);
DevInfo = dc->DevInfo;
DC_UnlockDc(hDC);
NtUserReleaseDC(0, hDC);
DC_UnlockDc(ScreenDeviceContext);
if(!NewCursor && (CurInfo->CurrentCursorObject || ForceChange))
{