Bug 1454589 - Don't change window style according to sizemode if the window hasn't be shown. r=jimm

MozReview-Commit-ID: Hysc4yXapYW

--HG--
extra : rebase_source : 8dfd3684d59895405b9a4d63513ee3ae2fa490ab
This commit is contained in:
Xidorn Quan 2018-04-19 15:20:02 +10:00
parent bbd97ff8de
commit 44232b9bb8

View File

@ -7562,18 +7562,20 @@ void nsWindow::SetWindowTranslucencyInner(nsTransparencyMode aMode)
LONG_PTR style = ::GetWindowLongPtrW(hWnd, GWL_STYLE),
exStyle = ::GetWindowLongPtr(hWnd, GWL_EXSTYLE);
if (parent->mIsVisible)
style |= WS_VISIBLE;
if (parent->mSizeMode == nsSizeMode_Maximized)
style |= WS_MAXIMIZE;
else if (parent->mSizeMode == nsSizeMode_Minimized)
style |= WS_MINIMIZE;
if (aMode == eTransparencyTransparent)
exStyle |= WS_EX_LAYERED;
else
exStyle &= ~WS_EX_LAYERED;
if (parent->mIsVisible) {
style |= WS_VISIBLE;
if (parent->mSizeMode == nsSizeMode_Maximized) {
style |= WS_MAXIMIZE;
} else if (parent->mSizeMode == nsSizeMode_Minimized) {
style |= WS_MINIMIZE;
}
}
if (aMode == eTransparencyTransparent)
exStyle |= WS_EX_LAYERED;
else
exStyle &= ~WS_EX_LAYERED;
VERIFY_WINDOW_STYLE(style);
::SetWindowLongPtrW(hWnd, GWL_STYLE, style);