https://bugs.winehq.org/show_bug.cgi?id=35718
--- Comment #111 from Ken Thomases ken@codeweavers.com --- (In reply to Alex Henrie from comment #110)
(In reply to Ken Thomases from comment #23)
This thrashing of the pixel format causes problems with the X11 driver. The X11 driver has to tear down and recreate the drawable each time it changes. This is what causes the flickering and unresponsiveness.
Why does the X11 driver have to destroy and recreate the window just to change the pixel format?
The pixel format dictates the fbconfig. The fbconfig dictates the visual. The visual is a property of the window set at creation.
The fbconfig or visual is also used when creating the GLX rendering context.
When you attempt to make a GLX context current for a drawable, the visual of the context and drawable must match or you get an error.
I have been looking through dlls/winex11.drv/opengl.c and as far as I can tell, set_pixel_format calls set_win_format, which tears down and recreates the X window but does not actually use the pixel format except to set the value of a Wine-specific window struct member.
create_gl_drawable() passes the visual to create_client_window().