From: Benjamin Otte Date: Thu, 3 Jun 2021 03:02:15 +0000 (+0200) Subject: x11: Reorder code X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~3^2~9^2~48 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7d32ec51e7c3cda1771ef85855b70dca4a50c52a;p=gtk4.git x11: Reorder code Initialize the GL visuals from gdkdisplay.c so the call into the GL stack isn't hidden in gdkvisual.c This is relevant for further commits. --- diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index e181ddd413..707abe491f 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -1402,6 +1402,12 @@ gdk_x11_display_open (const char *display_name) /* initialize the display's screens */ display_x11->screen = _gdk_x11_screen_new (display, DefaultScreen (display_x11->xdisplay)); + /* If GL is available we want to pick better default/rgba visuals, + * as we care about GLX details such as alpha/depth/stencil depth, + * stereo and double buffering + */ + gdk_x11_screen_update_visuals_for_glx (display_x11->screen); + if (display_x11->screen->rgba_visual) { Visual *xvisual = GDK_X11_VISUAL (display_x11->screen->rgba_visual)->xvisual; diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c index ceeaec47c8..c97913ad1f 100644 --- a/gdk/x11/gdkvisual-x11.c +++ b/gdk/x11/gdkvisual-x11.c @@ -212,12 +212,6 @@ _gdk_x11_screen_init_visuals (GdkX11Screen *x11_screen) x11_screen->visuals = visuals; x11_screen->nvisuals = nvisuals; - - /* If GL is available we want to pick better default/rgba visuals, - * as we care about GLX details such as alpha/depth/stencil depth, - * stereo and double buffering - */ - gdk_x11_screen_update_visuals_for_glx (x11_screen); } /*< private >