Commit a887a64c authored by Alexandre Julliard's avatar Alexandre Julliard

user32: SetWindowPos should erase the parent also for child moves.

parent effdfa7d
......@@ -941,6 +941,7 @@ static const struct message WmDragThickBordersBarSeq[] = { /* FIXME: add */
static const struct message WmResizingChildWithMoveWindowSeq[] = {
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOACTIVATE },
{ WM_NCCALCSIZE, sent|wparam, 1 },
{ WM_ERASEBKGND, sent|parent|optional },
{ WM_ERASEBKGND, sent|optional },
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE },
{ WM_MOVE, sent|defwinproc },
......@@ -4020,8 +4021,10 @@ static void test_messages(void)
/* test WM_SETREDRAW on a visible child window */
test_WM_SETREDRAW(hchild);
log_all_parent_messages++;
MoveWindow(hchild, 10, 10, 20, 20, TRUE);
ok_sequence(WmResizingChildWithMoveWindowSeq, "MoveWindow:child", FALSE);
log_all_parent_messages--;
ShowWindow(hchild, SW_HIDE);
flush_sequence();
......
......@@ -1604,19 +1604,15 @@ BOOL USER_SetWindowPos( WINDOWPOS * winpos )
&newWindowRect, &newClientRect, orig_flags, valid_rects ))
return FALSE;
/* erase parent if hiding child */
if (!(orig_flags & SWP_DEFERERASE))
{
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 );
}
/* erase parent when hiding or resizing child */
if (!(orig_flags & SWP_DEFERERASE) &&
((orig_flags & SWP_HIDEWINDOW) ||
(!(orig_flags & SWP_SHOWWINDOW) &&
(winpos->flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOGEOMETRYCHANGE)))
{
HWND parent = GetAncestor( winpos->hwnd, GA_PARENT );
if (!parent || parent == GetDesktopWindow()) parent = winpos->hwnd;
erase_now( parent, 0 );
}
if( winpos->flags & SWP_HIDEWINDOW )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment