From: Vadim Zeitlin Date: Fri, 5 Mar 2010 23:55:27 +0000 (+0000) Subject: Correct IsMaximized() in wxOSX for non-resizable windows. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/cbe067603829728da8852282e895f25b2bccf732 Correct IsMaximized() in wxOSX for non-resizable windows. NSWindow isZoomed always returns true in this case, so check the window rectangle ourselves to determine whether it's maximized. Closes #11734. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index c2af82be5d..df2a894952 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -644,7 +644,19 @@ void wxNonOwnedWindowCocoaImpl::SetTitle( const wxString& title, wxFontEncoding bool wxNonOwnedWindowCocoaImpl::IsMaximized() const { - return [m_macWindow isZoomed]; + if (([m_macWindow styleMask] & NSResizableWindowMask) != 0) + { + return [m_macWindow isZoomed]; + } + else + { + NSRect rectScreen = [[NSScreen mainScreen] visibleFrame]; + NSRect rectWindow = [m_macWindow 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); + } } bool wxNonOwnedWindowCocoaImpl::IsIconized() const