Commit 5f39a0ef authored by Louai Al-Khanji's avatar Louai Al-Khanji
Browse files

X11: Better support non-32bit visuals


This patch improves support for non-32bit screen configurations on X. The
patch mostly touches the xcb platform plugin but the changes to the glx
convenience functions do affect e.g. the offscreen plugin as well.

Since QWindow instances are now by default of type RasterGL instead of
Raster the majority of all windows are in fact instances of QXcbGlxWindow.
This means that the eventual QSurfaceFormat that we use is chosen based on
the available OpenGL configurations. Here the GLX config resolution code
did not do a very good job in trying to find the closest match relative to
the requested QSurfaceFormat, instead preferring higher bit depths.

This is an issue since many configurations support 32-bit windows even
if the screen itself has a root window with depth 16. In particular,
servers supporting both GLX and Render are very likely to have such
visuals. Particularly affected are remote X connections - even if the
application itself makes no use of OpenGL at all!

The changes introduced by this patch are as follows:
 1. Improve the GLX visual selection logic
 2. Improve the xcb visual selection logic
 3. Remove duplicated visual lookup for OpenGL-enabled windows
 4. Configure the default QSurfaceFormat to match the primary screen depth

Change-Id: Id1c176359e63a4581410e20350db5ac2c083e1cf
Reviewed-by: default avatarLars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: default avatarLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Showing with 366 additions and 290 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment