From 843101f7660e5e4411769c179398fbf172a441ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 19 Oct 2011 16:19:55 +0000 Subject: [PATCH] Send wxEVT_CREATE and do other post-realization initialization even if the widget was realized early. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 04b6e8a983..2c416d0e80 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2407,10 +2407,18 @@ void wxWindowGTK::PostCreation() ConnectWidget( connect_widget ); - /* We cannot set colours, fonts and cursors before the widget has - been realized, so we do this directly after realization */ - g_signal_connect (connect_widget, "realize", - G_CALLBACK (gtk_window_realized_callback), this); + // We cannot set colours, fonts and cursors before the widget has been + // realized, so we do this directly after realization -- unless the widget + // was in fact realized already. + if ( gtk_widget_get_realized(connect_widget) ) + { + gtk_window_realized_callback(connect_widget, this); + } + else + { + g_signal_connect (connect_widget, "realize", + G_CALLBACK (gtk_window_realized_callback), this); + } if (!IsTopLevel()) { -- 2.45.2