Skip to content

Commit

Permalink
fix zoom button when alwaysOnTop set (#19351)
Browse files Browse the repository at this point in the history
  • Loading branch information
trop[bot] authored and codebytere committed Aug 5, 2019
1 parent 7bec7e6 commit 54902e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions atom/browser/native_window_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,12 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {

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",
Expand Down

0 comments on commit 54902e8

Please sign in to comment.