From 3406bbd1281260013e86f45e03e1dc0c3b1e97cb Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 28 Oct 2014 18:27:41 +0100 Subject: [PATCH] Pick the first rgba visual, not the last The visuals are typically sorted by some sort of "most useful first" order. And picking the last one is likely to give us the weirdest matching glx visual. --- gdk/x11/gdkvisual-x11.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c index a88882fe73..429b7a0a7e 100644 --- a/gdk/x11/gdkvisual-x11.c +++ b/gdk/x11/gdkvisual-x11.c @@ -276,7 +276,8 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen) * Additional formats (like ABGR) could be added later if they * turn up. */ - if (visuals[i]->depth == 32 && + if (x11_screen->rgba_visual == NULL && + visuals[i]->depth == 32 && (visuals[i]->red_mask == 0xff0000 && visuals[i]->green_mask == 0x00ff00 && visuals[i]->blue_mask == 0x0000ff))