Bug 1162649 - Don't call setOpaque:NO or setHasShadow:NO for non-popup windows;r=mstange

This commit is contained in:
Brian Grinstead 2015-05-08 14:49:29 -07:00
Родитель 67b91ff53a
Коммит b3c9169963
1 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -1017,8 +1017,8 @@ nsTransparencyMode nsCocoaWindow::GetTransparencyMode()
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(eTransparencyOpaque);
}
// This is called from nsMenuPopupFrame when making a popup transparent.
// For other window types, nsChildView::SetTransparencyMode is used.
// This is called from nsMenuPopupFrame when making a popup transparent, or
// from nsChildView::SetTransparencyMode for other window types.
void nsCocoaWindow::SetTransparencyMode(nsTransparencyMode aMode)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
@ -1026,7 +1026,9 @@ void nsCocoaWindow::SetTransparencyMode(nsTransparencyMode aMode)
if (!mWindow)
return;
BOOL isTransparent = aMode == eTransparencyTransparent;
// Transparent windows are only supported on popups.
BOOL isTransparent = aMode == eTransparencyTransparent &&
mWindowType == eWindowType_popup;
BOOL currentTransparency = ![mWindow isOpaque];
if (isTransparent != currentTransparency) {
[mWindow setOpaque:!isTransparent];
@ -1929,7 +1931,11 @@ NS_IMETHODIMP nsCocoaWindow::SetWindowShadowStyle(int32_t aStyle)
return NS_OK;
mShadowStyle = aStyle;
[mWindow setHasShadow:(aStyle != NS_STYLE_WINDOW_SHADOW_NONE)];
// Shadowless windows are only supported on popups.
if (mWindowType == eWindowType_popup)
[mWindow setHasShadow:(aStyle != NS_STYLE_WINDOW_SHADOW_NONE)];
[mWindow setUseMenuStyle:(aStyle == NS_STYLE_WINDOW_SHADOW_MENU)];
AdjustWindowShadow();
SetWindowBackgroundBlur();