mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix zoom button when alwaysOnTop set (#19350)
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user