Browse Source

add glx_error_abort

David Rose 22 years ago
parent
commit
7bf1df25be

+ 1 - 0
panda/src/glxdisplay/config_glxdisplay.cxx

@@ -56,3 +56,4 @@ init_libglxdisplay() {
 }
 
 const string display_cfg = config_glxdisplay.GetString("display", "");
+const bool glx_error_abort = config_glxdisplay.GetBool("glx-error-abort", false);

+ 1 - 0
panda/src/glxdisplay/config_glxdisplay.h

@@ -27,5 +27,6 @@ NotifyCategoryDecl(glxdisplay, EXPCL_PANDAGL, EXPTP_PANDAGL);
 extern EXPCL_PANDAGL void init_libglxdisplay();
 
 extern const string display_cfg;
+extern const bool glx_error_abort;
 
 #endif /* __CONFIG_GLXDISPLAY_H__ */

+ 4 - 0
panda/src/glxdisplay/glxGraphicsPipe.cxx

@@ -545,6 +545,10 @@ error_handler(Display *display, XErrorEvent *error) {
   glxdisplay_cat.error()
     << msg << "\n";
 
+  if (glx_error_abort) {
+    abort();
+  }
+
   // We return to allow the application to continue running, unlike
   // the default X error handler which exits.
   return 0;