X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b07d7130880c63b7f7908606a10f885e2719efc..c127177f8dc31dbe99764852b8dbcc047d3ad826:/src/gtk/dcclient.cpp diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index ffd5d9ef15..918e0a52db 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -109,10 +109,23 @@ wxWindowDC::wxWindowDC( wxWindow *window ) m_owner = (wxWindow *)NULL; if (!window) return; + GtkWidget *widget = window->m_wxwindow; if (!widget) return; + m_window = widget->window; + + /* not realized ? */ + if (!m_window) + { + /* force realization */ + gtk_widget_realize( widget ); + m_window = widget->window; + } + + /* still not realized ? */ if (!m_window) return; + if (window->m_wxwindow) m_cmap = gtk_widget_get_colormap( window->m_wxwindow ); else