xserver: Branch 'master' - 8 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Wed Oct 8 18:45:26 PDT 2008


 hw/xquartz/GL/Makefile.am       |    8 +
 hw/xquartz/GL/capabilities.c    |  108 ++++++++++++++++++++++++++
 hw/xquartz/GL/capabilities.h    |   37 ++++++++
 hw/xquartz/GL/visualConfigs.c   |  166 ++++++++++++++++++++++++++++++++++++++++
 hw/xquartz/GL/visualConfigs.h   |   28 ++++++
 hw/xquartz/X11Application.h     |    1 
 hw/xquartz/X11Application.m     |   10 --
 hw/xquartz/X11Controller.m      |    6 -
 hw/xquartz/darwin.c             |    8 +
 hw/xquartz/darwinEvents.c       |   11 --
 hw/xquartz/pbproxy/Makefile.am  |    2 
 hw/xquartz/quartz.c             |  118 +++++++++++++++++++++-------
 hw/xquartz/quartz.h             |    3 
 hw/xquartz/quartzCommon.h       |    1 
 miext/rootless/rootlessCommon.h |   12 ++
 miext/rootless/rootlessScreen.c |   43 ++++++++++
 miext/rootless/rootlessWindow.c |  102 ++++++++++++++++++++++++
 17 files changed, 611 insertions(+), 53 deletions(-)

New commits:
commit d13c3cbd43bc5e6b459c7df822292cf02ad2c9c4
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Oct 8 18:39:41 2008 -0700

    XQuartz: Some motion made towards supporting fullscreen.
    (cherry picked from commit 99be3d68b64059caada739a373e5e01844c776e0)

diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h
index 0caaba8..4335abc 100644
--- a/hw/xquartz/X11Application.h
+++ b/hw/xquartz/X11Application.h
@@ -81,6 +81,7 @@ extern int quartzHasRoot, quartzEnableRootless;
 #define PREFS_FAKEBUTTONS           "enable_fake_buttons"
 #define PREFS_SYSBEEP               "enable_system_beep"
 #define PREFS_KEYEQUIVS             "enable_key_equivalents"
+#define PREFS_FULLSCREEN_HOTKEYS    "fullscreen_hotkeys"
 #define PREFS_SYNC_KEYMAP           "sync_keymap"
 #define PREFS_DEPTH                 "depth"
 #define PREFS_NO_AUTH               "no_auth"
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index f120af0..2d3fa7c 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -625,16 +625,12 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
 	
     quartzUseSysBeep = [self prefs_get_boolean:@PREFS_SYSBEEP
                         default:quartzUseSysBeep];
-
-    // TODO: Add fullscreen support
-    //quartzEnableRootless = [self prefs_get_boolean:@PREFS_ROOTLESS
-    //                    default:quartzEnableRootless];
-#ifdef DARWIN_DDX_MISSING
+#if 0
+    quartzEnableRootless = [self prefs_get_boolean:@PREFS_ROOTLESS
+                        default:quartzEnableRootless];
     quartzFullscreenDisableHotkeys = ![self prefs_get_boolean:
 					      @PREFS_FULLSCREEN_HOTKEYS default:
 					      !quartzFullscreenDisableHotkeys];
-    quartzXpluginOptions = [self prefs_get_integer:@PREFS_XP_OPTIONS
-                            default:quartzXpluginOptions];
 #endif
     darwinFakeButtons = [self prefs_get_boolean:@PREFS_FAKEBUTTONS
                          default:darwinFakeButtons];
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index 2482c05..8513386 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -595,10 +595,8 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
 - (IBAction) enable_fullscreen_changed:sender
 {
   int value = ![enable_fullscreen intValue];
-	
-#ifdef DARWIN_DDX_MISSING
+
   DarwinSendDDXEvent(kXquartzSetRootless, 1, value);
-#endif
 	
   [NSApp prefs_set_boolean:@PREFS_ROOTLESS value:value];
   [NSApp prefs_synchronize];
@@ -606,9 +604,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
 
 - (IBAction) toggle_fullscreen:sender
 {
-#ifdef DARWIN_DDX_MISSING
   DarwinSendDDXEvent(kXquartzToggleFullscreen, 0);
-#endif
 }
 
 - (void) set_can_quit:(OSX_BOOL)state
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index c31dffd..89e73c4 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -231,27 +231,20 @@ static void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, in
                 
             case kXquartzToggleFullscreen:
                 DEBUG_LOG("kXquartzToggleFullscreen\n");
-#ifdef DARWIN_DDX_MISSING
                 if (quartzEnableRootless) 
                     QuartzSetFullscreen(!quartzHasRoot);
                 else if (quartzHasRoot)
                     QuartzHide();
                 else
-                    QuartzShow();
-#else
-                //      ErrorF("kXquartzToggleFullscreen not implemented\n");               
-#endif
+                    QuartzShow(xe[i].u.keyButtonPointer.rootX,
+                               xe[i].u.keyButtonPointer.rootY);
                 break;
                 
             case kXquartzSetRootless:
                 DEBUG_LOG("kXquartzSetRootless\n");
-#ifdef DARWIN_DDX_MISSING
                 QuartzSetRootless(xe[i].u.clientMessage.u.l.longs0);
                 if (!quartzEnableRootless && !quartzHasRoot)
                     QuartzHide();
-#else
-                //      ErrorF("kXquartzSetRootless not implemented\n");                    
-#endif
                 break;
                 
             case kXquartzSetRootClip:
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 616c2b0..6d1846b 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -61,6 +61,9 @@
 #include <fcntl.h>
 #include <IOKit/pwr_mgt/IOPMLib.h>
 
+#include <rootlessCommon.h>
+#include <Xplugin.h>
+
 #define FAKE_RANDR 1
 
 // Shared global variables for Quartz modes
@@ -76,6 +79,7 @@ DevPrivateKey           quartzScreenKey = &quartzScreenKeyIndex;
 int                     aquaMenuBarHeight = 0;
 QuartzModeProcsPtr      quartzProcs = NULL;
 const char             *quartzOpenGLBundle = NULL;
+int                     quartzFullscreenDisableHotkeys = TRUE;
 
 #if defined(RANDR) && !defined(FAKE_RANDR)
 Bool QuartzRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) {
@@ -228,33 +232,27 @@ RREditConnectionInfo (ScreenPtr pScreen)
 }
 #endif
 
