fix zoom button when alwaysOnTop set (#19314)
This commit is contained in:
parent
e389fa75ea
commit
42d4c579c3
1 changed files with 5 additions and 0 deletions
|
@ -853,7 +853,12 @@ void NativeWindowMac::SetAlwaysOnTop(bool top,
|
||||||
|
|
||||||
NSInteger newLevel = windowLevel + relativeLevel;
|
NSInteger newLevel = windowLevel + relativeLevel;
|
||||||
if (newLevel >= minWindowLevel && newLevel <= maxWindowLevel) {
|
if (newLevel >= minWindowLevel && newLevel <= maxWindowLevel) {
|
||||||
|
was_maximizable_ = IsMaximizable();
|
||||||
[window_ setLevel:newLevel];
|
[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 {
|
} else {
|
||||||
*error = std::string([[NSString
|
*error = std::string([[NSString
|
||||||
stringWithFormat:@"relativeLevel must be between %d and %d",
|
stringWithFormat:@"relativeLevel must be between %d and %d",
|
||||||
|
|
Loading…
Add table
Reference in a new issue