Avoid picking worse formats when matching compatible formats

Like we do with fully matching format, pick the first matching one,
instead of the last matching one.

Fixes: QTBUG-72785
Change-Id: I466e0152a229348b6a3786d5464d1f8ab325d67a
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
bb10
Allan Sandfeld Jensen 2019-01-29 15:39:57 +01:00
parent 9501e92841
commit d8d2025f06
1 changed files with 2 additions and 0 deletions

View File

@ -241,6 +241,8 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format
if (requestedAlpha && actualAlpha < requestedAlpha)
continue;
compatibleCandidate = candidate;
if (!compatibleCandidate) // Only pick up the first compatible one offered by the server
compatibleCandidate = candidate;
if (requestedRed && actualRed != requestedRed)
continue;