-/*
- * QuartzDisplayChangeHandler
- *  Adjust for screen arrangement changes.
- */
-void QuartzDisplayChangedHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents)
-{
+static void QuartzUpdateScreens(void) {
     ScreenPtr pScreen;
     WindowPtr pRoot;
     int x, y, width, height, sx, sy;
     xEvent e;
-
-    DEBUG_LOG("QuartzDisplayChangedHandler(): noPseudoramiXExtension=%d, screenInfo.numScreens=%d\n", noPseudoramiXExtension, screenInfo.numScreens);
+    
     if (noPseudoramiXExtension || screenInfo.numScreens != 1)
     {
         /* FIXME: if not using Xinerama, we have multiple screens, and
-           to do this properly may need to add or remove screens. Which
-           isn't possible. So don't do anything. Another reason why
-           we default to running with Xinerama. */
-
+         to do this properly may need to add or remove screens. Which
+         isn't possible. So don't do anything. Another reason why
+         we default to running with Xinerama. */
+        
         return;
     }
-
+    
     pScreen = screenInfo.screens[0];
-
+    
     PseudoramiXResetScreens();
     quartzProcs->AddPseudoramiXScreens(&x, &y, &width, &height);
-
+    
     dixScreenOrigins[pScreen->myNum].x = x;
     dixScreenOrigins[pScreen->myNum].y = y;
     pScreen->mmWidth = pScreen->mmWidth * ((double) width / pScreen->width);
@@ -266,21 +264,20 @@ void QuartzDisplayChangedHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev,
     if(!QuartzRandRInit(pScreen))
         FatalError("Failed to init RandR extension.\n");
 #endif
-
+    
     DarwinAdjustScreenOrigins(&screenInfo);
     quartzProcs->UpdateScreen(pScreen);
-
+    
     sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
     sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
-
+    
     /* Adjust the root window. */
     pRoot = WindowTable[pScreen->myNum];
     AppleWMSetScreenOrigin(pRoot);
     pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL);
     miPaintWindow(pRoot, &pRoot->borderClip,  PW_BACKGROUND);
-//    QuartzIgnoreNextWarpCursor();
     DefineInitialRootWindow(pRoot);
-
+    
     /* Send an event for the root reconfigure */
     e.u.u.type = ConfigureNotify;
     e.u.configureNotify.window = pRoot->drawable.id;
@@ -292,12 +289,71 @@ void QuartzDisplayChangedHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev,
     e.u.configureNotify.borderWidth = wBorderWidth(pRoot);
     e.u.configureNotify.override = pRoot->overrideRedirect;
     DeliverEvents(pRoot, &e, 1, NullWindow);
-
+    
 #ifdef FAKE_RANDR
     RREditConnectionInfo(pScreen);
-#endif
+#endif    
 }
 
