Factor out wxTopLevelWindowGTK::GTKDoAfterShow()

Just extract the code generating wxEVT_SHOW for TLWs in wxGTK in its own
function before modifying it to avoid having to do it in two places.

No real changes, this is a pure refactoring.
This commit is contained in:
Vadim Zeitlin
2021-04-12 17:27:34 +02:00
parent ed23b47695
commit 329f60d7f3
2 changed files with 12 additions and 6 deletions

View File

@@ -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

View File

@@ -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
// ----------------------------------------------------------------------------