+ 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);
+ GdkColormap* colormap = gdk_colormap_new(visual, false);
+ gtk_widget_set_colormap(win->m_wxwindow, colormap);
+ g_object_unref(colormap);
+ }
+ // remove hook
+ return false;
+ }
+ return true;