X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/08f53168acef5006826b22c11fe562432193d854..35bb3cb155917b4287fb2a3841bea22919a3d499:/src/gtk/toplevel.cpp?ds=inline diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 7ad3b37a46..2aa4cc4e5a 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -366,13 +366,25 @@ gtk_frame_map_callback( GtkWidget* widget, win->m_width = rect.width; win->m_height = rect.height; decorSize = size; - wxSizeEvent event(win->GetSize(), win->GetId()); - event.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event); } } + const bool wasIconized = win->IsIconized(); + win->SetIconizeState(false); + + if (wasIconized) + { + // Because GetClientSize() returns (0,0) when IsIconized() is true, + // a size event must be generated, just in case GetClientSize() was + // called while iconized. This specifically happens when restoring a + // tlw that was "rolled up" with some WMs. + // Queue a resize rather than sending size event directly to allow + // children to be made visible first. + win->m_oldClientWidth = 0; + gtk_widget_queue_resize(win->m_wxwindow); + } + return false; } } @@ -430,9 +442,8 @@ static gboolean property_notify_event( if (win->m_width < 0) win->m_width = 0; if (win->m_height < 0) win->m_height = 0; decorSize = size; - wxSizeEvent event(win->GetSize(), win->GetId()); - event.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event); + win->m_oldClientWidth = 0; + gtk_widget_queue_resize(win->m_wxwindow); } } if (data) @@ -829,10 +840,6 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si { wxCHECK_RET( m_widget, wxT("invalid frame") ); - // this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow - wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") ); - - // deal with the position first int old_x = m_x; int old_y = m_y;