Skip to content

Commit

Permalink
Implement windowWillUseStandardFrame
Browse files Browse the repository at this point in the history
Seems that `NSWindow.isZoomed` returns the wrong result unless you implement this? ¯\_(ツ)_/¯
  • Loading branch information
grokys committed Feb 6, 2023
1 parent f417491 commit e7a6d6f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions native/Avalonia.Native/src/OSX/AvnWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,19 @@ - (void)windowWillClose:(NSNotification *_Nonnull)notification
}
}

// From chromium:
//
// > The delegate or the window class should implement this method so that
// > -[NSWindow isZoomed] can be then determined by whether or not the current
// > window frame is equal to the zoomed frame.
//
// If we don't implement this, then isZoomed always returns true for a non-
// resizable window ¯\_(ツ)_/¯
- (NSRect)windowWillUseStandardFrame:(NSWindow*)window
defaultFrame:(NSRect)newFrame {
return newFrame;
}

-(BOOL)canBecomeKeyWindow
{
if(_canBecomeKeyWindow)
Expand Down

0 comments on commit e7a6d6f

Please sign in to comment.