x11: Stop reordering visuals

The old code was ordering visuals by depth, but considering that these
days we either use the default visual or a 32bit RGBA visual, that
reordering does not have an effect anymore.

In theory, the only effect is that the GLX Visual selection might select
a different replacement Visual when it checks for improved GL Visuals, but
even there I can't come up with a case where that matters, because
again, the visuals are only reordered by depth and we want to keep the
depth.

In any case, make this a separate commit so bisecting can find this
problem if it ever shows up.
This commit is contained in:
Benjamin Otte 2021-06-03 04:54:37 +02:00
parent 74e01ddec5
commit 5784f8c2f9

View File

@ -65,7 +65,6 @@ _gdk_x11_screen_init_visuals (GdkX11Screen *x11_screen)
XVisualInfo *visual_list;
XVisualInfo visual_template;
GdkX11Visual *temp_visual;
Visual *default_xvisual;
GdkX11Visual **visuals;
int nxvisuals;
@ -142,40 +141,6 @@ _gdk_x11_screen_init_visuals (GdkX11Screen *x11_screen)
if (visual_list)
XFree (visual_list);
for (i = 0; i < nvisuals; i++)
{
for (j = i+1; j < nvisuals; j++)
{
if (visuals[j]->depth >= visuals[i]->depth)
{
if ((visuals[j]->depth == 8) && (visuals[i]->depth == 8))
{
if (visuals[j]->type == GDK_VISUAL_PSEUDO_COLOR)
{
temp_visual = visuals[j];
visuals[j] = visuals[i];
visuals[i] = temp_visual;
}
else if ((visuals[i]->type != GDK_VISUAL_PSEUDO_COLOR) &&
visuals[j]->type > visuals[i]->type)
{
temp_visual = visuals[j];
visuals[j] = visuals[i];
visuals[i] = temp_visual;
}
}
else if ((visuals[j]->depth > visuals[i]->depth) ||
((visuals[j]->depth == visuals[i]->depth) &&
(visuals[j]->type > visuals[i]->type)))
{
temp_visual = visuals[j];
visuals[j] = visuals[i];
visuals[i] = temp_visual;
}
}
}
}
for (i = 0; i < nvisuals; i++)
{
if (default_xvisual->visualid == GDK_X11_VISUAL (visuals[i])->xvisual->visualid)