[gtk/misc-inspector-things: 3/3] inspector: Avoid a crash with GL variants




commit ea162ed01612e42766717667f78f5a981a496c3c
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon May 10 21:25:08 2021 -0400

    inspector: Avoid a crash with GL variants
    
    When configuring the inspector display, preserve
    debug flags that affect which GL variant we pick.
    Otherwise, we may end up with a GLX context on the
    default display, and an EGL context on the inspector
    one. This hopelessly confuses libepoxy, and things
    don't go well when that happens.

 gtk/inspector/window.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c
index 1b4560e08e..02b108d882 100644
--- a/gtk/inspector/window.c
+++ b/gtk/inspector/window.c
@@ -697,13 +697,16 @@ get_inspector_display (void)
   if (display)
     {
       const char *name;
+      GdkDebugFlags flags;
 
       name = g_getenv ("GTK_INSPECTOR_RENDERER");
 
       g_object_set_data_full (G_OBJECT (display), "gsk-renderer",
                               g_strdup (name), g_free);
 
-      gdk_display_set_debug_flags (display, 0);
+      flags = gdk_display_get_debug_flags (gdk_display_get_default ());
+
+      gdk_display_set_debug_flags (display, flags & (GDK_DEBUG_GL_GLES | GDK_DEBUG_GL_GLX));
       gtk_set_display_debug_flags (display, 0);
     }
 


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