X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/65afac3fbc6115b899045d767af823fc3abd7322..370efbe74165c03642ea7620d35d9e0be8572d74:/src/common/toplvcmn.cpp?ds=sidebyside

diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp
index 8441f436eb..bf2742a04e 100644
--- a/src/common/toplvcmn.cpp
+++ b/src/common/toplvcmn.cpp
@@ -185,6 +185,11 @@ wxSize wxTopLevelWindowBase::GetDefaultSize()
 
 void wxTopLevelWindowBase::DoCentre(int dir)
 {
+    // on some platforms centering top level windows is impossible
+    // because they are always maximized by guidelines or limitations
+    if(IsAlwaysMaximized())
+        return;
+
     // we need the display rect anyhow so store it first
     int nDisplay = wxDisplay::GetFromWindow(this);
     wxDisplay dpy(nDisplay == wxNOT_FOUND ? 0 : nDisplay);
@@ -286,6 +291,14 @@ void wxTopLevelWindowBase::DoClientToScreen(int *x, int *y) const
     wxWindow::DoClientToScreen(x, y);
 }
 
+bool wxTopLevelWindowBase::IsAlwaysMaximized() const
+{
+#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
+    return true;
+#else
+    return false;
+#endif
+}
 
 // ----------------------------------------------------------------------------
 // event handlers
@@ -325,7 +338,7 @@ void wxTopLevelWindowBase::DoLayout()
         }
 
         // do we have any children at all?
-        if ( child )
+        if ( child && child->IsShown() )
         {
             // exactly one child - set it's size to fill the whole frame
             int clientW, clientH;