osx: Set resizable flag when creating window
Setting resizable for frameless window before it is shown will change its size.
This commit is contained in:
parent
6fea6cf58a
commit
898db4d6bd
2 changed files with 8 additions and 1 deletions
|
@ -134,10 +134,12 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
|
|||
} else {
|
||||
SetSizeConstraints(size_constraints);
|
||||
}
|
||||
#if defined(OS_WIN) || defined(USE_X11)
|
||||
bool resizable;
|
||||
if (options.Get(switches::kResizable, &resizable)) {
|
||||
SetResizable(resizable);
|
||||
}
|
||||
#endif
|
||||
bool top;
|
||||
if (options.Get(switches::kAlwaysOnTop, &top) && top) {
|
||||
SetAlwaysOnTop(true);
|
||||
|
|
|
@ -350,6 +350,8 @@ NativeWindowMac::NativeWindowMac(
|
|||
|
||||
bool useStandardWindow = true;
|
||||
options.Get(switches::kStandardWindow, &useStandardWindow);
|
||||
bool resizable = true;
|
||||
options.Get(switches::kResizable, &resizable);
|
||||
|
||||
// New title bar styles are available in Yosemite or newer
|
||||
std::string titleBarStyle;
|
||||
|
@ -357,10 +359,13 @@ NativeWindowMac::NativeWindowMac(
|
|||
options.Get(switches::kTitleBarStyle, &titleBarStyle);
|
||||
|
||||
NSUInteger styleMask = NSTitledWindowMask | NSClosableWindowMask |
|
||||
NSMiniaturizableWindowMask | NSResizableWindowMask;
|
||||
NSMiniaturizableWindowMask;
|
||||
if (!useStandardWindow || transparent() || !has_frame()) {
|
||||
styleMask |= NSTexturedBackgroundWindowMask;
|
||||
}
|
||||
if (resizable) {
|
||||
styleMask |= NSResizableWindowMask;
|
||||
}
|
||||
if ((titleBarStyle == "hidden") || (titleBarStyle == "hidden-inset")) {
|
||||
styleMask |= NSFullSizeContentViewWindowMask;
|
||||
styleMask |= NSUnifiedTitleAndToolbarWindowMask;
|
||||
|
|
Loading…
Add table
Reference in a new issue