Merge pull request #5944 from electron/set-maximizable-last

Set maximizable state after installing view
This commit is contained in:
Cheng Zhao 2016-06-09 01:52:35 +00:00 committed by GitHub
commit 0abd55221d

View file

@ -524,10 +524,6 @@ NativeWindowMac::NativeWindowMac(
options.Get(options::kDisableAutoHideCursor, &disableAutoHideCursor);
[window_ setDisableAutoHideCursor:disableAutoHideCursor];
// Disable zoom button if window is not resizable.
if (!maximizable)
SetMaximizable(false);
NSView* view = inspectable_web_contents()->GetView()->GetNativeView();
[view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
@ -555,6 +551,12 @@ NativeWindowMac::NativeWindowMac(
}];
InstallView();
// Disable zoom button if window is not resizable.
// Set maximizable state last to ensure zoom button does not get reset
// by calls to other APIs.
if (!maximizable)
SetMaximizable(false);
}
NativeWindowMac::~NativeWindowMac() {