]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/toplevel.cpp
Made device to logical and vv conversion methods
[wxWidgets.git] / src / gtk / toplevel.cpp
index 43690457a1dfac65dca928d3939e7797bc2ea8b5..cf9cca1cb21a4b5aea4cf9d8e0f25b780ff5c144 100644 (file)
@@ -800,13 +800,7 @@ bool wxTopLevelWindowGTK::Show( bool show )
     if (show == IsShown())
         return false;
 
-    if (!show)
-    {
-        // make sure window has a non-default position, so when it is shown
-        // again, it won't be repositioned by WM as if it were a new window
-        gtk_window_move((GtkWindow*)m_widget, m_x, m_y);
-    }
-    else if (!m_sizeSet)
+    if (show && !m_sizeSet)
     {
         /* by calling GtkOnSize here, we don't have to call
            either after showing the frame, which would entail
@@ -816,7 +810,17 @@ bool wxTopLevelWindowGTK::Show( bool show )
         GtkOnSize();
     }
 
-    return wxTopLevelWindowBase::Show(show);
+    wxTopLevelWindowBase::Show(show);
+
+    if (!show)
+    {
+        // make sure window has a non-default position, so when it is shown
+        // again, it won't be repositioned by WM as if it were a new window
+        // Note that this must be done _after_ the window is hidden.
+        gtk_window_move((GtkWindow*)m_widget, m_x, m_y);
+    }
+
+    return true;
 }
 
 void wxTopLevelWindowGTK::Raise()
@@ -853,23 +857,7 @@ void wxTopLevelWindowGTK::GTKDoSetSize(int width, int height)
     if ( height != -1 )
         m_height = height;
 
-    // GPE's window manager doesn't like size hints at all, esp. when the user
-    // has to use the virtual keyboard, so don't constrain size there
-#ifndef __WXGPE__
-    int minWidth = GetMinWidth(),
-        minHeight = GetMinHeight(),
-        maxWidth = GetMaxWidth(),
-        maxHeight = GetMaxHeight();
-
-    if ( minWidth != -1 && m_width < minWidth )
-        m_width = minWidth;
-    if ( minHeight != -1 && m_height < minHeight )
-        m_height = minHeight;
-    if ( maxWidth != -1 && m_width > maxWidth )
-        m_width = maxWidth;
-    if ( maxHeight != -1 && m_height > maxHeight )
-        m_height = maxHeight;
-#endif // __WXGPE__
+    ConstrainSize();
 
     if ( m_width != old_width || m_height != old_height )
     {
@@ -1042,25 +1030,7 @@ void wxTopLevelWindowGTK::GtkOnSize()
        skip the part which handles m_frameMenuBar, m_frameToolBar and (most
        importantly) m_mainWidget */
 
-    int minWidth = GetMinWidth(),
-        minHeight = GetMinHeight(),
-        maxWidth = GetMaxWidth(),
-        maxHeight = GetMaxHeight();
-
-#ifdef __WXGPE__
-    // GPE's window manager doesn't like size hints
-    // at all, esp. when the user has to use the
-    // virtual keyboard.
-    minWidth = -1;
-    minHeight = -1;
-    maxWidth = -1;
-    maxHeight = -1;
-#endif
-
-    if ((minWidth != -1) && (m_width < minWidth)) m_width = minWidth;
-    if ((minHeight != -1) && (m_height < minHeight)) m_height = minHeight;
-    if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth;
-    if ((maxHeight != -1) && (m_height > maxHeight)) m_height = maxHeight;
+    ConstrainSize();
 
     if (m_mainWidget)
     {