]> Pileus Git - grits/commitdiff
Avoid executing "configure" until after realize
authorAndy Spencer <andy753421@gmail.com>
Thu, 18 Nov 2010 07:07:54 +0000 (07:07 +0000)
committerAndy Spencer <andy753421@gmail.com>
Thu, 18 Nov 2010 07:07:54 +0000 (07:07 +0000)
This is a hack, a better solution is in 0.5.x.

This fixes a bug when using Mesa.

src/gis-opengl.c

index ecbf47a4c140fa457de449051e88eb39696ceb00..9deb0064db89ea9caf7a2ef988f078e9c5c22c37 100644 (file)
@@ -381,6 +381,10 @@ static gboolean on_configure(GisOpenGL *opengl, GdkEventConfigure *event, gpoint
 {
        g_debug("GisOpenGL: on_configure");
 
+       /* wait for "realize" */
+       if (!gdk_gl_context_get_current())
+               return FALSE;
+
        double width  = GTK_WIDGET(opengl)->allocation.width;
        double height = GTK_WIDGET(opengl)->allocation.height;