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

gEDA-cvs: pcb.git: branch: master updated (e26a2968ba2419a4c55fb68ae9c92f0278322acb)



The branch, master has been updated
       via  e26a2968ba2419a4c55fb68ae9c92f0278322acb (commit)
      from  1ee3dff0de39f0cfbfa91d3643b47ba37215f692 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/hid/gtk/gtkhid-gdk.c     |    5 +++++
 src/hid/gtk/gtkhid-gl.c      |   18 ++++++++++++++++++
 src/hid/gtk/gui-top-window.c |    3 +++
 src/hid/gtk/gui.h            |    1 +
 4 files changed, 27 insertions(+), 0 deletions(-)


=================
 Commit Messages
=================

commit e26a2968ba2419a4c55fb68ae9c92f0278322acb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Fix mesa crash on startup (for some mesa versions)
    
    I'm not sure why it crashed, but it seems that providing a realize
    handler which fiddles with the GL context solves it. The underlying
    problem appears to have been fixed in later mesa versions.
    
    Leaving this commit for the benefit users of broken mesa versions.

:100644 100644 4534905... 882af60... M	src/hid/gtk/gtkhid-gdk.c
:100644 100644 0923110... 16247a8... M	src/hid/gtk/gtkhid-gl.c
:100644 100644 ca82b96... 31be13a... M	src/hid/gtk/gui-top-window.c
:100644 100644 7a18906... 31ee636... M	src/hid/gtk/gui.h

=========
 Changes
=========

commit e26a2968ba2419a4c55fb68ae9c92f0278322acb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Fix mesa crash on startup (for some mesa versions)
    
    I'm not sure why it crashed, but it seems that providing a realize
    handler which fiddles with the GL context solves it. The underlying
    problem appears to have been fixed in later mesa versions.
    
    Leaving this commit for the benefit users of broken mesa versions.

diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 4534905..882af60 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -1130,6 +1130,11 @@ ghid_drawing_area_expose_cb (GtkWidget *widget,
   return FALSE;
 }
 
+void
+ghid_port_drawing_realize_cb (GtkWidget *widget, gpointer data)
+{
+}
+
 gboolean
 ghid_pinout_preview_expose (GtkWidget *widget,
                             GdkEventExpose *ev)
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 0923110..16247a8 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -885,6 +885,24 @@ ghid_drawing_area_expose_cb (GtkWidget *widget,
   return FALSE;
 }
 
+/* This realize callback is used to work around a crash bug in some mesa
+ * versions (observed on a machine running the intel i965 driver. It isn't
+ * obvious why it helps, but somehow fiddling with the GL context here solves
+ * the issue. The problem appears to have been fixed in recent mesa versions.
+ */
+void
+ghid_port_drawing_realize_cb (GtkWidget *widget, gpointer data)
+{
+  GdkGLContext *glcontext = gtk_widget_get_gl_context (widget);
+  GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget);
+
+  if (!gdk_gl_drawable_gl_begin (gldrawable, glcontext))
+    return;
+
+  gdk_gl_drawable_gl_end (gldrawable);
+  return;
+}
+
 gboolean
 ghid_pinout_preview_expose (GtkWidget *widget,
                             GdkEventExpose *ev)
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index ca82b96..31be13a 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -2357,6 +2357,9 @@ ghid_build_pcb_top_window (void)
      |  the user does a command entry.
    */
 
+  g_signal_connect (G_OBJECT (gport->drawing_area), "realize",
+		    G_CALLBACK (ghid_port_drawing_realize_cb),
+		    port);
   g_signal_connect (G_OBJECT (gport->drawing_area), "expose_event",
 		    G_CALLBACK (ghid_drawing_area_expose_cb),
 		    port);
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 7a18906..31ee636 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -496,6 +496,7 @@ void ghid_drawing_area_configure_hook (GHidPort *port);
 void ghid_screen_update (void);
 gboolean ghid_drawing_area_expose_cb (GtkWidget *, GdkEventExpose *,
                                       GHidPort *);
+void ghid_port_drawing_realize_cb (GtkWidget *, gpointer);
 gboolean ghid_pinout_preview_expose (GtkWidget * widget, GdkEventExpose * ev);
 GdkPixmap *ghid_render_pixmap (int cx, int cy, double zoom,
                                int width, int height, int depth);




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs