Bug 1211647. Use ::ShowWindow instead of ::ShowWindowPos for toplevel windows widgets that can't take focus. r=jimm

This commit is contained in:
Mason Chang 2016-05-26 16:34:21 -07:00
parent 0f69ca549f
commit 5f4030b30a

View File

@ -1257,15 +1257,7 @@ NS_METHOD nsWindow::Show(bool bState)
if (CanTakeFocus()) {
::ShowWindow(mWnd, SW_SHOWNORMAL);
} else {
// Place the window behind the foreground window
// (as long as it is not topmost)
HWND wndAfter = ::GetForegroundWindow();
if (!wndAfter)
wndAfter = HWND_BOTTOM;
else if (GetWindowLongPtrW(wndAfter, GWL_EXSTYLE) & WS_EX_TOPMOST)
wndAfter = HWND_TOP;
::SetWindowPos(mWnd, wndAfter, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE |
SWP_NOMOVE | SWP_NOACTIVATE);
::ShowWindow(mWnd, SW_SHOWNOACTIVATE);
GetAttention(2);
}
break;