[gtk/wip/otte/gleanup] xxx: Move get_display() into own struct



commit 9133c6b70f8990ea02c7ba0169de090dad187d9a
Author: Benjamin Otte <otte redhat com>
Date:   Fri Jun 11 04:51:24 2021 +0200

    xxx: Move get_display() into own struct

 gdk/x11/gdkglcontext-egl.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gdk/x11/gdkglcontext-egl.c b/gdk/x11/gdkglcontext-egl.c
index 9a86864124..0b29b9e529 100644
--- a/gdk/x11/gdkglcontext-egl.c
+++ b/gdk/x11/gdkglcontext-egl.c
@@ -526,12 +526,20 @@ gdk_x11_display_init_egl (GdkX11Display *display_x11)
   if (!epoxy_has_egl ())
     return FALSE;
 
+  display_x11->have_egl = TRUE;
+
   edpy = gdk_x11_display_get_egl_display (display);
   if (edpy == NULL)
-    return FALSE;
+    {
+      display_x11->have_egl = FALSE;
+      return FALSE;
+    }
 
   if (!eglInitialize (edpy, &major, &minor))
-    return FALSE;
+    {
+      display_x11->have_egl = FALSE;
+      return FALSE;
+    }
 
   /* While NVIDIA might support EGL, it might very well not support
    * all the EGL subset we rely on; we should be looking at more
@@ -542,10 +550,10 @@ gdk_x11_display_init_egl (GdkX11Display *display_x11)
   if (strstr (vendor, "NVIDIA") != NULL)
     {
       eglTerminate (edpy);
+      display_x11->have_egl = FALSE;
       return FALSE;
     }
 
-  display_x11->have_egl = TRUE;
   display_x11->egl_version = epoxy_egl_version (dpy);
 
   display_x11->has_egl_khr_create_context =


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