diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm index d83c9050df73..9367ec253b7d 100644 --- a/widget/cocoa/nsCocoaWindow.mm +++ b/widget/cocoa/nsCocoaWindow.mm @@ -924,7 +924,7 @@ struct ShadowParams { // 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 @@ -932,6 +932,14 @@ static const ShadowParams kWindowShadowParameters[] = { { 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. @@ -946,7 +954,9 @@ nsCocoaWindow::AdjustWindowShadow() [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,