diff --git a/dlls/user/painting.c b/dlls/user/painting.c index f7b4982797a..273cd5edaca 100644 --- a/dlls/user/painting.c +++ b/dlls/user/painting.c @@ -265,7 +265,7 @@ static BOOL send_erase( HWND hwnd, UINT flags, HRGN client_rgn, } if (!hdc_ret) { - if (need_erase) /* FIXME: mark it as needing erase again */ + if (need_erase && hwnd != GetDesktopWindow()) /* FIXME: mark it as needing erase again */ RedrawWindow( hwnd, NULL, client_rgn, RDW_INVALIDATE | RDW_ERASE | RDW_NOCHILDREN ); ReleaseDC( hwnd, hdc ); } @@ -282,7 +282,7 @@ static BOOL send_erase( HWND hwnd, UINT flags, HRGN client_rgn, * * Implementation of RDW_ERASENOW behavior. */ -void erase_now( HWND hwnd, UINT rdw_flags ) +static void erase_now( HWND hwnd, UINT rdw_flags ) { HWND child; HRGN hrgn; @@ -324,10 +324,13 @@ void erase_now( HWND hwnd, UINT rdw_flags ) * HIWORD(lParam) = hwndSkip (not used; always NULL) * */ -void update_now( HWND hwnd, UINT rdw_flags ) +static void update_now( HWND hwnd, UINT rdw_flags ) { HWND child; + /* desktop window never gets WM_PAINT, only WM_ERASEBKGND */ + if (hwnd == GetDesktopWindow()) erase_now( hwnd, rdw_flags | RDW_NOCHILDREN ); + /* loop while we find a child to repaint */ for (;;) { diff --git a/dlls/x11drv/desktop.c b/dlls/x11drv/desktop.c index c5a91f4aa7a..77cf8f1a9c5 100644 --- a/dlls/x11drv/desktop.c +++ b/dlls/x11drv/desktop.c @@ -44,8 +44,7 @@ static LRESULT WINAPI desktop_winproc( HWND hwnd, UINT message, WPARAM wParam, L case WM_ERASEBKGND: PaintDesktop( (HDC)wParam ); - ValidateRect( hwnd, NULL ); - break; + return TRUE; case WM_SYSCOMMAND: if ((wParam & 0xfff0) == SC_CLOSE) ExitWindows( 0, 0 ); diff --git a/server/window.c b/server/window.c index 7a2b50f3f2e..c7af5e8c0d5 100644 --- a/server/window.c +++ b/server/window.c @@ -1660,7 +1660,12 @@ DECL_HANDLER(get_update_region) else { if (reply->flags & UPDATE_NONCLIENT) validate_non_client( win ); - if (reply->flags & UPDATE_ERASE) win->paint_flags &= ~PAINT_ERASE; + if (reply->flags & UPDATE_ERASE) + { + win->paint_flags &= ~PAINT_ERASE; + /* desktop window only gets erased, not repainted */ + if (win == top_window) validate_whole_window( win ); + } } }