user32: Erase parent window when child is hidden. From a patch by Clinton Stimpson.

This commit is contained in:
Alexandre Julliard 2007-07-31 20:32:15 +02:00
parent 5b6bb63adb
commit ce7bfd6a3f
4 changed files with 15 additions and 8 deletions

View File

@ -280,7 +280,7 @@ static BOOL send_erase( HWND hwnd, UINT flags, HRGN client_rgn,
* *
* Implementation of RDW_ERASENOW behavior. * Implementation of RDW_ERASENOW behavior.
*/ */
static void erase_now( HWND hwnd, UINT rdw_flags ) void erase_now( HWND hwnd, UINT rdw_flags )
{ {
HWND child = 0; HWND child = 0;
HRGN hrgn; HRGN hrgn;

View File

@ -3994,7 +3994,7 @@ static void test_messages(void)
/* check parent messages too */ /* check parent messages too */
log_all_parent_messages++; log_all_parent_messages++;
ShowWindow(hchild, SW_HIDE); ShowWindow(hchild, SW_HIDE);
ok_sequence(WmHideChildSeq2, "ShowWindow(SW_HIDE):child", TRUE); ok_sequence(WmHideChildSeq2, "ShowWindow(SW_HIDE):child", FALSE);
log_all_parent_messages--; log_all_parent_messages--;
ShowWindow(hchild, SW_SHOW); ShowWindow(hchild, SW_SHOW);

View File

@ -213,6 +213,7 @@ extern HBRUSH SYSCOLOR_55AABrush;
extern BOOL CLIPBOARD_ReleaseOwner(void); extern BOOL CLIPBOARD_ReleaseOwner(void);
extern BOOL FOCUS_MouseActivate( HWND hwnd ); extern BOOL FOCUS_MouseActivate( HWND hwnd );
extern BOOL HOOK_IsHooked( INT id ); extern BOOL HOOK_IsHooked( INT id );
extern void erase_now( HWND hwnd, UINT rdw_flags );
extern LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ); extern LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam );
extern LRESULT MSG_SendInternalMessageTimeout( DWORD dest_pid, DWORD dest_tid, extern LRESULT MSG_SendInternalMessageTimeout( DWORD dest_pid, DWORD dest_tid,
UINT msg, WPARAM wparam, LPARAM lparam, UINT msg, WPARAM wparam, LPARAM lparam,

View File

@ -1604,13 +1604,19 @@ BOOL USER_SetWindowPos( WINDOWPOS * winpos )
&newWindowRect, &newClientRect, orig_flags, valid_rects )) &newWindowRect, &newClientRect, orig_flags, valid_rects ))
return FALSE; return FALSE;
/* Windows doesn't redraw a window if it is being just moved */ /* erase parent if hiding child */
if (!(orig_flags & SWP_SHOWWINDOW) && if (!(orig_flags & SWP_DEFERERASE))
(winpos->flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOGEOMETRYCHANGE)
{ {
UINT rdw_flags = RDW_FRAME | RDW_ERASE; if (orig_flags & SWP_HIDEWINDOW)
if ( !(orig_flags & SWP_DEFERERASE) ) rdw_flags |= RDW_ERASENOW; {
RedrawWindow( winpos->hwnd, NULL, NULL, rdw_flags ); HWND parent = GetAncestor( winpos->hwnd, GA_PARENT );
erase_now( parent, RDW_NOCHILDREN );
}
else if (!(orig_flags & SWP_SHOWWINDOW) &&
(winpos->flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOGEOMETRYCHANGE)
{
erase_now( winpos->hwnd, 0 );
}
} }
if( winpos->flags & SWP_HIDEWINDOW ) if( winpos->flags & SWP_HIDEWINDOW )