[gtk/wip/otte/gleanup: 33/73] x11: Move function call




commit 3115e9e216f4aceeed8d62c8235df03478310da0
Author: Benjamin Otte <otte redhat com>
Date:   Sun Jun 6 17:18:16 2021 +0200

    x11: Move function call
    
    The GLX visual selection is GLX specific, so it can be handled by the GLX
    code.
    
    There should be no reordering here, the call was just moved.

 gdk/x11/gdkdisplay-x11.c   | 1 -
 gdk/x11/gdkglcontext-glx.c | 7 +++----
 gdk/x11/gdkglcontext-x11.h | 1 -
 3 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index a1fe68e230..156872a362 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1430,7 +1430,6 @@ gdk_x11_display_open (const char *display_name)
    * stereo and double buffering
    */
   gdk_x11_display_init_gl (display_x11);
-  gdk_x11_screen_update_visuals_for_glx (display_x11->screen);
 
   if (display_x11->screen->rgba_visual)
     {
diff --git a/gdk/x11/gdkglcontext-glx.c b/gdk/x11/gdkglcontext-glx.c
index a6306c6ed1..bc6d66a7e5 100644
--- a/gdk/x11/gdkglcontext-glx.c
+++ b/gdk/x11/gdkglcontext-glx.c
@@ -1005,7 +1005,7 @@ save_cached_gl_visual (GdkDisplay *display, VisualID visual)
   gdk_x11_display_error_trap_pop_ignored (display);
 }
 
-void
+static void
 gdk_x11_screen_update_visuals_for_glx (GdkX11Screen *x11_screen)
 {
   GdkDisplay *display;
@@ -1019,9 +1019,6 @@ gdk_x11_screen_update_visuals_for_glx (GdkX11Screen *x11_screen)
   display_x11 = GDK_X11_DISPLAY (display);
   dpy = gdk_x11_display_get_xdisplay (display);
 
-  if (!display_x11->have_glx)
-    return;
-
   /* We save the default visuals as a property on the root window to avoid
      having to initialize GL each time, as it may not be used later. */
   rgba_visual_id = get_cached_gl_visual (display);
@@ -1322,5 +1319,7 @@ gdk_x11_screen_init_glx (GdkX11Screen *screen)
                      display_x11->has_glx_multisample ? "yes" : "no",
                      display_x11->has_glx_visual_rating ? "yes" : "no"));
 
+  gdk_x11_screen_update_visuals_for_glx (display_x11->screen);
+
   return TRUE;
 }
diff --git a/gdk/x11/gdkglcontext-x11.h b/gdk/x11/gdkglcontext-x11.h
index 991c361cc5..eaba65df2a 100644
--- a/gdk/x11/gdkglcontext-x11.h
+++ b/gdk/x11/gdkglcontext-x11.h
@@ -75,7 +75,6 @@ gboolean        gdk_x11_display_make_gl_context_current (GdkDisplay    *display,
 typedef struct _GdkX11GLContextGLX      GdkX11GLContextGLX;
 
 gboolean                gdk_x11_screen_init_glx                 (GdkX11Screen  *screen);
-void                    gdk_x11_screen_update_visuals_for_glx   (GdkX11Screen  *screen);
 
 GType                   gdk_x11_gl_context_glx_get_type         (void) G_GNUC_CONST;
 GdkX11GLContext *       gdk_x11_gl_context_glx_new              (GdkSurface    *surface,


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