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
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