[Xquartz-changes] xserver: Branch 'master' - 2 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Sun Feb 27 16:20:12 PST 2011


Rebased ref, commits from common ancestor:
commit 0343aed1f082baf4bfbd730c1c3582f1410b8741
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sun Feb 27 16:18:27 2011 -0800

    XQuartz: Don't use deprecated CoreGraphics API on SL and Lion
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 6e6d06e..972278b 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -299,9 +299,34 @@ xprAddScreen(int index, ScreenPtr pScreen)
     DEBUG_LOG("index=%d depth=%d\n", index, depth);
     
     if(depth == -1) {
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
         depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
+#else
+        CGDisplayModeRef modeRef;
+        CFStringRef encStrRef;
+        
+        modeRef = CGDisplayCopyDisplayMode(kCGDirectMainDisplay);
+        if(!modeRef)
+            goto have_depth;
+
+        encStrRef = CGDisplayModeCopyPixelEncoding(modeRef);
+        CFRelease(modeRef);
+        if(!encStrRef)
+            goto have_depth;
+        
+        if(CFStringCompare(encStrRef, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+            depth = 24;
+        } else if(CFStringCompare(encStrRef, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+            depth = 15;
+        } else if(CFStringCompare(encStrRef, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+            depth = 8;
+        }
+
+        CFRelease(encStrRef);
+#endif
     }
     
+have_depth:
     switch(depth) {
         case 8: // pseudo-working
             dfb->visuals = PseudoColorMask;
@@ -326,7 +351,7 @@ xprAddScreen(int index, ScreenPtr pScreen)
 //        case 24:
         default:
             if(depth != 24)
-                ErrorF("Unsupported color depth requested.  Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d CGDisplaySamplesPerPixel=%d CGDisplayBitsPerSample=%d)\n",  darwinDesiredDepth, depth, (int)CGDisplaySamplesPerPixel(kCGDirectMainDisplay), (int)CGDisplayBitsPerSample(kCGDirectMainDisplay));
+                ErrorF("Unsupported color depth requested.  Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d)\n", depth, darwinDesiredDepth);
             dfb->visuals = TrueColorMask; //LARGE_VISUALS;
             dfb->preferredCVC = TrueColor;
             dfb->depth = 24;
commit de32d4dcf57c10fc100c1b33630127947a8c8460
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sun Feb 27 15:49:10 2011 -0800

    Revert "rootless: Remove ROOTLESS_WORKAROUND"
    
    Christof Wolf has reported a regression that seems to be caused by
    this change, so reverting the change in the 1.9 branch.  We'll
    investigate a proper fix in master for 1.10.
    
    This reverts commit c89f0521044083a11d538ebfeaabee6fc7fb9a03.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 85d5c98..0a06391 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1923,7 +1923,7 @@ if test "x$XQUARTZ" = xyes; then
 
 	AC_CHECK_LIB([Xplugin],[xp_init],[:])
 
-	CFLAGS="${CFLAGS} -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
+	CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
 
 	PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11)
 
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index 566995c..0fe1fb6 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -89,7 +89,11 @@ getDrawableDamageRef (DrawablePtr pDrawable)
 	ScreenPtr   pScreen = pDrawable->pScreen;
 
 	pPixmap = 0;
-	if (pScreen->GetWindowPixmap)
+	if (pScreen->GetWindowPixmap
+#ifdef ROOTLESS_WORKAROUND
+	    && ((WindowPtr)pDrawable)->viewable
+#endif
+	    )
 	    pPixmap = (*pScreen->GetWindowPixmap) ((WindowPtr)pDrawable);
 
 	if (!pPixmap)


More information about the Xquartz-changes mailing list