]> git.saurik.com Git - wxWidgets.git/commitdiff
really fix window being repositioned after hiding, then reshowing
authorPaul Cornett <paulcor@bullseye.com>
Thu, 26 Apr 2007 02:52:03 +0000 (02:52 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Thu, 26 Apr 2007 02:52:03 +0000 (02:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/toplevel.cpp

index 43690457a1dfac65dca928d3939e7797bc2ea8b5..3b4f88418c756490744e6504de59a6e3d29978b2 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()