--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -919,39 +919,49 @@ struct ShadowParams {
float density;
int offsetX;
int offsetY;
unsigned int flags;
};
// These numbers have been determined by looking at the results of
// CGSGetWindowShadowAndRimParameters for native window types.
-static const ShadowParams kWindowShadowParameters[] = {
+static const ShadowParams kWindowShadowParametersPreYosemite[] = {
{ 0.0f, 0.0f, 0, 0, 0 }, // none
{ 8.0f, 0.5f, 0, 6, 1 }, // default
{ 10.0f, 0.44f, 0, 10, 512 }, // menu
{ 8.0f, 0.5f, 0, 6, 1 }, // tooltip
{ 4.0f, 0.6f, 0, 4, 512 } // sheet
};
+static const ShadowParams kWindowShadowParametersPostYosemite[] = {
+ { 0.0f, 0.0f, 0, 0, 0 }, // none
+ { 8.0f, 0.5f, 0, 6, 1 }, // default
+ { 9.882353f, 0.3f, 0, 4, 0 }, // menu
+ { 3.294118f, 0.2f, 0, 1, 0 }, // tooltip
+ { 9.882353f, 0.3f, 0, 4, 0 } // sheet
+};
+
// This method will adjust the window shadow style for popup windows after
// they have been made visible. Before they're visible, their window number
// might be -1, which is not useful.
// We won't attempt to change the shadow for windows that can acquire key state
// since OS X will reset the shadow whenever that happens.
void
nsCocoaWindow::AdjustWindowShadow()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
if (!mWindow || ![mWindow isVisible] || ![mWindow hasShadow] ||
[mWindow canBecomeKeyWindow] || [mWindow windowNumber] == -1)
return;
- const ShadowParams& params = kWindowShadowParameters[mShadowStyle];
+ const ShadowParams& params = nsCocoaFeatures::OnYosemiteOrLater()
+ ? kWindowShadowParametersPostYosemite[mShadowStyle]
+ : kWindowShadowParametersPreYosemite[mShadowStyle];
CGSConnection cid = _CGSDefaultConnection();
CGSSetWindowShadowAndRimParameters(cid, [mWindow windowNumber],
params.standardDeviation, params.density,
params.offsetX, params.offsetY,
params.flags);
NS_OBJC_END_TRY_ABORT_BLOCK;
}