+/*
+ * QuartzDisplayChangeHandler
+ *  Adjust for screen arrangement changes.
+ */
+void QuartzDisplayChangedHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) {
+    QuartzUpdateScreens();
+}
+
+void QuartzSetFullscreen(Bool state) {
+    if(quartzHasRoot == state)
+        return;
+    
+    quartzHasRoot = state;
+    
+    xp_disable_update ();
+    
+    if (!quartzHasRoot && !quartzEnableRootless)
+        RootlessHideAllWindows();
+    
+    RootlessUpdateRooted(quartzHasRoot);
+    
+    if (quartzHasRoot && !quartzEnableRootless)
+        RootlessShowAllWindows ();
+    
+    /* Only update screen info when something is visible. Avoids the wm
+     * moving the windows out from under the menubar when it shouldn't
+     */
+    if (quartzHasRoot || quartzEnableRootless)
+        QuartzUpdateScreens();
+    
+    /* Somehow the menubar manages to interfere with our event stream
+     * in fullscreen mode, even though it's not visible. 
+     */
+    
+    X11ApplicationShowHideMenubar(!quartzHasRoot);
+    
+    xp_reenable_update ();
+    
+    if (quartzFullscreenDisableHotkeys)
+        xp_disable_hot_keys(quartzHasRoot);
+}
+
+void QuartzSetRootless(Bool state) {
+    if(quartzEnableRootless == state)
+        return;
+    
+    quartzEnableRootless = state;
+    
+    if (!quartzEnableRootless && !quartzHasRoot) {
+        xp_disable_update();
+        RootlessHideAllWindows();
+        xp_reenable_update();
+    } else if (quartzEnableRootless && !quartzHasRoot) {
+        xp_disable_update();
+        RootlessShowAllWindows();
+        QuartzUpdateScreens();
+        xp_reenable_update();
+    }
+}
 
 /*
  * QuartzShow
@@ -311,14 +367,18 @@ void QuartzShow(
 {
     int i;
 
-    if (!quartzServerVisible) {
-        quartzServerVisible = TRUE;
-        for (i = 0; i < screenInfo.numScreens; i++) {
-            if (screenInfo.screens[i]) {
-                quartzProcs->ResumeScreen(screenInfo.screens[i], x, y);
-            }
+    if (quartzServerVisible)
+        return;
+    
+    quartzServerVisible = TRUE;
+    for (i = 0; i < screenInfo.numScreens; i++) {
+        if (screenInfo.screens[i]) {
+            quartzProcs->ResumeScreen(screenInfo.screens[i], x, y);
         }
     }
+    
+    if (!quartzEnableRootless)
+        QuartzSetFullscreen(TRUE);
 }
 
 
@@ -339,6 +399,8 @@ void QuartzHide(void)
             }
         }
     }
+    
+    QuartzSetFullscreen(FALSE);
     quartzServerVisible = FALSE;
 }
 
diff --git a/hw/xquartz/quartz.h b/hw/xquartz/quartz.h
index 1b6d71f..8b04b79 100644
--- a/hw/xquartz/quartz.h
+++ b/hw/xquartz/quartz.h
@@ -137,4 +137,7 @@ void QuartzShow(int x, int y); // (x, y) = cursor loc
 void QuartzHide(void);
 void QuartzSetRootClip(BOOL enable);
 void QuartzSpaceChanged(uint32_t space_id);
+
+void QuartzSetFullscreen(Bool state);
+void QuartzSetRootless(Bool state);
 #endif
diff --git a/hw/xquartz/quartzCommon.h b/hw/xquartz/quartzCommon.h
index e63c2b7..a17ebb2 100644
--- a/hw/xquartz/quartzCommon.h
+++ b/hw/xquartz/quartzCommon.h
@@ -60,6 +60,7 @@ extern int              quartzUseSysBeep;
 extern int              focusOnNewWindow;
 extern int              quartzUseAGL;
 extern int              quartzEnableKeyEquivalents;
+extern int              quartzFullscreenDisableHotkeys;
 
 // Other shared data
 extern int              quartzServerVisible;
diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h
index 3d33891..034d563 100644
--- a/miext/rootless/rootlessCommon.h
+++ b/miext/rootless/rootlessCommon.h
@@ -273,7 +273,8 @@ Bool RootlessResolveColormap (ScreenPtr pScreen, int first_color,
 void RootlessFlushWindowColormap (WindowPtr pWin);
 void RootlessFlushScreenColormaps (ScreenPtr pScreen);
 
-RootlessColormapCallback(void *data, int first_color, int n_colors, uint32_t *colors);
+// xp_error
+int RootlessColormapCallback(void *data, int first_color, int n_colors, uint32_t *colors);
 
 // Move a window to its proper location on the screen.
 void RootlessRepositionWindow(WindowPtr pWin);
@@ -281,4 +282,13 @@ void RootlessRepositionWindow(WindowPtr pWin);
 // Move the window to it's correct place in the physical stacking order.
 void RootlessReorderWindow(WindowPtr pWin);
 
+void RootlessScreenExpose (ScreenPtr pScreen);
+void RootlessHideAllWindows (void);
+void RootlessShowAllWindows (void);
+void RootlessUpdateRooted (Bool state);
+
+void RootlessEnableRoot (ScreenPtr pScreen);
+void RootlessDisableRoot (ScreenPtr pScreen);
+
+
 #endif /* _ROOTLESSCOMMON_H */
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index 421c03c..0db51d5 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -475,6 +475,34 @@ RootlessMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst,
     return result;
 }
 
+expose_1 (WindowPtr pWin)
+{
+    WindowPtr pChild;
+    
+    if (!pWin->realized)
+        return;
+    
+    (*pWin->drawable.pScreen->PaintWindowBackground) (pWin, &pWin->borderClip,
+                                                      PW_BACKGROUND);
+    
+    /* FIXME: comments in windowstr.h indicate that borderClip doesn't
+     include subwindow visibility. But I'm not so sure.. so we may
+     be exposing too much.. */
+    
+    miSendExposures (pWin, &pWin->borderClip,
+                     pWin->drawable.x, pWin->drawable.y);
+    
+    for (pChild = pWin->firstChild; pChild != NULL; pChild = pChild->nextSib)
+        expose_1 (pChild);
+}
+
+void
+RootlessScreenExpose (ScreenPtr pScreen)
+{
+    expose_1 (WindowTable[pScreen->myNum]);
+}
+
+
 ColormapPtr
 RootlessGetColormap (ScreenPtr pScreen)
 {
@@ -718,3 +746,18 @@ Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs)
 
     return TRUE;
 }
+
+void RootlessUpdateRooted (Bool state) {
+    int i;
+    
+    if (!state)
+    {
+        for (i = 0; i < screenInfo.numScreens; i++)
+            RootlessDisableRoot (screenInfo.screens[i]);
+    }
+    else
+    {
+        for (i = 0; i < screenInfo.numScreens; i++)
+            RootlessEnableRoot (screenInfo.screens[i]);
+    }
+}
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index c0554f4..5ef1391 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -1581,3 +1581,105 @@ RootlessOrderAllWindows (void)
     }
     RL_DEBUG_MSG("RootlessOrderAllWindows() done");
 }
