fix zoom button when alwaysOnTop set (#19350)

This commit is contained in:
trop[bot]
2019-07-19 18:50:50 -07:00
committed by Shelley Vohr
parent 9b1147c7c9
commit 7771886073

View File

@@ -851,7 +851,12 @@ void NativeWindowMac::SetAlwaysOnTop(bool top,
NSInteger newLevel = windowLevel + relativeLevel;
if (newLevel >= minWindowLevel && newLevel <= maxWindowLevel) {
was_maximizable_ = IsMaximizable();
[window_ setLevel:newLevel];
// Set level will make the zoom button revert to default, probably
// a bug of Cocoa or macOS.
[[window_ standardWindowButton:NSWindowZoomButton]
setEnabled:was_maximizable_];
} else {
*error = std::string([[NSString
stringWithFormat:@"relativeLevel must be between %d and %d",