diff --git a/reactos/subsys/win32k/include/vis.h b/reactos/subsys/win32k/include/vis.h index 6113afca0bd..801e1ecb527 100644 --- a/reactos/subsys/win32k/include/vis.h +++ b/reactos/subsys/win32k/include/vis.h @@ -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 * PROJECT: ReactOS Win32k subsystem @@ -22,6 +22,8 @@ VIS_ComputeVisibleRegion(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window, VOID FASTCALL VIS_WindowLayoutChanged(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window, HRGN UncoveredRgn); +VOID FASTCALL +VIS_RepaintDesktop(HWND Desktop, HRGN RepaintRgn); #endif /* ! defined(_WIN32K_VIS_H) */ diff --git a/reactos/subsys/win32k/ntuser/painting.c b/reactos/subsys/win32k/ntuser/painting.c index dbf7a9a60ae..ca7b50c330f 100644 --- a/reactos/subsys/win32k/ntuser/painting.c +++ b/reactos/subsys/win32k/ntuser/painting.c @@ -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.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 * PROJECT: ReactOS kernel @@ -42,7 +42,7 @@ #include #include #include - +#include #define NDEBUG #include @@ -75,7 +75,14 @@ PaintDoPaint(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags, ULONG ExFlags) { if (NULL != Window->UpdateRegion) { - NtUserSendMessage(hWnd, bIcon ? WM_PAINTICON : WM_PAINT, bIcon, 0); + if (W32kIsDesktopWindow(Window)) + { + VIS_RepaintDesktop(Window->Self, Window->UpdateRegion); + } + else + { + NtUserSendMessage(hWnd, bIcon ? WM_PAINTICON : WM_PAINT, bIcon, 0); + } } } else if (Flags & RDW_ERASENOW || ExFlags & RDW_EX_TOPFRAME) @@ -121,10 +128,19 @@ PaintDoPaint(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags, ULONG ExFlags) } if (NULL != (hDC = NtUserGetDCEx(hWnd, hRgnRet, Dcx))) { - if (0 != NtUserSendMessage(hWnd, bIcon ? WM_ICONERASEBKGND : - WM_ERASEBKGND, (WPARAM)hDC, 0)) + if (W32kIsDesktopWindow(Window)) { - Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBACKGRD; + VIS_RepaintDesktop(Window->Self, Window->UpdateRegion); + W32kDeleteObject(Window->UpdateRegion); + Window->UpdateRegion = 0; + } + else + { + if (0 != NtUserSendMessage(hWnd, bIcon ? WM_ICONERASEBKGND : + WM_ERASEBKGND, (WPARAM)hDC, 0)) + { + Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBACKGRD; + } } 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() */ } - if (! HadOne && 0 == (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)) + if (! HadOne && 0 == (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT) && + !W32kIsDesktopWindow(Window)) { MsqIncPaintCountQueue(Window->MessageQueue); } diff --git a/reactos/subsys/win32k/ntuser/vis.c b/reactos/subsys/win32k/ntuser/vis.c index 9641dfafcbc..b344362e057 100644 --- a/reactos/subsys/win32k/ntuser/vis.c +++ b/reactos/subsys/win32k/ntuser/vis.c @@ -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.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 * 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 */ -VOID STATIC FASTCALL +VOID FASTCALL VIS_RepaintDesktop(HWND Desktop, HRGN RepaintRgn) { HDC dc = NtUserGetDC(Desktop); diff --git a/reactos/subsys/win32k/ntuser/winpos.c b/reactos/subsys/win32k/ntuser/winpos.c index 59d696db844..72c8e679de7 100644 --- a/reactos/subsys/win32k/ntuser/winpos.c +++ b/reactos/subsys/win32k/ntuser/winpos.c @@ -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: 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 * 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 */ newVisRgn = DceGetVisRgn( Wnd->Self, DCX_WINDOW | DCX_CLIPSIBLINGS, 0, 0); + W32kOffsetRgn(newVisRgn, -Wnd->WindowRect.left, -Wnd->WindowRect.top); dirtyRgn = W32kCreateRectRgn( 0, 0, 0, 0 ); 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); } + W32kOffsetRgn(VisRgn, -Window->WindowRect.left, -Window->WindowRect.top); } WvrFlags = WinPosDoNCCALCSize(Window, &WinPos, &NewWindowRect, @@ -880,7 +882,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx, } else { - PaintRedrawWindow(Window->Self, NULL, + PaintRedrawWindow(Window->Parent->Self, NULL, (VisRgn == (HRGN) 1) ? 0 : VisRgn, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_ERASENOW, @@ -888,7 +890,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx, } /* FIXME: Redraw the window parent. */ } - /* FIXME: Delete VisRgn */ + W32kDeleteObject(VisRgn); } if (!(flags & SWP_NOACTIVATE))