Clear update region before WM_NCDESTROY.

This commit is contained in:
Francis Beaudet 1999-03-21 08:50:41 +00:00 committed by Alexandre Julliard
parent 34bf815822
commit 7c2f0fe45d
1 changed files with 17 additions and 6 deletions

View File

@ -431,6 +431,23 @@ static WND* WIN_DestroyWindow( WND* wndPtr )
WIN_ReleaseWndPtr(pWnd);
}
/*
* Clear the update region to make sure no WM_PAINT messages will be
* generated for this window while processing the WM_NCDESTROY.
*/
if ((wndPtr->hrgnUpdate) || (wndPtr->flags & WIN_INTERNAL_PAINT))
{
if (wndPtr->hrgnUpdate > 1)
DeleteObject( wndPtr->hrgnUpdate );
QUEUE_DecPaintCount( wndPtr->hmemTaskQ );
wndPtr->hrgnUpdate = 0;
}
/*
* Send the WM_NCDESTROY to the window being destroyed.
*/
SendMessageA( wndPtr->hwndSelf, WM_NCDESTROY, 0, 0);
/* FIXME: do we need to fake QS_MOUSEMOVE wakebit? */
@ -445,12 +462,6 @@ static WND* WIN_DestroyWindow( WND* wndPtr )
wndPtr->dwMagic = 0; /* Mark it as invalid */
if ((wndPtr->hrgnUpdate) || (wndPtr->flags & WIN_INTERNAL_PAINT))
{
if (wndPtr->hrgnUpdate > 1) DeleteObject( wndPtr->hrgnUpdate );
QUEUE_DecPaintCount( wndPtr->hmemTaskQ );
}
/* toss stale messages from the queue */
if( wndPtr->hmemTaskQ )