+} // extern "C"
+
+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);
+
+ if (m_wxwindow &&
+ (IsTopLevel() || HasFlag(wxBORDER_RAISED | wxBORDER_SUNKEN | wxBORDER_THEME)))
+ {
+ // attaching to style changed signal after realization avoids initial
+ // changes we don't care about
+ const gchar *detailed_signal =
+#ifdef __WXGTK3__
+ "style_updated";
+#else
+ "style_set";
+#endif
+ g_signal_connect(m_wxwindow,
+ detailed_signal,
+ G_CALLBACK(style_updated), this);
+ }
+}
+
+// ----------------------------------------------------------------------------
+// this wxWindowBase function is implemented here (in platform-specific file)
+// because it is static and so couldn't be made virtual
+// ----------------------------------------------------------------------------
+
+wxWindow *wxWindowBase::DoFindFocus()
+{
+ // For compatibility with wxMSW, pretend that showing a popup menu doesn't
+ // change the focus and that it remains on the window showing it, even
+ // though the real focus does change in GTK.
+ extern wxMenu *wxCurrentPopupMenu;
+ if ( wxCurrentPopupMenu )
+ return wxCurrentPopupMenu->GetInvokingWindow();
+
+ wxWindowGTK *focus = gs_pendingFocus ? gs_pendingFocus : gs_currentFocus;
+ // the cast is necessary when we compile in wxUniversal mode
+ return static_cast<wxWindow*>(focus);
+}
+
+void wxWindowGTK::AddChildGTK(wxWindowGTK* child)
+{
+ wxASSERT_MSG(m_wxwindow, "Cannot add a child to a window without a client area");
+
+ // the window might have been scrolled already, we
+ // have to adapt the position
+ wxPizza* pizza = WX_PIZZA(m_wxwindow);
+ child->m_x += pizza->m_scroll_x;
+ child->m_y += pizza->m_scroll_y;
+
+ pizza->put(child->m_widget,
+ child->m_x, child->m_y, child->m_width, child->m_height);
+}
+
+//-----------------------------------------------------------------------------