Commit 997d4ef4 authored by Fabian Maurer's avatar Fabian Maurer Committed by Alexandre Julliard

user32: Send WM_NCPAINT and WM_ERASEBKGND when window is shown.

parent 6df21d40
...@@ -4651,7 +4651,7 @@ static void test_showwindow(void) ...@@ -4651,7 +4651,7 @@ static void test_showwindow(void)
flush_sequence(); flush_sequence();
ShowWindow(hwnd, SW_SHOWMAXIMIZED); ShowWindow(hwnd, SW_SHOWMAXIMIZED);
ok_sequence(WmShowMaxPopupResizedSeq_todo, ok_sequence(WmShowMaxPopupResizedSeq_todo,
"ShowWindow(SW_SHOWMAXIMIZED):invisible maximized and resized popup TODO", FALSE); "ShowWindow(SW_SHOWMAXIMIZED):invisible maximized and resized popup TODO", TRUE);
DestroyWindow(hwnd); DestroyWindow(hwnd);
flush_sequence(); flush_sequence();
...@@ -5135,7 +5135,7 @@ static void test_messages(void) ...@@ -5135,7 +5135,7 @@ static void test_messages(void)
10, 10, 100, 100, NULL, 0, 0, NULL ); 10, 10, 100, 100, NULL, 0, 0, NULL );
ok (hwnd != 0, "Failed to create popup window\n"); ok (hwnd != 0, "Failed to create popup window\n");
RedrawWindow(hwnd, NULL, NULL, RDW_UPDATENOW); RedrawWindow(hwnd, NULL, NULL, RDW_UPDATENOW);
ok_sequence(WmShowPopupFirstDrawSeq_1, "RedrawWindow:show_popup_first_draw_visible", TRUE); ok_sequence(WmShowPopupFirstDrawSeq_1, "RedrawWindow:show_popup_first_draw_visible", FALSE);
DestroyWindow(hwnd); DestroyWindow(hwnd);
/* Invisible, show, message */ /* Invisible, show, message */
...@@ -5146,7 +5146,7 @@ static void test_messages(void) ...@@ -5146,7 +5146,7 @@ static void test_messages(void)
ok (hwnd != 0, "Failed to create popup window\n"); ok (hwnd != 0, "Failed to create popup window\n");
ShowWindow(hwnd, SW_SHOW); ShowWindow(hwnd, SW_SHOW);
SendMessageW(hwnd, WM_PAINT, 0, 0); SendMessageW(hwnd, WM_PAINT, 0, 0);
ok_sequence(WmShowPopupFirstDrawSeq_1, "RedrawWindow:show_popup_first_draw_show", TRUE); ok_sequence(WmShowPopupFirstDrawSeq_1, "RedrawWindow:show_popup_first_draw_show", FALSE);
DestroyWindow(hwnd); DestroyWindow(hwnd);
/* Invisible, show maximized, redraw */ /* Invisible, show maximized, redraw */
...@@ -5157,20 +5157,20 @@ static void test_messages(void) ...@@ -5157,20 +5157,20 @@ static void test_messages(void)
ok (hwnd != 0, "Failed to create popup window\n"); ok (hwnd != 0, "Failed to create popup window\n");
ShowWindow(hwnd, SW_SHOWMAXIMIZED); ShowWindow(hwnd, SW_SHOWMAXIMIZED);
RedrawWindow(hwnd, NULL, NULL, RDW_UPDATENOW); RedrawWindow(hwnd, NULL, NULL, RDW_UPDATENOW);
ok_sequence(WmShowPopupFirstDrawSeq_2, "RedrawWindow:show_popup_first_draw_show_maximized", TRUE); ok_sequence(WmShowPopupFirstDrawSeq_2, "RedrawWindow:show_popup_first_draw_show_maximized", FALSE);
DestroyWindow(hwnd); DestroyWindow(hwnd);
/* Test SetWindowPos */ /* Test SetWindowPos */
test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq2, 0, FALSE); test_msg_setpos(WmFirstDrawSetWindowPosSeq2, 0, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq3, test_msg_setpos(WmFirstDrawSetWindowPosSeq3,
SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOZORDER, TRUE); SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOZORDER, TRUE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOSIZE, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOSIZE, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq4, SWP_SHOWWINDOW | SWP_NOMOVE, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq4, SWP_SHOWWINDOW | SWP_NOMOVE, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCLIENTSIZE, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCLIENTSIZE, TRUE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCLIENTMOVE, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCLIENTMOVE, TRUE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOZORDER, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOZORDER, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE, FALSE); test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOCLIENTMOVE, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOCLIENTMOVE, TRUE);
...@@ -5179,12 +5179,12 @@ static void test_messages(void) ...@@ -5179,12 +5179,12 @@ static void test_messages(void)
test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOSIZE, FALSE); test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOSIZE, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOZORDER, FALSE); test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_DEFERERASE | SWP_NOZORDER, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOCLIENTMOVE, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOCLIENTMOVE, TRUE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOCLIENTSIZE, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOCLIENTSIZE, TRUE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq4, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOMOVE, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq4, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOMOVE, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOSIZE, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOSIZE, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOZORDER, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq1, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOZORDER, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_NOREDRAW, FALSE); test_msg_setpos(WmFirstDrawSetWindowPosSeq2, SWP_SHOWWINDOW | SWP_NOREDRAW, FALSE);
test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOCLIENTMOVE, TRUE); test_msg_setpos(WmFirstDrawSetWindowPosSeq3, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOCLIENTMOVE, TRUE);
...@@ -5220,7 +5220,7 @@ static void test_messages(void) ...@@ -5220,7 +5220,7 @@ static void test_messages(void)
flush_sequence(); flush_sequence();
SetWindowPos(hparent, NULL, 0, 0, 100, 100, SWP_SHOWWINDOW); SetWindowPos(hparent, NULL, 0, 0, 100, 100, SWP_SHOWWINDOW);
ok_sequence(WmFirstDrawChildSeq2, /* Expect child to be redrawn */ ok_sequence(WmFirstDrawChildSeq2, /* Expect child to be redrawn */
"SetWindowPos:show_popup_first_show_window_child2", TRUE); "SetWindowPos:show_popup_first_show_window_child2", FALSE);
DestroyWindow(hchild); DestroyWindow(hchild);
DestroyWindow(hparent); DestroyWindow(hparent);
......
...@@ -45,6 +45,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(win); ...@@ -45,6 +45,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(win);
(SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOZORDER) (SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOZORDER)
#define SWP_AGG_STATUSFLAGS \ #define SWP_AGG_STATUSFLAGS \
(SWP_AGG_NOPOSCHANGE | SWP_FRAMECHANGED | SWP_HIDEWINDOW | SWP_SHOWWINDOW) (SWP_AGG_NOPOSCHANGE | SWP_FRAMECHANGED | SWP_HIDEWINDOW | SWP_SHOWWINDOW)
#define SWP_AGG_NOCLIENTCHANGE \
(SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE)
#define HAS_DLGFRAME(style,exStyle) \ #define HAS_DLGFRAME(style,exStyle) \
(((exStyle) & WS_EX_DLGMODALFRAME) || \ (((exStyle) & WS_EX_DLGMODALFRAME) || \
...@@ -2229,16 +2231,7 @@ BOOL USER_SetWindowPos( WINDOWPOS * winpos ) ...@@ -2229,16 +2231,7 @@ BOOL USER_SetWindowPos( WINDOWPOS * winpos )
&newWindowRect, &newClientRect, valid_rects )) &newWindowRect, &newClientRect, valid_rects ))
return FALSE; return FALSE;
/* 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 ) if( winpos->flags & SWP_HIDEWINDOW )
HideCaret(winpos->hwnd); HideCaret(winpos->hwnd);
...@@ -2254,6 +2247,26 @@ BOOL USER_SetWindowPos( WINDOWPOS * winpos ) ...@@ -2254,6 +2247,26 @@ BOOL USER_SetWindowPos( WINDOWPOS * winpos )
SetForegroundWindow( winpos->hwnd ); SetForegroundWindow( winpos->hwnd );
} }
if(!(orig_flags & SWP_DEFERERASE))
{
/* erase parent when hiding or resizing child */
if ((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 );
}
/* Give newly shown windows a chance to redraw */
if(((winpos->flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE)
&& !(orig_flags & SWP_AGG_NOCLIENTCHANGE) && (orig_flags & SWP_SHOWWINDOW))
{
erase_now(winpos->hwnd, 0);
}
}
/* And last, send the WM_WINDOWPOSCHANGED message */ /* And last, send the WM_WINDOWPOSCHANGED message */
TRACE("\tstatus flags = %04x\n", winpos->flags & SWP_AGG_STATUSFLAGS); TRACE("\tstatus flags = %04x\n", winpos->flags & SWP_AGG_STATUSFLAGS);
......
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