fix: maximized state calculation for non-resizable windows (#30989)
This commit is contained in:
parent
92bff00d43
commit
629d8913f6
5 changed files with 47 additions and 11 deletions
|
@ -188,6 +188,19 @@ class NativeWindowMac : public NativeWindow,
|
|||
bool zoom_to_page_width() const { return zoom_to_page_width_; }
|
||||
bool always_simple_fullscreen() const { return always_simple_fullscreen_; }
|
||||
|
||||
// We need to save the result of windowWillUseStandardFrame:defaultFrame
|
||||
// because macOS calls it with what it refers to as the "best fit" frame for a
|
||||
// zoom. This means that even if an aspect ratio is set, macOS might adjust it
|
||||
// to better fit the screen.
|
||||
//
|
||||
// Thus, we can't just calculate the maximized aspect ratio'd sizing from
|
||||
// the current visible screen and compare that to the current window's frame
|
||||
// to determine whether a window is maximized.
|
||||
NSRect default_frame_for_zoom() const { return default_frame_for_zoom_; }
|
||||
void set_default_frame_for_zoom(NSRect frame) {
|
||||
default_frame_for_zoom_ = frame;
|
||||
}
|
||||
|
||||
protected:
|
||||
// views::WidgetDelegate:
|
||||
views::View* GetContentsView() override;
|
||||
|
@ -263,6 +276,7 @@ class NativeWindowMac : public NativeWindow,
|
|||
NSRect original_frame_;
|
||||
NSInteger original_level_;
|
||||
NSUInteger simple_fullscreen_mask_;
|
||||
NSRect default_frame_for_zoom_;
|
||||
|
||||
std::string vibrancy_type_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue