diff --git a/include/wx/gtk/toplevel.h b/include/wx/gtk/toplevel.h index 8f0ad658b1..2cf22d8e41 100644 --- a/include/wx/gtk/toplevel.h +++ b/include/wx/gtk/toplevel.h @@ -136,6 +136,8 @@ public: void GTKUpdateDecorSize(const DecorSize& decorSize); + void GTKDoAfterShow(); + protected: // give hints to the Window Manager for how the size // of the TLW can be changed by dragging diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index f852c6670c..113da04eaf 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -445,9 +445,7 @@ gtk_frame_map_callback( GtkWidget*, // it is possible for m_isShown to be false here, see bug #9909 if (win->wxWindowBase::Show(true)) { - wxShowEvent eventShow(win->GetId(), true); - eventShow.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(eventShow); + win->GTKDoAfterShow(); } // restore focus-on-map setting in case ShowWithoutActivating() was called @@ -1499,9 +1497,8 @@ void wxTopLevelWindowGTK::GTKUpdateDecorSize(const DecorSize& decorSize) SendSizeEvent(); } #endif - wxShowEvent showEvent(GetId(), true); - showEvent.SetEventObject(this); - HandleWindowEvent(showEvent); + + GTKDoAfterShow(); } #endif // GDK_WINDOWING_X11 } @@ -1523,6 +1520,13 @@ wxTopLevelWindowGTK::DecorSize& wxTopLevelWindowGTK::GetCachedDecorSize() return size[index]; } +void wxTopLevelWindowGTK::GTKDoAfterShow() +{ + wxShowEvent showEvent(GetId(), true); + showEvent.SetEventObject(this); + HandleWindowEvent(showEvent); +} + // ---------------------------------------------------------------------------- // frame title/icon // ----------------------------------------------------------------------------