[grits/v0.4.x: 3/7] Avoid executing "configure" until after realize



commit dd793d5eb5f129d28a6177e8425f9afcc9a724b6
Author: Andy Spencer <andy753421 gmail com>
Date:   Thu Nov 18 07:07:54 2010 +0000

    Avoid executing "configure" until after realize
    
    This is a hack, a better solution is in 0.5.x.
    
    This fixes a bug when using Mesa.

 src/gis-opengl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gis-opengl.c b/src/gis-opengl.c
index ecbf47a..9deb006 100644
--- a/src/gis-opengl.c
+++ b/src/gis-opengl.c
@@ -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;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]