From 89e5663a75a7792c38622e94d823d13c91cae4fb Mon Sep 17 00:00:00 2001 From: phowstan <46815312+phowstan@users.noreply.github.com> Date: Tue, 29 Jan 2019 15:08:32 +0000 Subject: [PATCH] Handle calling wxWindow::Hide() before Create() in wxQt Hide the window explicitly once it's created. This is not very useful, as the real purpose of calling Hide() before Create() is to prevent the window from being initially shown at all to avoid flicker, but better than not hiding it at all. Closes https://github.com/wxWidgets/wxWidgets/pull/1203 --- src/qt/window.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qt/window.cpp b/src/qt/window.cpp index c4011e0ce1..0ca75db5a3 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -367,6 +367,11 @@ void wxWindowQt::PostCreation(bool generic) GetHandle()->setFont( wxWindowBase::GetFont().GetHandle() ); + // The window might have been hidden before Create() and it needs to remain + // hidden in this case, so do it (unfortunately there doesn't seem to be + // any way to create the window initially hidden with Qt). + GetHandle()->setVisible(m_isShown); + wxWindowCreateEvent event(this); HandleWindowEvent(event); }