diff --git a/libcef/browser/native/browser_platform_delegate_native_mac.mm b/libcef/browser/native/browser_platform_delegate_native_mac.mm index bf897bcea..578e7968f 100644 --- a/libcef/browser/native/browser_platform_delegate_native_mac.mm +++ b/libcef/browser/native/browser_platform_delegate_native_mac.mm @@ -216,12 +216,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;