- Repaint the parent window in the non-paintself case.

- Updates since DceGetVisRgn returns a region which is in screen(?) coordinates.- Hacks to allow repainting of the desktop.

svn path=/trunk/; revision=5390
This commit is contained in:
David Welch 2003-08-02 19:56:19 +00:00
parent 6cb3436154
commit 786dbef8e2
4 changed files with 34 additions and 13 deletions

View file

@ -1,4 +1,4 @@
/* $Id: vis.h,v 1.1 2003/07/17 07:49:15 gvg Exp $ /* $Id: vis.h,v 1.2 2003/08/02 19:56:19 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Win32k subsystem * PROJECT: ReactOS Win32k subsystem
@ -22,6 +22,8 @@ VIS_ComputeVisibleRegion(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
VOID FASTCALL VOID FASTCALL
VIS_WindowLayoutChanged(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window, VIS_WindowLayoutChanged(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
HRGN UncoveredRgn); HRGN UncoveredRgn);
VOID FASTCALL
VIS_RepaintDesktop(HWND Desktop, HRGN RepaintRgn);
#endif /* ! defined(_WIN32K_VIS_H) */ #endif /* ! defined(_WIN32K_VIS_H) */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: painting.c,v 1.20 2003/08/01 14:38:51 dwelch Exp $ /* $Id: painting.c,v 1.21 2003/08/02 19:56:19 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -42,7 +42,7 @@
#include <include/rect.h> #include <include/rect.h>
#include <win32k/coord.h> #include <win32k/coord.h>
#include <win32k/region.h> #include <win32k/region.h>
#include <include/vis.h>
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
@ -74,10 +74,17 @@ PaintDoPaint(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags, ULONG ExFlags)
if (Flags & RDW_UPDATENOW) if (Flags & RDW_UPDATENOW)
{ {
if (NULL != Window->UpdateRegion) if (NULL != Window->UpdateRegion)
{
if (W32kIsDesktopWindow(Window))
{
VIS_RepaintDesktop(Window->Self, Window->UpdateRegion);
}
else
{ {
NtUserSendMessage(hWnd, bIcon ? WM_PAINTICON : WM_PAINT, bIcon, 0); NtUserSendMessage(hWnd, bIcon ? WM_PAINTICON : WM_PAINT, bIcon, 0);
} }
} }
}
else if (Flags & RDW_ERASENOW || ExFlags & RDW_EX_TOPFRAME) else if (Flags & RDW_ERASENOW || ExFlags & RDW_EX_TOPFRAME)
{ {
UINT Dcx = DCX_INTERSECTRGN | DCX_USESTYLE | DCX_KEEPCLIPRGN | UINT Dcx = DCX_INTERSECTRGN | DCX_USESTYLE | DCX_KEEPCLIPRGN |
@ -120,12 +127,21 @@ PaintDoPaint(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags, ULONG ExFlags)
Dcx &= ~DCX_INTERSECTRGN; Dcx &= ~DCX_INTERSECTRGN;
} }
if (NULL != (hDC = NtUserGetDCEx(hWnd, hRgnRet, Dcx))) if (NULL != (hDC = NtUserGetDCEx(hWnd, hRgnRet, Dcx)))
{
if (W32kIsDesktopWindow(Window))
{
VIS_RepaintDesktop(Window->Self, Window->UpdateRegion);
W32kDeleteObject(Window->UpdateRegion);
Window->UpdateRegion = 0;
}
else
{ {
if (0 != NtUserSendMessage(hWnd, bIcon ? WM_ICONERASEBKGND : if (0 != NtUserSendMessage(hWnd, bIcon ? WM_ICONERASEBKGND :
WM_ERASEBKGND, (WPARAM)hDC, 0)) WM_ERASEBKGND, (WPARAM)hDC, 0))
{ {
Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBACKGRD; Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBACKGRD;
} }
}
NtUserReleaseDC(hWnd, hDC); NtUserReleaseDC(hWnd, hDC);
} }
} }
@ -284,7 +300,8 @@ PaintUpdateRgns(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags,
hRgn = Window->UpdateRegion; /* this is a trick that depends on code in PaintRedrawWindow() */ hRgn = Window->UpdateRegion; /* this is a trick that depends on code in PaintRedrawWindow() */
} }
if (! HadOne && 0 == (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)) if (! HadOne && 0 == (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT) &&
!W32kIsDesktopWindow(Window))
{ {
MsqIncPaintCountQueue(Window->MessageQueue); MsqIncPaintCountQueue(Window->MessageQueue);
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: vis.c,v 1.2 2003/07/18 20:55:21 gvg Exp $ * $Id: vis.c,v 1.3 2003/08/02 19:56:19 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -199,7 +199,7 @@ VIS_ComputeVisibleRegion(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
} }
/* FIXME: to be replaced by a normal window proc in CSRSS */ /* FIXME: to be replaced by a normal window proc in CSRSS */
VOID STATIC FASTCALL VOID FASTCALL
VIS_RepaintDesktop(HWND Desktop, HRGN RepaintRgn) VIS_RepaintDesktop(HWND Desktop, HRGN RepaintRgn)
{ {
HDC dc = NtUserGetDC(Desktop); HDC dc = NtUserGetDC(Desktop);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: winpos.c,v 1.19 2003/08/02 16:32:18 gdalsnes Exp $ /* $Id: winpos.c,v 1.20 2003/08/02 19:56:19 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -520,6 +520,7 @@ static UINT WinPosCopyValidBits( PWINDOW_OBJECT Wnd, HRGN* pVisRgn,
uFlags |= SWP_EX_NOCOPY; /* whole window is invalid, nothing to copy */ uFlags |= SWP_EX_NOCOPY; /* whole window is invalid, nothing to copy */
newVisRgn = DceGetVisRgn( Wnd->Self, DCX_WINDOW | DCX_CLIPSIBLINGS, 0, 0); newVisRgn = DceGetVisRgn( Wnd->Self, DCX_WINDOW | DCX_CLIPSIBLINGS, 0, 0);
W32kOffsetRgn(newVisRgn, -Wnd->WindowRect.left, -Wnd->WindowRect.top);
dirtyRgn = W32kCreateRectRgn( 0, 0, 0, 0 ); dirtyRgn = W32kCreateRectRgn( 0, 0, 0, 0 );
if( !(uFlags & SWP_EX_NOCOPY) ) /* make sure dst region covers only valid bits */ if( !(uFlags & SWP_EX_NOCOPY) ) /* make sure dst region covers only valid bits */
@ -797,6 +798,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
{ {
VisRgn = DceGetVisRgn(Wnd, DCX_WINDOW, 0, 0); VisRgn = DceGetVisRgn(Wnd, DCX_WINDOW, 0, 0);
} }
W32kOffsetRgn(VisRgn, -Window->WindowRect.left, -Window->WindowRect.top);
} }
WvrFlags = WinPosDoNCCALCSize(Window, &WinPos, &NewWindowRect, WvrFlags = WinPosDoNCCALCSize(Window, &WinPos, &NewWindowRect,
@ -880,7 +882,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
} }
else else
{ {
PaintRedrawWindow(Window->Self, NULL, PaintRedrawWindow(Window->Parent->Self, NULL,
(VisRgn == (HRGN) 1) ? 0 : VisRgn, (VisRgn == (HRGN) 1) ? 0 : VisRgn,
RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN |
RDW_ERASENOW, RDW_ERASENOW,
@ -888,7 +890,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
} }
/* FIXME: Redraw the window parent. */ /* FIXME: Redraw the window parent. */
} }
/* FIXME: Delete VisRgn */ W32kDeleteObject(VisRgn);
} }
if (!(flags & SWP_NOACTIVATE)) if (!(flags & SWP_NOACTIVATE))