+void wxWindowGTK::GTKHandleRealized()
+{
+ if (m_imData)
+ {
+ gtk_im_context_set_client_window
+ (
+ m_imData->context,
+ m_wxwindow ? GTKGetDrawingWindow()
+ : gtk_widget_get_window(m_widget)
+ );
+ }
+
+ // Use composited window if background is transparent, if supported.
+ if (m_backgroundStyle == wxBG_STYLE_TRANSPARENT)
+ {
+#if wxGTK_HAS_COMPOSITING_SUPPORT
+ if (IsTransparentBackgroundSupported())
+ {
+ GdkWindow* const window = GTKGetDrawingWindow();
+ if (window)
+ gdk_window_set_composited(window, true);
+ }
+ else
+#endif // wxGTK_HAS_COMPOSITING_SUPPORT
+ {
+ // We revert to erase mode if transparency is not supported
+ m_backgroundStyle = wxBG_STYLE_ERASE;
+ }
+ }
+
+
+ // We cannot set colours and fonts before the widget
+ // been realized, so we do this directly after realization
+ // or otherwise in idle time
+
+ if (m_needsStyleChange)
+ {
+ SetBackgroundStyle(GetBackgroundStyle());
+ m_needsStyleChange = false;
+ }
+
+ wxWindowCreateEvent event(static_cast<wxWindow*>(this));
+ event.SetEventObject( this );
+ GTKProcessEvent( event );
+
+ GTKUpdateCursor(true, false);
+}
+