]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
removed WXWIN_COMPATIBILITY_2_4 in non-MSW code
[wxWidgets.git] / src / common / wincmn.cpp
index 7b0bb3c81b94cc746ee0a2ee97998683ce9034ae..41c8a455bde442f9e2a468dcf636c08927e22888 100644 (file)
@@ -497,7 +497,18 @@ wxSize wxWindowBase::DoGetBestSize() const
 
     if ( m_windowSizer )
     {
-        best = GetWindowSizeForVirtualSize(m_windowSizer->GetMinSize());
+        // Adjust to window size, since the return value of GetWindowSizeForVirtualSize is
+        // expressed in window and not client size
+        wxSize minSize = m_windowSizer->GetMinSize();
+        wxSize size(GetSize());
+        wxSize clientSize(GetClientSize());
+
+        wxSize minWindowSize(minSize.x + size.x - clientSize.x,
+                             minSize.y + size.y - clientSize.y);
+
+        best = GetWindowSizeForVirtualSize(minWindowSize);
+
+        return best;
     }
 #if wxUSE_CONSTRAINTS
     else if ( m_constraints )