Partial workaround for stale styling information with GTK3
We can trigger size events when we know the style cache has been updated. See #16088
This commit is contained in:
@@ -1020,9 +1020,7 @@ bool wxTopLevelWindowGTK::Show( bool show )
|
||||
// size_allocate signals occur in reverse order (bottom to top).
|
||||
// Things work better if the initial wxSizeEvents are sent (from the
|
||||
// top down), before the initial size_allocate signals occur.
|
||||
wxSizeEvent event(GetSize(), GetId());
|
||||
event.SetEventObject(this);
|
||||
HandleWindowEvent(event);
|
||||
SendSizeEvent();
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
GTKSizeRevalidate();
|
||||
@@ -1031,6 +1029,14 @@ bool wxTopLevelWindowGTK::Show( bool show )
|
||||
|
||||
bool change = base_type::Show(show);
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
if (m_needSizeEvent)
|
||||
{
|
||||
m_needSizeEvent = false;
|
||||
SendSizeEvent();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (change && !show)
|
||||
{
|
||||
// make sure window has a non-default position, so when it is shown
|
||||
@@ -1325,15 +1331,20 @@ void wxTopLevelWindowGTK::GTKUpdateDecorSize(const DecorSize& decorSize)
|
||||
// gtk_widget_show() was deferred, do it now
|
||||
m_deferShow = false;
|
||||
DoGetClientSize(&m_clientWidth, &m_clientHeight);
|
||||
wxSizeEvent sizeEvent(GetSize(), GetId());
|
||||
sizeEvent.SetEventObject(this);
|
||||
HandleWindowEvent(sizeEvent);
|
||||
SendSizeEvent();
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
GTKSizeRevalidate();
|
||||
#endif
|
||||
gtk_widget_show(m_widget);
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
if (m_needSizeEvent)
|
||||
{
|
||||
m_needSizeEvent = false;
|
||||
SendSizeEvent();
|
||||
}
|
||||
#endif
|
||||
wxShowEvent showEvent(GetId(), true);
|
||||
showEvent.SetEventObject(this);
|
||||
HandleWindowEvent(showEvent);
|
||||
|
||||
Reference in New Issue
Block a user