Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(836)

Unified Diff: ui/views/cocoa/bridged_native_widget.mm

Issue 1633403002: MacViews: Add native drop shadow to dialogs on OSX < 10.10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/cocoa/bridged_content_view.mm ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_native_widget.mm
diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm
index 6a4971bb827c5b17dad1302d43a29ca3bec829ea..6f5dec0f96864ede56c8a7cf940de5ebf964aa92 100644
--- a/ui/views/cocoa/bridged_native_widget.mm
+++ b/ui/views/cocoa/bridged_native_widget.mm
@@ -682,6 +682,14 @@ void BridgedNativeWidget::OnSizeChanged() {
if ([window_ inLiveResize])
MaybeWaitForFrame(new_size);
}
+
+ // 10.9 is unable to generate a window shadow from the composited CALayer, so
+ // use Quartz.
+ // We don't update the window mask during a live resize, instead it is done
+ // after the resize is completed in viewDidEndLiveResize: in
+ // BridgedContentView.
+ if (base::mac::IsOSMavericksOrEarlier() && ![window_ inLiveResize])
+ [bridged_view_ updateWindowMask];
}
void BridgedNativeWidget::OnVisibilityChanged() {
@@ -865,7 +873,12 @@ void BridgedNativeWidget::CreateLayer(ui::LayerType layer_type,
// native shape is what's most appropriate for displaying sheets on Mac.
if (translucent && !native_widget_mac_->IsWindowModalSheet()) {
[window_ setOpaque:NO];
- [window_ setBackgroundColor:[NSColor clearColor]];
+ // For Mac OS versions earlier than Yosemite, the Window server isn't able
+ // to generate a window shadow from the composited CALayer. To get around
+ // this, let the window background remain opaque and clip the window
+ // boundary in drawRect method of BridgedContentView. See crbug.com/543671.
+ if (base::mac::IsOSYosemiteOrLater())
+ [window_ setBackgroundColor:[NSColor clearColor]];
}
UpdateLayerProperties();
« no previous file with comments | « ui/views/cocoa/bridged_content_view.mm ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698