+ win->HandleWindowEvent( event );
+}
+}
+
+//-----------------------------------------------------------------------------
+// emission hook for "parent-set"
+//-----------------------------------------------------------------------------
+
+extern "C" {
+static gboolean
+parent_set_hook(GSignalInvocationHint*, guint, const GValue* param_values, void* data)
+{
+ wxGLCanvas* win = (wxGLCanvas*)data;
+ if (g_value_peek_pointer(¶m_values[0]) == win->m_wxwindow)
+ {
+ const XVisualInfo* xvi = win->GetXVisualInfo();
+ GdkVisual* visual = gtk_widget_get_visual(win->m_wxwindow);
+ if (GDK_VISUAL_XVISUAL(visual)->visualid != xvi->visualid)
+ {
+ GdkScreen* screen = gtk_widget_get_screen(win->m_wxwindow);
+ visual = gdk_x11_screen_lookup_visual(screen, xvi->visualid);
+#ifdef __WXGTK3__
+ gtk_widget_set_visual(win->m_wxwindow, visual);
+#else
+ GdkColormap* colormap = gdk_colormap_new(visual, false);
+ gtk_widget_set_colormap(win->m_wxwindow, colormap);
+ g_object_unref(colormap);
+#endif
+ }
+ // remove hook
+ return false;
+ }
+ return true;