Skip to content

Commit

Permalink
refactor: remove 10.9 specific window conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Nov 5, 2018
1 parent c422011 commit 48369b6
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions atom/browser/native_window_mac.mm
Expand Up @@ -1359,23 +1359,6 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
}

void NativeWindowMac::AddContentViewLayers() {
// Make sure the bottom corner is rounded for non-modal windows:
// http://crbug.com/396264. But do not enable it on OS X 10.9 for transparent
// window, otherwise a semi-transparent frame would show.
if (!(transparent() && base::mac::IsOS10_9()) && !is_modal()) {
// For normal window, we need to explicitly set layer for contentView to
// make setBackgroundColor work correctly.
// There is no need to do so for frameless window, and doing so would make
// titleBarStyle stop working.
if (has_frame()) {
base::scoped_nsobject<CALayer> background_layer([[CALayer alloc] init]);
[background_layer
setAutoresizingMask:kCALayerWidthSizable | kCALayerHeightSizable];
[[window_ contentView] setLayer:background_layer];
}
[[window_ contentView] setWantsLayer:YES];
}

if (!has_frame()) {
// In OSX 10.10, adding subviews to the root view for the NSView hierarchy
// produces warnings. To eliminate the warnings, we resize the contentView
Expand All @@ -1399,15 +1382,6 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
[[CustomWindowButtonView alloc] initWithFrame:NSZeroRect]);
[[window_ contentView] addSubview:buttons_view_];
} else {
if (title_bar_style_ != NORMAL) {
if (base::mac::IsOS10_9()) {
ShowWindowButton(NSWindowZoomButton);
ShowWindowButton(NSWindowMiniaturizeButton);
ShowWindowButton(NSWindowCloseButton);
}
return;
}

// Hide the window buttons.
[[window_ standardWindowButton:NSWindowZoomButton] setHidden:YES];
[[window_ standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES];
Expand Down

0 comments on commit 48369b6

Please sign in to comment.