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
|
@ -609,16 +609,14 @@ void NativeWindowMac::Unmaximize() {
|
|||
}
|
||||
|
||||
bool NativeWindowMac::IsMaximized() {
|
||||
if (([window_ styleMask] & NSWindowStyleMaskResizable) != 0) {
|
||||
if (([window_ styleMask] & NSWindowStyleMaskResizable) != 0)
|
||||
return [window_ isZoomed];
|
||||
} else {
|
||||
NSRect rectScreen = [[NSScreen mainScreen] visibleFrame];
|
||||
NSRect rectWindow = [window_ frame];
|
||||
return (rectScreen.origin.x == rectWindow.origin.x &&
|
||||
rectScreen.origin.y == rectWindow.origin.y &&
|
||||
rectScreen.size.width == rectWindow.size.width &&
|
||||
rectScreen.size.height == rectWindow.size.height);
|
||||
}
|
||||
|
||||
NSRect rectScreen = GetAspectRatio() > 0.0
|
||||
? default_frame_for_zoom()
|
||||
: [[NSScreen mainScreen] visibleFrame];
|
||||
|
||||
return NSEqualRects([window_ frame], rectScreen);
|
||||
}
|
||||
|
||||
void NativeWindowMac::Minimize() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue