From d26cb76b58d53bdd667e706f12442c349ff13bc1 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 23 Mar 2010 17:58:03 +0000 Subject: [PATCH] better fix for #11803, don't set iconized state for hidden window git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/toplevel.h | 1 - src/gtk/toplevel.cpp | 15 +++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/include/wx/gtk/toplevel.h b/include/wx/gtk/toplevel.h index 40129f5def..12894ce7be 100644 --- a/include/wx/gtk/toplevel.h +++ b/include/wx/gtk/toplevel.h @@ -138,7 +138,6 @@ protected: virtual void DoSetClientSize(int width, int height); virtual void DoGetClientSize(int *width, int *height) const; - virtual wxSize DoGetBestSize() const; // string shown in the title bar wxString m_title; diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 81c5430f1e..5a77576b0a 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -381,7 +381,9 @@ gtk_frame_unmap_callback( GtkWidget * WXUNUSED(widget), GdkEvent * WXUNUSED(event), wxTopLevelWindow *win ) { - win->SetIconizeState(true); + // hiding the window doesn't count as minimizing it + if (win->IsShown()) + win->SetIconizeState(true); return false; } } @@ -1012,17 +1014,6 @@ void wxTopLevelWindowGTK::DoSetClientSize(int width, int height) m_deferShowAllowed = false; } -wxSize wxTopLevelWindowGTK::DoGetBestSize() const -{ - // temporarily turn off m_isIconized, - // so we get an accurate client size from DoGetClientSize - const bool save = m_isIconized; - const_cast(this)->m_isIconized = false; - const wxSize size = base_type::DoGetBestSize(); - const_cast(this)->m_isIconized = save; - return size; -} - void wxTopLevelWindowGTK::DoGetClientSize( int *width, int *height ) const { wxASSERT_MSG(m_widget, wxT("invalid frame")); -- 2.45.2