From 9305b2c07238dea8c62444c79653e9bd119cc8dc Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 27 Apr 2007 18:19:59 +0000 Subject: [PATCH] Backport fix for window being repositioned after hiding, then reshowing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45691 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/toplevel.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 15ed1b7342..91d58f39b1 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -828,13 +828,17 @@ 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 ); + wxTopLevelWindowBase::Show(show); - return wxWindow::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()