- GdkVisual *visual = gdkx_visual_get( vi->visualid );
- GdkColormap *colormap = gdk_colormap_new( visual, TRUE );
+ GdkVisual *visual;
+ GdkColormap *colormap;
+
+ // MR: This needs a fix for lower gtk+ versions too. Might need to rethink logic (FIXME)
+#if defined(__WXGTK20__) && GTK_CHECK_VERSION(2,2,0)
+ if (!gtk_check_version(2,2,0))
+ {
+ wxWindow::Create( parent, id, pos, size, style, name );
+
+ m_glWidget = m_wxwindow;
+
+ GdkScreen *screen = gtk_widget_get_screen( m_glWidget );
+ colormap = gdk_screen_get_default_colormap(screen);
+ visual = gdk_colormap_get_visual(colormap);
+
+ if (GDK_VISUAL_XVISUAL(visual)->visualid != vi->visualid)
+ {
+ visual = gdk_x11_screen_lookup_visual( screen, vi->visualid );
+ colormap = gdk_colormap_new(visual, FALSE);
+ }