]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/glcanvas.cpp
fixed crash in wxRegion::Empty
[wxWidgets.git] / src / gtk / glcanvas.cpp
index 01f39b67b22de0370e86da2dc75ef5ed2d122bd9..a5ee3aa6bdbaacf9985b86583e8dedeb2079ec37 100644 (file)
@@ -297,13 +297,12 @@ bool wxGLCanvas::Create( wxWindow *parent,
         // default settings if attriblist = 0
         data[0] = GLX_RGBA;
         data[1] = GLX_DOUBLEBUFFER;
-        data[2] = GLX_DOUBLEBUFFER;
-        data[3] = GLX_DEPTH_SIZE;   data[4] = 1;
-        data[5] = GLX_RED_SIZE;     data[6] = 1;
-        data[7] = GLX_GREEN_SIZE;   data[8] = 1;
-        data[9] = GLX_BLUE_SIZE;    data[10] = 1;
-        data[11] = GLX_ALPHA_SIZE;  data[12] = 0;
-        data[13] = None;
+        data[2] = GLX_DEPTH_SIZE;   data[3] = 1;
+        data[4] = GLX_RED_SIZE;     data[5] = 1;
+        data[6] = GLX_GREEN_SIZE;   data[7] = 1;
+        data[8] = GLX_BLUE_SIZE;    data[9] = 1;
+        data[10] = GLX_ALPHA_SIZE;  data[11] = 0;
+        data[12] = None;
 
        attribList = (int*) data;
     }
@@ -392,6 +391,12 @@ bool wxGLCanvas::Create( wxWindow *parent,
     gtk_widget_pop_visual();
     gtk_widget_pop_colormap();
     
+    if (GTK_WIDGET_REALIZED(m_wxwindow))
+        gtk_glwindow_realized_callback( m_wxwindow, this );
+    
+    if (GTK_WIDGET_MAPPED(m_wxwindow))
+        gtk_glwindow_map_callback( m_wxwindow, this );
+    
     return TRUE;
 }