ShowWindow activates only a being maximized child window, add a couple
of message tests for MDI child activation.
This commit is contained in:
parent
193c83f646
commit
12f49fb9b1
|
@ -1778,6 +1778,47 @@ static void test_mdi_messages(void)
|
||||||
SetFocus(0);
|
SetFocus(0);
|
||||||
flush_sequence();
|
flush_sequence();
|
||||||
|
|
||||||
|
trace("creating invisible MDI child window\n");
|
||||||
|
mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
|
||||||
|
WS_CHILD,
|
||||||
|
0, 0, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||||
|
mdi_client, 0, GetModuleHandleA(0), NULL);
|
||||||
|
assert(mdi_child);
|
||||||
|
|
||||||
|
flush_sequence();
|
||||||
|
ShowWindow(mdi_child, SW_SHOWNORMAL);
|
||||||
|
ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOWNORMAL) MDI child window", FALSE);
|
||||||
|
|
||||||
|
ok(GetWindowLongA(mdi_child, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
|
||||||
|
ok(IsWindowVisible(mdi_child), "MDI child should be visible\n");
|
||||||
|
|
||||||
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
||||||
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
||||||
|
|
||||||
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
||||||
|
ok(!active_child, "wrong active MDI child %p\n", active_child);
|
||||||
|
ok(!zoomed, "wrong zoomed state %d\n", zoomed);
|
||||||
|
|
||||||
|
ShowWindow(mdi_child, SW_HIDE);
|
||||||
|
ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE) MDI child window", FALSE);
|
||||||
|
flush_sequence();
|
||||||
|
|
||||||
|
ShowWindow(mdi_child, SW_SHOW);
|
||||||
|
ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOW) MDI child window", FALSE);
|
||||||
|
|
||||||
|
ok(GetWindowLongA(mdi_child, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
|
||||||
|
ok(IsWindowVisible(mdi_child), "MDI child should be visible\n");
|
||||||
|
|
||||||
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
||||||
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
||||||
|
|
||||||
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
||||||
|
ok(!active_child, "wrong active MDI child %p\n", active_child);
|
||||||
|
ok(!zoomed, "wrong zoomed state %d\n", zoomed);
|
||||||
|
|
||||||
|
DestroyWindow(mdi_child);
|
||||||
|
flush_sequence();
|
||||||
|
|
||||||
trace("creating visible MDI child window\n");
|
trace("creating visible MDI child window\n");
|
||||||
mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
|
mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
|
||||||
WS_CHILD | WS_VISIBLE,
|
WS_CHILD | WS_VISIBLE,
|
||||||
|
|
|
@ -1288,13 +1288,15 @@ BOOL X11DRV_ShowWindow( HWND hwnd, INT cmd )
|
||||||
swp |= SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE;
|
swp |= SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SW_RESTORE:
|
||||||
|
swp |= SWP_FRAMECHANGED;
|
||||||
|
/* fall through */
|
||||||
case SW_SHOWNOACTIVATE:
|
case SW_SHOWNOACTIVATE:
|
||||||
swp |= SWP_NOACTIVATE | SWP_NOZORDER;
|
swp |= SWP_NOACTIVATE | SWP_NOZORDER;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case SW_SHOWNORMAL: /* same as SW_NORMAL: */
|
case SW_SHOWNORMAL: /* same as SW_NORMAL: */
|
||||||
case SW_SHOWDEFAULT: /* FIXME: should have its own handler */
|
case SW_SHOWDEFAULT: /* FIXME: should have its own handler */
|
||||||
case SW_RESTORE:
|
swp |= SWP_SHOWWINDOW;
|
||||||
swp |= SWP_SHOWWINDOW | SWP_FRAMECHANGED;
|
|
||||||
|
|
||||||
if( wndPtr->dwStyle & (WS_MINIMIZE | WS_MAXIMIZE) )
|
if( wndPtr->dwStyle & (WS_MINIMIZE | WS_MAXIMIZE) )
|
||||||
swp |= WINPOS_MinMaximize( hwnd, SW_RESTORE, &newPos );
|
swp |= WINPOS_MinMaximize( hwnd, SW_RESTORE, &newPos );
|
||||||
|
@ -1309,9 +1311,8 @@ BOOL X11DRV_ShowWindow( HWND hwnd, INT cmd )
|
||||||
if (!IsWindow( hwnd )) goto END;
|
if (!IsWindow( hwnd )) goto END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We can't activate a child window */
|
/* ShowWindow won't activate a not being maximized child window */
|
||||||
if ((wndPtr->dwStyle & WS_CHILD) &&
|
if ((wndPtr->dwStyle & WS_CHILD) && cmd != SW_MAXIMIZE)
|
||||||
!(wndPtr->dwExStyle & WS_EX_MDICHILD))
|
|
||||||
swp |= SWP_NOACTIVATE | SWP_NOZORDER;
|
swp |= SWP_NOACTIVATE | SWP_NOZORDER;
|
||||||
|
|
||||||
SetWindowPos( hwnd, HWND_TOP, newPos.left, newPos.top,
|
SetWindowPos( hwnd, HWND_TOP, newPos.left, newPos.top,
|
||||||
|
|
Loading…
Reference in New Issue