mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
mac: SetResizable fix
This commit is contained in:
@@ -649,13 +649,17 @@ void NativeWindowMac::SetContentSizeConstraints(
|
||||
}
|
||||
|
||||
void NativeWindowMac::SetResizable(bool resizable) {
|
||||
bool maximizable = IsMaximizable();
|
||||
// Change styleMask for frameless causes the window to change size, so we have
|
||||
// to explicitly disables that.
|
||||
ScopedDisableResize disable_resize;
|
||||
if (resizable) {
|
||||
[window_ setStyleMask:[window_ styleMask] | NSResizableWindowMask];
|
||||
} else {
|
||||
[[window_ standardWindowButton:NSWindowZoomButton] setEnabled:NO];
|
||||
[window_ setStyleMask:[window_ styleMask] & (~NSResizableWindowMask)];
|
||||
}
|
||||
if (!maximizable) {
|
||||
SetMaximizable(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user