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.
This commit is contained in:
Alexander Larsson
2014-10-28 18:27:41 +01:00
parent 8d6d6dcca3
commit 3406bbd128

View File

@ -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))