Alexandre Julliard : user32: Erase parent window when child is hidden.
From a patch by Clinton Stimpson.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Aug 1 05:16:40 CDT 2007
Module: wine
Branch: master
Commit: ce7bfd6a3f9258e2edb0b056e076f71978c1cc52
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ce7bfd6a3f9258e2edb0b056e076f71978c1cc52
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Jul 31 20:32:15 2007 +0200
user32: Erase parent window when child is hidden. From a patch by Clinton Stimpson.
---
dlls/user32/painting.c | 2 +-
dlls/user32/tests/msg.c | 2 +-
dlls/user32/user_private.h | 1 +
dlls/user32/winpos.c | 18 ++++++++++++------
4 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c
index 30dddae..862c75f 100644
--- a/dlls/user32/painting.c
+++ b/dlls/user32/painting.c
@@ -280,7 +280,7 @@ static BOOL send_erase( HWND hwnd, UINT flags, HRGN client_rgn,
*
* 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;
HRGN hrgn;
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 04dca3f..930821f 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -3994,7 +3994,7 @@ static void test_messages(void)
/* check parent messages too */
log_all_parent_messages++;
ShowWindow(hchild, SW_HIDE);
- ok_sequence(WmHideChildSeq2, "ShowWindow(SW_HIDE):child", TRUE);
+ ok_sequence(WmHideChildSeq2, "ShowWindow(SW_HIDE):child", FALSE);
log_all_parent_messages--;
ShowWindow(hchild, SW_SHOW);
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h
index d6eac17..67be8f5 100644
--- a/dlls/user32/user_private.h
+++ b/dlls/user32/user_private.h
@@ -213,6 +213,7 @@ extern HBRUSH SYSCOLOR_55AABrush;
extern BOOL CLIPBOARD_ReleaseOwner(void);
extern BOOL FOCUS_MouseActivate( HWND hwnd );
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 MSG_SendInternalMessageTimeout( DWORD dest_pid, DWORD dest_tid,
UINT msg, WPARAM wparam, LPARAM lparam,
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index adf897e..a13753c 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -1604,13 +1604,19 @@ BOOL USER_SetWindowPos( WINDOWPOS * winpos )
&newWindowRect, &newClientRect, orig_flags, valid_rects ))
return FALSE;
- /* Windows doesn't redraw a window if it is being just moved */
- if (!(orig_flags & SWP_SHOWWINDOW) &&
- (winpos->flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOGEOMETRYCHANGE)
+ /* erase parent if hiding child */
+ if (!(orig_flags & SWP_DEFERERASE))
{
- UINT rdw_flags = RDW_FRAME | RDW_ERASE;
- if ( !(orig_flags & SWP_DEFERERASE) ) rdw_flags |= RDW_ERASENOW;
- RedrawWindow( winpos->hwnd, NULL, NULL, rdw_flags );
+ if (orig_flags & SWP_HIDEWINDOW)
+ {
+ 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 )
More information about the wine-cvs
mailing list