Initialize wxWindowDCImpl::m_window for hidden windows too

Ensure that we set m_window in case of early return from wxWindowDCImpl
ctor, so that using e.g. wxDC::GetSize() works for wxClientDC created
for windows that hadn't been realized yet.

It might be possible to avoid this early return completely as the
comment explaining why we're doing it seems to be out of date: our
SetBackground() doesn't call wxWindow::SetBackground() (and it would be
exceedingly strange if it did), but for now just the bug without
changing anything else.

Closes #18569.
This commit is contained in:
Vadim Zeitlin
2019-11-10 00:35:07 +01:00
parent a5b03ea23c
commit a2ff49eeeb

View File

@@ -314,6 +314,8 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) :
// Don't report problems as per MSW.
m_ok = true;
m_window = window;
return;
}