+
+void
+RootlessEnableRoot (ScreenPtr pScreen)
+{
+    WindowPtr pRoot;
+    pRoot = WindowTable[pScreen->myNum];
+    
+    RootlessEnsureFrame (pRoot);
+    (*pScreen->ClearToBackground) (pRoot, 0, 0, 0, 0, TRUE);
+    RootlessReorderWindow (pRoot);
+}
+
+void
+RootlessDisableRoot (ScreenPtr pScreen)
+{
+    WindowPtr pRoot;
+    RootlessWindowRec *winRec;
+    
+    pRoot = WindowTable[pScreen->myNum];
+    winRec = WINREC (pRoot);
+    
+    if (winRec != NULL)
+    {
+        RootlessDestroyFrame (pRoot, winRec);
+        DeleteProperty (pRoot, xa_native_window_id ());
+    }
+}
+
+void
+RootlessHideAllWindows (void)
+{
+    int i;
+    ScreenPtr pScreen;
+    WindowPtr pWin;
+    RootlessWindowRec *winRec;
+    xp_window_changes wc;
+    
+    if (windows_hidden)
+        return;
+    
+    windows_hidden = TRUE;
+    
+    for (i = 0; i < screenInfo.numScreens; i++)
+    {
+        pScreen = screenInfo.screens[i];
+        pWin = WindowTable[i];
+        if (pScreen == NULL || pWin == NULL)
+            continue;
+        
+        for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib)
+        {
+            if (!pWin->realized)
+                continue;
+            
+            RootlessStopDrawing (pWin, FALSE);
+            
+            winRec = WINREC (pWin);
+            if (winRec != NULL)
+            {
+                wc.stack_mode = XP_UNMAPPED;
+                wc.sibling = 0;
+                configure_window ((xp_window_id)winRec->wid, XP_STACKING, &wc);
+            }
+        }
+    }
+}
+
+void
+RootlessShowAllWindows (void)
+{
+    int i;
+    ScreenPtr pScreen;
+    WindowPtr pWin;
+    RootlessWindowRec *winRec;
+    
+    if (!windows_hidden)
+        return;
+    
+    windows_hidden = FALSE;
+    
+    for (i = 0; i < screenInfo.numScreens; i++)
+    {
+        pScreen = screenInfo.screens[i];
+        pWin = WindowTable[i];
+        if (pScreen == NULL || pWin == NULL)
+            continue;
+        
+        for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib)
+        {
+            if (!pWin->realized)
+                continue;
+            
+            winRec = RootlessEnsureFrame (pWin);
+            if (winRec == NULL)
+                continue;
+            
+            RootlessReorderWindow (pWin);
+        }
+        
+        RootlessScreenExpose (pScreen);
+    }
+}
commit dc166bf6423f4243ea05f17340ff9ff99ecad74b
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Tue Oct 7 11:39:08 2008 -0700

    XQuartz: Fixed EXTRA_DIST for new GL files.
    (cherry picked from commit a11c9052030b44045f037050a5825256b539ed50)

diff --git a/hw/xquartz/GL/Makefile.am b/hw/xquartz/GL/Makefile.am
index c528d2a..8f4478f 100644
--- a/hw/xquartz/GL/Makefile.am
+++ b/hw/xquartz/GL/Makefile.am
@@ -13,3 +13,7 @@ libCGLCore_la_SOURCES = \
 	indirect.c \
 	capabilities.c \
 	visualConfigs.c
+
+EXTRA_DIST = \
+	capabilities.h \
+	visualConfigs.h
commit 803327929445256e159c10894e6305fbaa389982
Author: George Staplin <georgestaplin at george-staplins-mac-pro.local>
Date:   Tue Oct 7 12:12:38 2008 -0600

    XQuartz: GL: setVisualConfigs() copied the behavior of indirect.c which is wrong, with regard to the handling of xcalloc failure.
    
    Use ErrorF for an error message after an xcalloc failure, and return instead of falling through to GlxSetVisualConfigs, or abort()ing at the test branch.
    (cherry picked from commit 1056700971fd5c034396ed6dbea15e092f0c6332)

diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c
index 821fad2..e46d628 100644
--- a/hw/xquartz/GL/visualConfigs.c
+++ b/hw/xquartz/GL/visualConfigs.c
@@ -86,65 +86,75 @@ void setVisualConfigs(void) {
 
       2 iterations for accum (on and off (with an accum color size of 16)).
      */
-    
 
     numConfigs = ((enable_stereo && caps->stereo) ? 2 : 1) * 2 * 
 	(caps->aux_buffers ? 2 : 1) * (caps->buffers) * 2 * 2;
 
     visualConfigs = xcalloc(sizeof(*visualConfigs), numConfigs);
+
+    if(NULL == visualConfigs) {
+	ErrorF("xcalloc failure when allocating visualConfigs\n");
+	return;
+    }
+    
     visualPrivates = xcalloc(sizeof(void *), numConfigs);
 
-    if (NULL != visualConfigs) {
-        i = 0; /* current buffer */
-        for (stereo = 0; stereo < ((enable_stereo && caps->stereo) ? 2 : 1); ++stereo) {
-	    for (depth = 0; depth < 2; ++depth) {
-		for (aux = 0; aux < (caps->aux_buffers ? 2 : 1); ++aux) {
-		    for (buffers = 0; buffers < caps->buffers; ++buffers) {
-			for (stencil = 0; stencil < 2; ++stencil) {
-			    for (accum = 0; accum < 2; ++accum) {
-				visualConfigs[i].vid = -1;
-				visualConfigs[i].class = -1;
-				visualConfigs[i].rgba = TRUE;
-				visualConfigs[i].redSize = -1;
-				visualConfigs[i].greenSize = -1;
-				visualConfigs[i].blueSize = -1;
-				visualConfigs[i].redMask = -1;
-				visualConfigs[i].greenMask = -1;
-				visualConfigs[i].blueMask = -1;
-				visualConfigs[i].alphaMask = 0;
-				if (accum) {
-				    visualConfigs[i].accumRedSize = 16;
-				    visualConfigs[i].accumGreenSize = 16;
-				    visualConfigs[i].accumBlueSize = 16;
-				    visualConfigs[i].accumAlphaSize = 16;
-				} else {
-				    visualConfigs[i].accumRedSize = 0;
-				    visualConfigs[i].accumGreenSize = 0;
-				    visualConfigs[i].accumBlueSize = 0;
-				    visualConfigs[i].accumAlphaSize = 0;
-				}
-				visualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE;
-				visualConfigs[i].stereo = stereo ? TRUE : FALSE;
-				visualConfigs[i].bufferSize = -1;
-                    
-				visualConfigs[i].depthSize = depth ? 24 : 0;
-				visualConfigs[i].stencilSize = stencil ? 8 : 0;
-				visualConfigs[i].auxBuffers = aux ? caps->aux_buffers : 0;
-				visualConfigs[i].level = 0;
-				visualConfigs[i].visualRating = GLX_NONE_EXT;
-				visualConfigs[i].transparentPixel = 0;
-				visualConfigs[i].transparentRed = 0;
-				visualConfigs[i].transparentGreen = 0;
-				visualConfigs[i].transparentBlue = 0;
-				visualConfigs[i].transparentAlpha = 0;
-				visualConfigs[i].transparentIndex = 0;
-				++i;
+    if(NULL == visualPrivates) {
+	ErrorF("xcalloc failure when allocating visualPrivates");
+	xfree(visualConfigs);
+	return;
+    }
+
+ 
+    i = 0; /* current buffer */
+    for (stereo = 0; stereo < ((enable_stereo && caps->stereo) ? 2 : 1); ++stereo) {
+	for (depth = 0; depth < 2; ++depth) {
+	    for (aux = 0; aux < (caps->aux_buffers ? 2 : 1); ++aux) {
+		for (buffers = 0; buffers < caps->buffers; ++buffers) {
+		    for (stencil = 0; stencil < 2; ++stencil) {
+			for (accum = 0; accum < 2; ++accum) {
+			    visualConfigs[i].vid = -1;
+			    visualConfigs[i].class = -1;
+			    visualConfigs[i].rgba = TRUE;
+			    visualConfigs[i].redSize = -1;
+			    visualConfigs[i].greenSize = -1;
+			    visualConfigs[i].blueSize = -1;
+			    visualConfigs[i].redMask = -1;
+			    visualConfigs[i].greenMask = -1;
+			    visualConfigs[i].blueMask = -1;
+			    visualConfigs[i].alphaMask = 0;
+			    if (accum) {
+				visualConfigs[i].accumRedSize = 16;
+				visualConfigs[i].accumGreenSize = 16;
+				visualConfigs[i].accumBlueSize = 16;
+				visualConfigs[i].accumAlphaSize = 16;
+			    } else {
+				visualConfigs[i].accumRedSize = 0;
+				visualConfigs[i].accumGreenSize = 0;
+				visualConfigs[i].accumBlueSize = 0;
+				visualConfigs[i].accumAlphaSize = 0;
 			    }
+			    visualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE;
+			    visualConfigs[i].stereo = stereo ? TRUE : FALSE;
+			    visualConfigs[i].bufferSize = -1;
+			    
+			    visualConfigs[i].depthSize = depth ? 24 : 0;
+			    visualConfigs[i].stencilSize = stencil ? 8 : 0;
+			    visualConfigs[i].auxBuffers = aux ? caps->aux_buffers : 0;
+			    visualConfigs[i].level = 0;
+			    visualConfigs[i].visualRating = GLX_NONE_EXT;
+			    visualConfigs[i].transparentPixel = 0;
+			    visualConfigs[i].transparentRed = 0;
+			    visualConfigs[i].transparentGreen = 0;
+			    visualConfigs[i].transparentBlue = 0;
+			    visualConfigs[i].transparentAlpha = 0;
+			    visualConfigs[i].transparentIndex = 0;
+			    ++i;
 			}
 		    }
 		}
 	    }
-        }
+	}
     }
 
     if (i != numConfigs) {
commit f1fec6f323b27a0165325d8fcf6af7ae163bde14
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Oct 8 18:45:04 2008 -0700

    XQuartz: Call setVisualConfigs in InitOutput, and only when GLXEXT is defined.
    (cherry picked from commit 97173d4eda142c73bb975cc05225b791778f85af)

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 184fb96..dd37e9f 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -228,8 +228,6 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv)
 
     miSetPixmapDepths();
 
-    setVisualConfigs();
-
     // machine independent screen init
     // setup _Screen structure in pScreen
     if (monitorResolution)
@@ -594,6 +592,10 @@ void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
     for (i = 0; i < NUMFORMATS; i++)
         pScreenInfo->formats[i] = formats[i];
 
+#ifdef GLXEXT
+    setVisualConfigs();    
+#endif
+
     // Discover screens and do mode specific initialization
     QuartzInitOutput(argc, argv);
 
commit 52accec7dbc613a521e40449b8bb5f0c92ddb105
Author: George Staplin <georgestaplin at george-staplins-mac-pro.local>
Date:   Tue Oct 7 11:31:48 2008 -0600

    XQuartz: GL: Add the proper license information to the new files, and add more commentary to setVisualConfigs().
    (cherry picked from commit 190a3d5e5de9915931928fb8e6da88bb9644cda4)

diff --git a/hw/xquartz/GL/capabilities.c b/hw/xquartz/GL/capabilities.c
index 3a54025..479fc93 100644
--- a/hw/xquartz/GL/capabilities.c
+++ b/hw/xquartz/GL/capabilities.c
@@ -1,3 +1,25 @@
+/*
+ * Copyright (c) 2008 Apple Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <OpenGL/OpenGL.h>
diff --git a/hw/xquartz/GL/capabilities.h b/hw/xquartz/GL/capabilities.h
index 74487be..6a026cf 100644
--- a/hw/xquartz/GL/capabilities.h
+++ b/hw/xquartz/GL/capabilities.h
@@ -1,3 +1,25 @@
+/*
+ * Copyright (c) 2008 Apple Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
 #ifndef CAPABILITIES_H
 #define CAPABILITIES_H
 
diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c
index 05dfa19..821fad2 100644
--- a/hw/xquartz/GL/visualConfigs.c
+++ b/hw/xquartz/GL/visualConfigs.c
@@ -1,3 +1,33 @@
+/*
+ * Copyright (c) 2007, 2008 Apple Inc.
+ * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved.
+ * Copyright (c) 2002 Greg Parker. All Rights Reserved.
+ *
+ * Portions of this file are copied from Mesa's xf86glx.c,
+ * which contains the following copyright:
+ *
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
@@ -28,6 +58,7 @@
 
 extern BOOL enable_stereo;
 
+/* Based originally on code from indirect.c which was based on code from i830_dri.c. */
 void setVisualConfigs(void) {
     int numConfigs = 0;
     __GLXvisualConfig *visualConfigs = NULL;
@@ -41,14 +72,21 @@ void setVisualConfigs(void) {
 	return;
     }
     
-    /* count num configs:
-        2 stereo (on, off) (optional)
-        2 Z buffer (0, 24 bit)
-        2 AUX buffer (0, 2)
-        2 buffers (single, double)
-        2 stencil (0, 8 bit)
-        2 accum (0, 64 bit)
-        = 64 configs with stereo, or 32 without */
+    /*
+      caps->stereo is 0 or 1, but we need at least 1 iteration of the loop, so we treat
+      a true caps->stereo as 2.
+
+      The depth size is 0 or 24.  Thus we do 2 iterations for that.
+
+      caps->aux_buffers (when available/non-zero) result in 2 iterations instead of 1.
+
+      caps->buffers indicates whether we have single or double buffering.
+      
+      2 iterations for stencil (on and off (with a stencil size of 8)).
+
+      2 iterations for accum (on and off (with an accum color size of 16)).
+     */
+    
 
     numConfigs = ((enable_stereo && caps->stereo) ? 2 : 1) * 2 * 
 	(caps->aux_buffers ? 2 : 1) * (caps->buffers) * 2 * 2;
@@ -89,7 +127,7 @@ void setVisualConfigs(void) {
 				visualConfigs[i].stereo = stereo ? TRUE : FALSE;
 				visualConfigs[i].bufferSize = -1;
                     
-				visualConfigs[i].depthSize = depth? 24 : 0;
+				visualConfigs[i].depthSize = depth ? 24 : 0;
 				visualConfigs[i].stencilSize = stencil ? 8 : 0;
 				visualConfigs[i].auxBuffers = aux ? caps->aux_buffers : 0;
 				visualConfigs[i].level = 0;
diff --git a/hw/xquartz/GL/visualConfigs.h b/hw/xquartz/GL/visualConfigs.h
index f9cd886..b9e6ae7 100644
--- a/hw/xquartz/GL/visualConfigs.h
+++ b/hw/xquartz/GL/visualConfigs.h
@@ -1,3 +1,25 @@
+/*
+ * Copyright (c) 2008 Apple Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
 #ifndef VISUAL_CONFIGS_H
 #define VISUAL_CONFIGS_H
 
commit 63abdf61151cc90f769ed1708ee19b6c434c27c9
Author: George Staplin <georgestaplin at george-staplins-mac-pro.local>
Date:   Mon Oct 6 18:05:12 2008 -0600

    XQuartz: GL: Add the new C code to the Makefile.am.
    
    Commit the darwin.c changes I missed in the last commit, for calling
    setVisualConfigs().
    (cherry picked from commit eb3c014e1710bf0b93bda10ddb9b795cd150d02d)

diff --git a/hw/xquartz/GL/Makefile.am b/hw/xquartz/GL/Makefile.am
index 450ee5c..c528d2a 100644
--- a/hw/xquartz/GL/Makefile.am
+++ b/hw/xquartz/GL/Makefile.am
@@ -10,4 +10,6 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/miext/damage
 
 libCGLCore_la_SOURCES = \
-	indirect.c
+	indirect.c \
+	capabilities.c \
+	visualConfigs.c
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index d728e98..184fb96 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -75,6 +75,9 @@
 #include "quartz.h"
 //#include "darwinClut8.h"
 
+#include "GL/visualConfigs.h"
+
+
 #ifdef ENABLE_DEBUG_LOG
 FILE *debug_log_fp = NULL;
 #endif
@@ -179,7 +182,6 @@ static Bool DarwinSaveScreen(ScreenPtr pScreen, int on)
     return TRUE;
 }
 
-
 /*
  * DarwinAddScreen
  *  This is a callback from dix during AddScreen() from InitOutput().
@@ -226,6 +228,8 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv)
 
     miSetPixmapDepths();
 
+    setVisualConfigs();
+
     // machine independent screen init
     // setup _Screen structure in pScreen
     if (monitorResolution)
commit a8f5d422c9c0a39f55e80bbd180439b6ec3a805c
Author: George Staplin <georgestaplin at george-staplins-mac-pro.local>
Date:   Mon Oct 6 18:01:23 2008 -0600

    XQuartz: GL: Provide code for getting the capabilities of the underlying system's CGL.
    
    Add a setVisualConfigs that is called before the fbScreenInit, to setup the __GLXvisualConfigs.
    (cherry picked from commit fc86f9e4482043eca76d9d7a96e166be1aabf674)

diff --git a/hw/xquartz/GL/capabilities.c b/hw/xquartz/GL/capabilities.c
new file mode 100644
index 0000000..3a54025
--- /dev/null
+++ b/hw/xquartz/GL/capabilities.c
@@ -0,0 +1,86 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <OpenGL/OpenGL.h>
+#include <OpenGL/gl.h>
+#include <OpenGL/glu.h>
+#include <OpenGL/glext.h>
+#include <ApplicationServices/ApplicationServices.h>
+
+#include "capabilities.h"
+
+//#define DIAGNOSTIC 0
+
+static void handleBufferModes(struct glCapabilities *cap, GLint bufferModes) {
+    if(bufferModes & kCGLStereoscopicBit) {
+	cap->stereo = true;
+    }
+
+    if(bufferModes & kCGLDoubleBufferBit) {
+	cap->buffers = 2;
+    } else {
+	cap->buffers = 1;
+    }
+}
+
+static void initCapabilities(struct glCapabilities *cap) {
+    cap->stereo = cap->buffers = cap->aux_buffers = 0;
+}
+
+enum {
+    MAX_DISPLAYS = 32
+};
+
+/*Return true if an error occured. */
+bool getGlCapabilities(struct glCapabilities *cap) {
+    CGDirectDisplayID dspys[MAX_DISPLAYS];
+    CGDisplayErr err;
+    CGOpenGLDisplayMask displayMask;
+    CGDisplayCount i, displayCount = 0;
+
+    initCapabilities(cap);
+    
+    err = CGGetActiveDisplayList(MAX_DISPLAYS, dspys, &displayCount);
+    if(err) {
+#ifdef DIAGNOSTIC
+	fprintf(stderr, "CGGetActiveDisplayList %s\n", CGLErrorString (err));
+#endif
+	return true;
+    }
+ 
+    for(i = 0; i < displayCount; ++i) {
+        displayMask = CGDisplayIDToOpenGLDisplayMask(dspys[i]);
+       
+	CGLRendererInfoObj info;
+	GLint numRenderers = 0, r, accelerated = 0, flags = 0, aux = 0;
+    
+	err = CGLQueryRendererInfo (displayMask, &info, &numRenderers);
+        if(!err) {
+            CGLDescribeRenderer (info, 0, kCGLRPRendererCount, &numRenderers);
+            for(r = 0; r < numRenderers; ++r) {
+                // find accelerated renderer (assume only one)
+                CGLDescribeRenderer (info, r, kCGLRPAccelerated, &accelerated);
+                if(accelerated) {
+                    err = CGLDescribeRenderer(info, r, kCGLRPBufferModes, &flags);
+		    if(err) {
+			CGLDestroyRendererInfo(info);
+			return true;
+		    }
+
+		    handleBufferModes(cap, flags);
+
+		    err = CGLDescribeRenderer(info, r, kCGLRPMaxAuxBuffers, &aux);
+		    if(err) {
+			CGLDestroyRendererInfo(info);
+			return true;
+		    }
+
+		    cap->aux_buffers = aux;
+                }
+            }
+	    CGLDestroyRendererInfo(info);
+	}
+    }
+
+    /* No error occured.  We are done. */
+    return false;
+}
diff --git a/hw/xquartz/GL/capabilities.h b/hw/xquartz/GL/capabilities.h
new file mode 100644
index 0000000..74487be
--- /dev/null
+++ b/hw/xquartz/GL/capabilities.h
@@ -0,0 +1,15 @@
+#ifndef CAPABILITIES_H
+#define CAPABILITIES_H
+
+#include <stdbool.h>
+
+struct glCapabilities {
+    int stereo;
+    int aux_buffers;
+    int buffers;
+    /*TODO handle STENCIL and ACCUM*/
+};
+
+bool getGlCapabilities(struct glCapabilities *cap);
+
+#endif
diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c
new file mode 100644
index 0000000..05dfa19
--- /dev/null
+++ b/hw/xquartz/GL/visualConfigs.c
@@ -0,0 +1,118 @@
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "dri.h"
+
+#include <OpenGL/OpenGL.h>
+#include <OpenGL/CGLContext.h>
+
+#include <GL/gl.h>
+#include <GL/glxproto.h>
+#include <windowstr.h>
+#include <resource.h>
+#include <GL/glxint.h>
+#include <GL/glxtokens.h>
+#include <scrnintstr.h>
+#include <glxserver.h>
+#include <glxscreens.h>
+#include <glxdrawable.h>
+#include <glxcontext.h>
+#include <glxext.h>
+#include <glxutil.h>
+#include <glxscreens.h>
+#include <GL/internal/glcore.h>
+
+#include "capabilities.h"
+#include "visualConfigs.h"
+
+extern BOOL enable_stereo;
+
+void setVisualConfigs(void) {
+    int numConfigs = 0;
+    __GLXvisualConfig *visualConfigs = NULL;
+    void **visualPrivates = NULL;
+    struct glCapabilities caps[1];
+    int stereo, depth, aux, buffers, stencil, accum;
+    int i = 0; 
+
+    if(getGlCapabilities(caps)) {
+	ErrorF("error from getGlCapabilities()!\n");
+	return;
+    }
+    
+    /* count num configs:
+        2 stereo (on, off) (optional)
+        2 Z buffer (0, 24 bit)
+        2 AUX buffer (0, 2)
+        2 buffers (single, double)
+        2 stencil (0, 8 bit)
+        2 accum (0, 64 bit)
+        = 64 configs with stereo, or 32 without */
+
+    numConfigs = ((enable_stereo && caps->stereo) ? 2 : 1) * 2 * 
+	(caps->aux_buffers ? 2 : 1) * (caps->buffers) * 2 * 2;
+
+    visualConfigs = xcalloc(sizeof(*visualConfigs), numConfigs);
+    visualPrivates = xcalloc(sizeof(void *), numConfigs);
+
+    if (NULL != visualConfigs) {
+        i = 0; /* current buffer */
+        for (stereo = 0; stereo < ((enable_stereo && caps->stereo) ? 2 : 1); ++stereo) {
+	    for (depth = 0; depth < 2; ++depth) {
+		for (aux = 0; aux < (caps->aux_buffers ? 2 : 1); ++aux) {
+		    for (buffers = 0; buffers < caps->buffers; ++buffers) {
+			for (stencil = 0; stencil < 2; ++stencil) {
+			    for (accum = 0; accum < 2; ++accum) {
+				visualConfigs[i].vid = -1;
+				visualConfigs[i].class = -1;
+				visualConfigs[i].rgba = TRUE;
+				visualConfigs[i].redSize = -1;
+				visualConfigs[i].greenSize = -1;
+				visualConfigs[i].blueSize = -1;
+				visualConfigs[i].redMask = -1;
+				visualConfigs[i].greenMask = -1;
+				visualConfigs[i].blueMask = -1;
+				visualConfigs[i].alphaMask = 0;
+				if (accum) {
+				    visualConfigs[i].accumRedSize = 16;
+				    visualConfigs[i].accumGreenSize = 16;
+				    visualConfigs[i].accumBlueSize = 16;
+				    visualConfigs[i].accumAlphaSize = 16;
+				} else {
+				    visualConfigs[i].accumRedSize = 0;
+				    visualConfigs[i].accumGreenSize = 0;
+				    visualConfigs[i].accumBlueSize = 0;
+				    visualConfigs[i].accumAlphaSize = 0;
+				}
+				visualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE;
+				visualConfigs[i].stereo = stereo ? TRUE : FALSE;
+				visualConfigs[i].bufferSize = -1;
+                    
+				visualConfigs[i].depthSize = depth? 24 : 0;
+				visualConfigs[i].stencilSize = stencil ? 8 : 0;
+				visualConfigs[i].auxBuffers = aux ? caps->aux_buffers : 0;
+				visualConfigs[i].level = 0;
+				visualConfigs[i].visualRating = GLX_NONE_EXT;
+				visualConfigs[i].transparentPixel = 0;
+				visualConfigs[i].transparentRed = 0;
+				visualConfigs[i].transparentGreen = 0;
+				visualConfigs[i].transparentBlue = 0;
+				visualConfigs[i].transparentAlpha = 0;
+				visualConfigs[i].transparentIndex = 0;
+				++i;
+			    }
+			}
+		    }
+		}
+	    }
+        }
+    }
+
+    if (i != numConfigs) {
+	ErrorF("numConfigs calculation error in setVisualConfigs!\n");
+	abort();
+    }
+
+    GlxSetVisualConfigs(numConfigs, visualConfigs, visualPrivates);
+}
diff --git a/hw/xquartz/GL/visualConfigs.h b/hw/xquartz/GL/visualConfigs.h
new file mode 100644
index 0000000..f9cd886
--- /dev/null
+++ b/hw/xquartz/GL/visualConfigs.h
@@ -0,0 +1,6 @@
+#ifndef VISUAL_CONFIGS_H
+#define VISUAL_CONFIGS_H
+
+void setVisualConfigs(void);
+
+#endif
commit 2998e48be343ab2a11d6d328fc961ab5b8eb9292
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Oct 4 21:25:50 2008 -0700

    Xquartz: Fix parallel builds
    (cherry picked from commit 1fe7298a3b9a2ed82c612292f9e547cf78f99ae5)

diff --git a/hw/xquartz/pbproxy/Makefile.am b/hw/xquartz/pbproxy/Makefile.am
index 43f7386..fd93ce1 100644
--- a/hw/xquartz/pbproxy/Makefile.am
+++ b/hw/xquartz/pbproxy/Makefile.am
@@ -14,7 +14,7 @@ if !INTEGRATED_XPBPROXY
 
 bin_PROGRAMS = xpbproxy
 xpbproxy_SOURCES = app-main.m
-xpbproxy_LDADD = $(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la
+xpbproxy_LDADD = libxpbproxy.la
 
 endif
 


More information about the xorg-commit mailing list