g_object_set_data(G_OBJECT(widget), "glcontext", context);
- /* Fix up colormap */
+ /* Fix up visual/colormap */
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkVisual *visual = gdk_x11_screen_lookup_visual(screen, xvinfo->visualid);
+ gtk_widget_set_visual(widget, visual);
+#else
GdkVisual *visual = gdk_x11_screen_lookup_visual(screen, xvinfo->visualid);
GdkColormap *cmap = gdk_colormap_new(visual, FALSE);
gtk_widget_set_colormap(widget, cmap);
g_object_unref(cmap);
+#endif
XFree(xvinfo);
/* Disable GTK double buffering */
GtkAllocation alloc;
gdk_window_ensure_native(gtk_widget_get_window(widget));
gtk_widget_get_allocation(widget, &alloc);
+ gtk_widget_translate_coordinates(widget, gtk_widget_get_toplevel(widget),
+ 0, 0, &alloc.x, &alloc.y);
NSOpenGLContext *ctx = g_object_get_data(G_OBJECT(widget), "glcontext");
GdkWindow *win = gtk_widget_get_window(widget);
[ctx makeCurrentContext];
[ctx update];
[view setFrame:rect];
+ [view setWantsBestResolutionOpenGLSurface:YES];
}
void gtk_gl_end(GtkWidget *widget)