]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix window being repositioned after hiding, then reshowing.
authorPaul Cornett <paulcor@bullseye.com>
Tue, 24 Apr 2007 03:44:48 +0000 (03:44 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Tue, 24 Apr 2007 03:44:48 +0000 (03:44 +0000)
Fix wrong return in Show().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/toplevel.cpp

index 849ebee217a2c3cf64d4c8721732a5f578522add..43690457a1dfac65dca928d3939e7797bc2ea8b5 100644 (file)
@@ -798,9 +798,15 @@ bool wxTopLevelWindowGTK::Show( bool show )
     wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
 
     if (show == IsShown())
-        return true;
+        return false;
 
-    if (show && !m_sizeSet)
+    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)
     {
         /* by calling GtkOnSize here, we don't have to call
            either after showing the frame, which would entail
@@ -810,13 +816,7 @@ bool wxTopLevelWindowGTK::Show( bool show )
         GtkOnSize();
     }
 
-    // This seems no longer to be needed and the call
-    // itself is deprecated.
-    //
-    //if (show)
-    //    gtk_widget_set_uposition( m_widget, m_x, m_y );
-
-    return wxWindow::Show( show );
+    return wxTopLevelWindowBase::Show(show);
 }
 
 void wxTopLevelWindowGTK::Raise()