From acdb4bb564dc6151bbc48fae252607840e36c692 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 9 Jun 2016 14:48:38 -0400 Subject: [PATCH] Mac: Fix window sharing type (issue #1884) --- .../native/browser_platform_delegate_native_mac.mm | 10 +++++----- tests/cefclient/browser/root_window_mac.mm | 10 +++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/libcef/browser/native/browser_platform_delegate_native_mac.mm b/libcef/browser/native/browser_platform_delegate_native_mac.mm index 1aadb9b8b..a5125e5da 100644 --- a/libcef/browser/native/browser_platform_delegate_native_mac.mm +++ b/libcef/browser/native/browser_platform_delegate_native_mac.mm @@ -217,12 +217,12 @@ bool CefBrowserPlatformDelegateNativeMac::CreateHostWindow() { parentView = [newWnd contentView]; window_info_.parent_view = parentView; - } - // Make the content view for the window have a layer. This will make all - // sub-views have layers. This is necessary to ensure correct layer - // ordering of all child views and their layers. - [[[parentView window] contentView] setWantsLayer:YES]; + // Make the content view for the window have a layer. This will make all + // sub-views have layers. This is necessary to ensure correct layer + // ordering of all child views and their layers. + [parentView setWantsLayer:YES]; + } host_window_created_ = true; diff --git a/tests/cefclient/browser/root_window_mac.mm b/tests/cefclient/browser/root_window_mac.mm index 7453ac0fb..74fe70936 100644 --- a/tests/cefclient/browser/root_window_mac.mm +++ b/tests/cefclient/browser/root_window_mac.mm @@ -468,7 +468,8 @@ void RootWindowMac::CreateRootWindow(const CefBrowserSettings& settings) { styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | - NSResizableWindowMask ) + NSResizableWindowMask | + NSUnifiedTitleAndToolbarWindowMask ) backing:NSBackingStoreBuffered defer:NO]; [window_ setTitle:@"cefclient"]; @@ -494,6 +495,13 @@ void RootWindowMac::CreateRootWindow(const CefBrowserSettings& settings) { NSView* contentView = [window_ contentView]; NSRect contentBounds = [contentView bounds]; + if (!with_osr_) { + // Make the content view for the window have a layer. This will make all + // sub-views have layers. This is necessary to ensure correct layer + // ordering of all child views and their layers. + [contentView setWantsLayer:YES]; + } + if (with_controls_) { // Create the buttons. NSRect button_rect = contentBounds;