]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct IsMaximized() in wxOSX for non-resizable windows.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 5 Mar 2010 23:55:27 +0000 (23:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 5 Mar 2010 23:55:27 +0000 (23:55 +0000)
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

src/osx/cocoa/nonownedwnd.mm

index c2af82be5d33c92d2fd1fbc4a458e0a0c2dbc163..df2a8949529a08c708469e0fdc0a630a4eb85551 100644 (file)
@@ -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