glx: Don't match fbconfigs to visuals with mismatched channel masks.
This fixes at least one known bug, where the depth 32 visual would end up with a depth 24 fbconfig attached, angering compiz.
This commit is contained in:
parent
4475ae036c
commit
5100d829a4
|
@ -394,14 +394,20 @@ typedef struct {
|
||||||
} FBConfigTemplateRec, *FBConfigTemplatePtr;
|
} FBConfigTemplateRec, *FBConfigTemplatePtr;
|
||||||
|
|
||||||
static __GLXconfig *
|
static __GLXconfig *
|
||||||
pickFBConfig(__GLXscreen *pGlxScreen, FBConfigTemplatePtr template, int class)
|
pickFBConfig(__GLXscreen *pGlxScreen, FBConfigTemplatePtr template,
|
||||||
|
VisualPtr visual)
|
||||||
{
|
{
|
||||||
__GLXconfig *config;
|
__GLXconfig *config;
|
||||||
|
|
||||||
for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) {
|
for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) {
|
||||||
|
if (config->redMask != visual->redMask ||
|
||||||
|
config->greenMask != visual->greenMask ||
|
||||||
|
config->blueMask != visual->blueMask ||
|
||||||
|
config->rgbBits != visual->nplanes)
|
||||||
|
continue;
|
||||||
if (config->visualRating != GLX_NONE)
|
if (config->visualRating != GLX_NONE)
|
||||||
continue;
|
continue;
|
||||||
if (glxConvertToXVisualType(config->visualType) != class)
|
if (glxConvertToXVisualType(config->visualType) != visual->class)
|
||||||
continue;
|
continue;
|
||||||
if ((config->doubleBufferMode > 0) != template->doubleBuffer)
|
if ((config->doubleBufferMode > 0) != template->doubleBuffer)
|
||||||
continue;
|
continue;
|
||||||
|
@ -436,11 +442,11 @@ addMinimalSet(__GLXscreen *pGlxScreen)
|
||||||
visuals = pGlxScreen->pScreen->visuals;
|
visuals = pGlxScreen->pScreen->visuals;
|
||||||
for (i = 0, j = 0; i < pGlxScreen->pScreen->numVisuals; i++) {
|
for (i = 0, j = 0; i < pGlxScreen->pScreen->numVisuals; i++) {
|
||||||
if (visuals[i].nplanes == 32)
|
if (visuals[i].nplanes == 32)
|
||||||
config = pickFBConfig(pGlxScreen, &minimal, visuals[i].class);
|
config = pickFBConfig(pGlxScreen, &minimal, &visuals[i]);
|
||||||
else {
|
else {
|
||||||
config = pickFBConfig(pGlxScreen, &best, visuals[i].class);
|
config = pickFBConfig(pGlxScreen, &best, &visuals[i]);
|
||||||
if (config == NULL)
|
if (config == NULL)
|
||||||
config = pickFBConfig(pGlxScreen, &good, visuals[i].class);
|
config = pickFBConfig(pGlxScreen, &good, &visuals[i]);
|
||||||
}
|
}
|
||||||
if (config == NULL)
|
if (config == NULL)
|
||||||
config = pGlxScreen->fbconfigs;
|
config = pGlxScreen->fbconfigs;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user