This may fix a bug where a NULL structure pointer was accessed resulting in:
KERN_PROTECTION_FAILURE at 0x0000000000000004
I studied the structures in use, and I believe it was the pDraw->id that resulted in
this fault in attach().
The layout of the _Drawable structure is 4 chars, and then the id, so the offset
seems correct for such a bug.
Also make it return an error for now, and ErrorF() to help us figure out where it's
going wrong elsewhere to cause a NULL DrawablePtr.
I also made various formatting changes, because the formatting was inconsistent.
Next time I will probably do the formatting in a separate commit, but hindsight is
20/20.
I will apply a fix to the 1.5 branch after this, in a similar manner.
Added a configure option called --enable-standalone-xpbproxy which is useful for deveoping xpbproxy.
The 'active' switch in preferences just disables the in-server xpbproxy (not this standalone).
Use the settings queried from the system in xprScreen.c, rather than those 2 calls.
The 2 calls increased the total number of visuals a great deal (when using GLXEXT),
and not all of the visuals were usable with GLX. Some of the visuals aren't usable
with GLX still, such as DirectColor, but that seems to be acceptable based on my
understanding of the manual that states "a subset of visuals are made available
for OpenGL rendering."
More recent versions of glxcmds.c already do this.
This enables glxinfo to correctly detect the multisampling with output like so
from glxinfo -v:
multiSample=6 multiSampleBuffers=1
GL/capabilities.c: Add handleDepthModes(), and extend
handleRendererDescription() for the various depth and multisampling flags.
Add initialization of the new config options to initConfig().
GL/capabilities.h: Add depth and multisample config members.
GL/visualConfigs.c: Add depth and multisampling support to the visual config
setup.
GL/capabilities.c: #if 0 (for now) any capabilities above 8 bits per channel,
because they introduce drawing problems.
GL/indirect.c: Comment out some visual setup code that shouldn't be running, and
actually seemed to cause some problems. The current visualConfigs.c code seems
to do a reasonable job of setting up visuals for XQuartz.
GL/visualConfigs.c: Make use of the proper visual .class. Eliminate depth 0.
It seems we really just want 24 for now, and 0 I think was a flaw in the original
code.