]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/nonownedwnd.mm
Correct IsMaximized() in wxOSX for non-resizable windows.
[wxWidgets.git] / 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