[Xquartz-changes] xserver: Branch 'server-1.10-apple' - 12 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Thu Aug 4 23:00:52 PDT 2011


Rebased ref, commits from common ancestor:
commit 005798b76d21c0982d3385a198dcd4bc61af5cc2
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Oct 30 14:55:06 2010 -0700

    configure.ac: Add -fno-strict-aliasing to CFLAGS
    
    This should address https://bugs.freedesktop.org/show_bug.cgi?id=31238
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index dac526a..b600fef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,12 @@ XORG_PROG_RAWCPP
 # easier overrides at build time.
 XSERVER_CFLAGS='$(CWARNFLAGS)'
 
+dnl Explicitly add -fno-strict-aliasing since this option should disappear
+dnl from util-macros CWARNFLAGS
+if  test "x$GCC" = xyes ; then
+    XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
+fi
+
 dnl Check for dtrace program (needed to build Xserver dtrace probes)
 dnl Also checks for <sys/sdt.h>, since some Linux distros have an 
 dnl ISDN trace program named dtrace
commit 9dd5900fa94726c4ed77ea81dea205c5866dc1ad
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Feb 12 19:48:52 2010 -0800

    fb: Revert fb changes that broke XQuartz
    
    http://bugs.freedesktop.org/show_bug.cgi?id=26124
    
    Revert "Fix source pictures getting random transforms after 2d6a8f668342a5190cdf43b5."
    Revert "fb: Adjust transform or composite coordinates for pixman operations"
    
    http://bugs.freedesktop.org/26124
    
    This reverts commit a72c65e9176c51de95db2fdbf4c5d946a4911695.
    This reverts commit a6bd5d2e482a5aa84acb3d4932e2a166d8670ef1.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/fb/fb.h b/fb/fb.h
index 021a940..0b248e1 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -2079,11 +2079,8 @@ fbFillRegionSolid (DrawablePtr	pDrawable,
 		   FbBits	xor);
 
 extern _X_EXPORT pixman_image_t *
-image_from_pict (PicturePtr	pict,
-		 Bool		has_clip,
-		 int		*xoff,
-		 int		*yoff);
-
+image_from_pict (PicturePtr pict,
+		 Bool       has_clip);
 extern _X_EXPORT void free_pixman_pict (PicturePtr, pixman_image_t *);
 
 #endif /* _FB_H_ */
diff --git a/fb/fbpict.c b/fb/fbpict.c
index 7636040..af1920b 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -50,24 +50,19 @@ fbComposite (CARD8      op,
 	     CARD16     height)
 {
     pixman_image_t *src, *mask, *dest;
-    int src_xoff, src_yoff;
-    int msk_xoff, msk_yoff;
-    int dst_xoff, dst_yoff;
     
     miCompositeSourceValidate (pSrc, xSrc - xDst, ySrc - yDst, width, height);
     if (pMask)
 	miCompositeSourceValidate (pMask, xMask - xDst, yMask - yDst, width, height);
     
-    src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
-    mask = image_from_pict (pMask, FALSE, &msk_xoff, &msk_yoff);
-    dest = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff);
+    src = image_from_pict (pSrc, TRUE);
+    mask = image_from_pict (pMask, TRUE);
+    dest = image_from_pict (pDst, TRUE);
 
     if (src && dest && !(pMask && !mask))
     {
 	pixman_image_composite (op, src, mask, dest,
-				xSrc + src_xoff, ySrc + src_yoff,
-				xMask + msk_xoff, yMask + msk_yoff,
-				xDst + dst_xoff, yDst + dst_yoff,
+				xSrc, ySrc, xMask, yMask, xDst, yDst,
 				width, height);
     }
 
@@ -146,22 +141,22 @@ create_conical_gradient_image (PictGradient *gradient)
 
 static pixman_image_t *
 create_bits_picture (PicturePtr pict,
-		     Bool       has_clip,
-		     int	*xoff,
-		     int	*yoff)
+		     Bool       has_clip)
 {
-    PixmapPtr pixmap;
     FbBits *bits;
     FbStride stride;
-    int bpp;
+    int bpp, xoff, yoff;
     pixman_image_t *image;
     
-    fbGetDrawablePixmap (pict->pDrawable, pixmap, *xoff, *yoff);
-    fbGetPixmapBitsData(pixmap, bits, stride, bpp);
+    fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
+
+    bits = (FbBits*)((CARD8*)bits +
+		     (pict->pDrawable->y + yoff) * stride * sizeof(FbBits) +
+		     (pict->pDrawable->x + xoff) * (bpp / 8));
 
     image = pixman_image_create_bits (
 	pict->format,
-	pixmap->drawable.width, pixmap->drawable.height,
+	pict->pDrawable->width, pict->pDrawable->height,
 	(uint32_t *)bits, stride * sizeof (FbStride));
     
     
@@ -187,55 +182,33 @@ create_bits_picture (PicturePtr pict,
 	if (pict->clientClipType != CT_NONE)
 	    pixman_image_set_has_client_clip (image, TRUE);
 
-	if (*xoff || *yoff)
-	    pixman_region_translate (pict->pCompositeClip, *xoff, *yoff);
+	pixman_region_translate (pict->pCompositeClip, - pict->pDrawable->x, - pict->pDrawable->y);
 
 	pixman_image_set_clip_region (image, pict->pCompositeClip);
 
-	if (*xoff || *yoff)
-	    pixman_region_translate (pict->pCompositeClip, -*xoff, -*yoff);
+	pixman_region_translate (pict->pCompositeClip, pict->pDrawable->x, pict->pDrawable->y);
     }
     
     /* Indexed table */
     if (pict->pFormat->index.devPrivate)
 	pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
 
-    /* Add in drawable origin to position within the image */
-    *xoff += pict->pDrawable->x;
-    *yoff += pict->pDrawable->y;
-
     return image;
 }
 
 static pixman_image_t *
-image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map);
+image_from_pict_internal (PicturePtr pict, Bool has_clip, Bool is_alpha_map);
 
 static void
-set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map)
+set_image_properties (pixman_image_t *image, PicturePtr pict, Bool is_alpha_map)
 {
     pixman_repeat_t repeat;
     pixman_filter_t filter;
     
     if (pict->transform)
     {
-	/* For source images, adjust the transform to account
-	 * for the drawable offset within the pixman image,
-	 * then set the offset to 0 as it will be used
-	 * to compute positions within the transformed image.
-	 */
-	if (!has_clip) {
-	    struct pixman_transform	adjusted;
-
-	    adjusted = *pict->transform;
-	    pixman_transform_translate(&adjusted,
-				       NULL,
-				       pixman_int_to_fixed(*xoff),
-				       pixman_int_to_fixed(*yoff));
-	    pixman_image_set_transform (image, &adjusted);
-	    *xoff = 0;
-	    *yoff = 0;
-	} else
-	    pixman_image_set_transform (image, pict->transform);
+	pixman_image_set_transform (
+	    image, (pixman_transform_t *)pict->transform);
     }
     
     switch (pict->repeatType)
@@ -265,8 +238,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
      */
     if (pict->alphaMap && !is_alpha_map)
     {
-	int alpha_xoff, alpha_yoff;
-	pixman_image_t *alpha_map = image_from_pict_internal (pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff, TRUE);
+	pixman_image_t *alpha_map = image_from_pict_internal (pict->alphaMap, TRUE, TRUE);
 	
 	pixman_image_set_alpha_map (
 	    image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
@@ -299,7 +271,8 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
 }
 
 static pixman_image_t *
-image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map)
+image_from_pict_internal (PicturePtr pict,
+		 Bool has_clip, Bool is_alpha_map)
 {
     pixman_image_t *image = NULL;
 
@@ -308,7 +281,7 @@ image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
 
     if (pict->pDrawable)
     {
-	image = create_bits_picture (pict, has_clip, xoff, yoff);
+	image = create_bits_picture (pict, has_clip);
     }
     else if (pict->pSourcePict)
     {
@@ -329,19 +302,18 @@ image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
 	    else if (sp->type == SourcePictTypeConical)
 		image = create_conical_gradient_image (gradient);
 	}
-	*xoff = *yoff = 0;
     }
     
     if (image)
-	set_image_properties (image, pict, has_clip, xoff, yoff, is_alpha_map);
+	set_image_properties (image, pict, is_alpha_map);
     
     return image;
 }
 
 pixman_image_t *
-image_from_pict (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
+image_from_pict (PicturePtr pict, Bool has_clip)
 {
-    return image_from_pict_internal (pict, has_clip, xoff, yoff, FALSE);
+    return image_from_pict_internal (pict, has_clip, FALSE);
 }
 
 void
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index c309ceb..40cffd9 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -37,8 +37,7 @@ fbAddTraps (PicturePtr	pPicture,
 	    int		ntrap,
 	    xTrap	*traps)
 {
-    int image_xoff, image_yoff;
-    pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
+    pixman_image_t *image = image_from_pict (pPicture, FALSE);
 
     if (!image)
 	return;
@@ -54,8 +53,7 @@ fbRasterizeTrapezoid (PicturePtr    pPicture,
 		      int	    x_off,
 		      int	    y_off)
 {
-    int	mask_xoff, mask_yoff;
-    pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff);
+    pixman_image_t *image = image_from_pict (pPicture, FALSE);
 
     if (!image)
 	return;
commit 4c8a35f0425d071948e1e254ea7ee8c74b038dbd
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Apr 30 13:08:25 2010 -0700

    Workaround the GC clipping problem in miPaintWindow and add some debugging output.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/mi/miexpose.c b/mi/miexpose.c
index 94258b8..4f25c23 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -521,6 +521,7 @@ void RootlessSetPixmapOfAncestors(WindowPtr pWin);
 void RootlessStartDrawing(WindowPtr pWin);
 void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
 Bool IsFramedWindow(WindowPtr pWin);
+#include "../fb/fb.h"
 #endif 
 
 void
@@ -548,24 +549,37 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     Bool	solid = TRUE;
     DrawablePtr	drawable = &pWin->drawable;
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("START %d BS %d (pR = %ld)\n", what, pWin->backgroundState, ParentRelative);
+    ErrorF("      Rgn: %d %d %d %d\n", prgn->extents.x1, prgn->extents.y1,
+	                               prgn->extents.x2 - prgn->extents.x1,
+	                               prgn->extents.y2 - prgn->extents.y1);
+    ErrorF("      Win: %d %d (%d %d) %d %d\n", pWin->origin.x, pWin->origin.y,
+	                                       pWin->winSize.extents.x1, pWin->winSize.extents.y1,
+	                                       pWin->winSize.extents.x2 - pWin->winSize.extents.x1,
+					       pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
+    ErrorF("     Draw: %d %d %d %d\n", pWin->drawable.x, pWin->drawable.y,
+				       pWin->drawable.width, pWin->drawable.height);
+#endif
+
 #ifdef ROOTLESS
     if(!drawable || drawable->type == UNDRAWABLE_WINDOW)
 	return;
-
-    if(IsFramedWindow(pWin)) {
-        RootlessStartDrawing(pWin);
-        RootlessDamageRegion(pWin, prgn);
-    
-        if(pWin->backgroundState == ParentRelative) {
-            if((what == PW_BACKGROUND) || 
-               (what == PW_BORDER && !pWin->borderIsPixel))
-                RootlessSetPixmapOfAncestors(pWin);
-        }
-    }
 #endif
     
     if (what == PW_BACKGROUND)
     {
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+
+	    if(pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
 	while (pWin->backgroundState == ParentRelative)
 	    pWin = pWin->parent;
 
@@ -587,6 +601,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     {
 	PixmapPtr   pixmap;
 
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+	    
+	    if(!pWin->borderIsPixel &&
+		pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
 	tile_x_off = drawable->x;
 	tile_y_off = drawable->y;
 	
@@ -595,6 +621,12 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 	    return;
 	pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable);
 	drawable = &pixmap->drawable;
+
+#ifdef XQUARTZ_CLIP_DEBUG
+	ErrorF("     Draw: %d %d %d %d\n",
+	       drawable->x, drawable->y, drawable->width, drawable->height);    
+#endif
+	
 #ifdef COMPOSITE
 	draw_x_off = pixmap->screen_x;
 	draw_y_off = pixmap->screen_y;
@@ -657,6 +689,57 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     ChangeGC (NullClient, pGC, gcmask, gcval);
     ValidateGC (drawable, pGC);
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
+#endif
+    
+#ifdef XQUARTZ
+    /* Looks like our clipping isn't set right for some reason:
+     * http://xquartz.macosforge.org/trac/ticket/290
+     */
+    if(what == PW_BORDER) {
+
+#if 0
+	if(solid) {
+#if 1
+	    fbFillRegionSolid(&pWin->drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       pWin->drawable.bitsPerPixel));
+#else
+	    fbFillRegionSolid(drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       drawable->bitsPerPixel));
+#endif
+	    return;
+	}
+#endif
+    
+	pGC->pCompositeClip->extents.x1 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y1 += prgn->extents.y1;
+	pGC->pCompositeClip->extents.x2 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y2 += prgn->extents.y1;
+	
+	if(pGC->pCompositeClip->extents.x2 > drawable->pScreen->width)
+	    pGC->pCompositeClip->extents.x2 = drawable->pScreen->width;
+	if(pGC->pCompositeClip->extents.y2 > drawable->pScreen->height)
+	    pGC->pCompositeClip->extents.y2 = drawable->pScreen->height;
+    }
+#endif
+
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);    
+#endif
+
     numRects = RegionNumRects(prgn);
     pbox = RegionRects(prgn);
     for (i= numRects; --i >= 0; pbox++, prect++)
commit fa425363e3927e86d57f42c4b6e4995d26d6bd0c
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Fri Jul 29 16:12:06 2011 -0700

    randr: Compare all the bytes in RRPostPendingProperties
    
    RRPostPendingProperties tries to compare the pending and current
    property values to decide whether they're actually changing.  However,
    it does this using a memcmp that passes in pending_value->size as the
    number of bytes.  This is actually the number of elements, where each
    element is (pending_value->format / 8) bytes long.  This causes the
    pending value to not be propagated if the first pending_value->size
    bytes are the same and only the end of it is changing.
    
    Fix this by computing the total number of bytes to compare in the
    memcmp.
    
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 08dfff92e8d0c2b1726634392c147f6634d1706d)

diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index ba04c16..61e7bb4 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -283,7 +283,7 @@ RRPostPendingProperties (RROutputPtr output)
 	    pending_value->format == current_value->format &&
 	    pending_value->size == current_value->size &&
 	    !memcmp (pending_value->data, current_value->data,
-		     pending_value->size))
+		     pending_value->size * (pending_value->format / 8)))
 	    continue;
 
 	if (RRChangeOutputProperty (output, property->propertyName,
commit 286af43f66b932af142f4299fc06791291641bf9
Author: Julien Cristau <jcristau at debian.org>
Date:   Sun Jul 31 21:14:59 2011 +0200

    Xquartz: include new localization files in the tarball
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit e87adcc9e024982fdad974de2876b00cf974dab8)

diff --git a/hw/xquartz/bundle/Makefile.am b/hw/xquartz/bundle/Makefile.am
index 8a206cf..87f8dd6 100644
--- a/hw/xquartz/bundle/Makefile.am
+++ b/hw/xquartz/bundle/Makefile.am
@@ -40,6 +40,9 @@ EXTRA_DIST = \
 	Resources/Dutch.lproj/InfoPlist.strings \
 	Resources/Dutch.lproj/Localizable.strings \
 	Resources/Dutch.lproj/main.nib/keyedobjects.nib \
+	Resources/el.lproj/InfoPlist.strings \
+	Resources/el.lproj/Localizable.strings \
+	Resources/el.lproj/main.nib/keyedobjects.nib \
 	Resources/English.lproj/InfoPlist.strings \
 	Resources/English.lproj/Localizable.strings \
 	Resources/English.lproj/main.nib/designable.nib \
@@ -53,6 +56,9 @@ EXTRA_DIST = \
 	Resources/German.lproj/InfoPlist.strings \
 	Resources/German.lproj/Localizable.strings \
 	Resources/German.lproj/main.nib/keyedobjects.nib \
+	Resources/he.lproj/InfoPlist.strings \
+	Resources/he.lproj/Localizable.strings \
+	Resources/he.lproj/main.nib/keyedobjects.nib \
 	Resources/Italian.lproj/InfoPlist.strings \
 	Resources/Italian.lproj/Localizable.strings \
 	Resources/Italian.lproj/main.nib/keyedobjects.nib \
@@ -77,6 +83,9 @@ EXTRA_DIST = \
 	Resources/ru.lproj/InfoPlist.strings \
 	Resources/ru.lproj/Localizable.strings \
 	Resources/ru.lproj/main.nib/keyedobjects.nib \
+	Resources/sk.lproj/InfoPlist.strings \
+	Resources/sk.lproj/Localizable.strings \
+	Resources/sk.lproj/main.nib/keyedobjects.nib \
 	Resources/Spanish.lproj/InfoPlist.strings \
 	Resources/Spanish.lproj/Localizable.strings \
 	Resources/Spanish.lproj/main.nib/keyedobjects.nib \
commit 4fdc6706ca32042edcedc2f831e6f09e1660101b
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Thu Jul 21 10:33:58 2011 -0700

    XQuartz: xpr: Don't FatalError if xp_unlock_window fails
    
    We added the FatalError in 5d1d9d9ae39fab2ee2ac085f9776f82768828dc8 but
    it caused a regression http://xquartz.macosforge.org/trac/ticket/482
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit a1bb5062c72667b2f10b56925c61888acc89e3e4)

diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index 15598e9..931b5c5 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -217,7 +217,7 @@ xprDestroyFrame(RootlessFrameID wid)
 
     err = xp_destroy_window(x_cvt_vptr_to_uint(wid));
     if (err != Success)
-        FatalError("Could not destroy window %i.", (int)x_cvt_vptr_to_uint(wid));
+        FatalError("Could not destroy window %d (%d).", (int)x_cvt_vptr_to_uint(wid), (int)err);
 }
 
 
@@ -360,7 +360,7 @@ xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
     
     err = xp_lock_window(x_cvt_vptr_to_uint(wid), NULL, NULL, data, rowbytes, NULL);
     if (err != Success)
-        FatalError("Could not lock window %i for drawing.", (int)x_cvt_vptr_to_uint(wid));
+        FatalError("Could not lock window %d for drawing (%d).", (int)x_cvt_vptr_to_uint(wid), (int)err);
 
     *pixelData = data[0];
     *bytesPerRow = rowbytes[0];
@@ -377,8 +377,11 @@ xprStopDrawing(RootlessFrameID wid, Bool flush)
     TA_SERVER();
     
     err = xp_unlock_window(x_cvt_vptr_to_uint(wid), flush);
+    /* This should be a FatalError, but we started tripping over it.  Make it a
+     * FatalError after http://xquartz.macosforge.org/trac/ticket/482 is fixed.
+     */
     if(err != Success)
-        FatalError("Could not unlock window %i after drawing.", (int)x_cvt_vptr_to_uint(wid));
+        ErrorF("Could not unlock window %d after drawing (%d).", (int)x_cvt_vptr_to_uint(wid), (int)err);
 }
 
 
commit d97501fffcad67cdc4709514ee98c7b7298df9dc
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Jul 20 00:16:42 2011 -0700

    XQuartz: Use CFSTR to avoid implicit cast warning of NSString * to CFStringRef
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit c319f7b5b3ee651636cdfd165588f0dc972a22a4)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 8762dee..6e9de4b 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1002,7 +1002,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
 
     if (app_prefs_domain_cfstr == NULL) {
         ErrorF("X11ApplicationMain: Unable to determine bundle identifier.  Your installation of XQuartz may be broken.\n");
-        app_prefs_domain_cfstr = @LAUNCHD_ID_PREFIX".X11";
+        app_prefs_domain_cfstr = CFSTR(LAUNCHD_ID_PREFIX".X11");
     }
 
     [NSApp read_defaults];
commit eeb9ce746f8d22f5e967b554e2039a6b2d87d305
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Jul 29 11:03:30 2011 -0700

    configure.ac: Bump version to 1.10.3.901 (1.10.4 RC1)
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 94923db..dac526a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.10.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2011-07-08"
+AC_INIT([xorg-server], 1.10.3.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2011-07-29"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
commit 50a7361cfcb9ef361afe77e283f4fd2a5b6214f5
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 20 09:00:18 2011 +1000

    Initialize the fd to -1 for xorg.conf input devices.
    
    For hotplugged devices, xf86AllocateInput does that for us but the xorg.conf
    path is different. Since not all drivers reset the fd during PreInit but may
    still call close(pInfo->fd) in all cases, this can terminate the logging
    early.
    
    Reproducible: add a wacom driver InputDevice section with no Option Device.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    (cherry picked from commit 3798dd379c1ecf325f9907128fb66d20372f6876)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 114bdc3..58b30dd 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1222,6 +1222,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
 	    devs = xnfrealloc(servlayoutp->inputs,
 			      (count + 1) * sizeof(InputInfoPtr));
             devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
+            Pointer.fd = -1;
 	    *devs[count - 1] = Pointer;
 	    devs[count - 1]->options =
 				xf86addNewOption(devs[count -1]->options,
@@ -1267,6 +1268,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
 	    devs = xnfrealloc(servlayoutp->inputs,
 			      (count + 1) * sizeof(InputInfoPtr));
             devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
+            Pointer.fd = -1;
 	    *devs[count - 1] = Pointer;
 	    devs[count - 1]->options =
 				xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), NULL);
@@ -1363,6 +1365,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
 	    devs = xnfrealloc(servlayoutp->inputs,
 			      (count + 1) * sizeof(InputInfoPtr));
             devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
+            Keyboard.fd = -1;
 	    *devs[count - 1] = Keyboard;
 	    devs[count - 1]->options =
 				xf86addNewOption(devs[count - 1]->options,
commit 2d94a7d8c2223243fd860bd01f6fdeff91856679
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Jul 4 12:34:32 2011 +1000

    xfree86: NULL option values are technically valid, don't strdup them
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    (cherry picked from commit f2a6735cfc07789cca81852b24a85578f200d83d)

diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
index 480f386..a3a836f 100644
--- a/hw/xfree86/common/xf86Option.c
+++ b/hw/xfree86/common/xf86Option.c
@@ -340,7 +340,7 @@ pointer
 xf86AddNewOption(pointer head, const char *name, const char *val)
 {
     /* XXX These should actually be allocated in the parser library. */
-    char *tmp = strdup(val);
+    char *tmp = val ? strdup(val) : NULL;
     char *tmp_name = strdup(name);
 
     return xf86addNewOption(head, tmp_name, tmp);
commit f8f6783b9d4bc4106a33e43a1ddb9c0744e2c741
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Jul 4 14:14:39 2011 +1000

    xfree86: duplicate xorg.conf device information before xf86NewInputDevice
    
    xf86ConfigLayout.inputs contains the information from the xorg.conf
    file. Passing this into xf86NewInputDevice means the device will get
    cleaned up on exit and the pointers in xf86ConfigLayout.inputs are left
    dangling. In the second server generation, this results in a server
    crash.
    
    Also, rename pDev to pInfo. pDev is pretty much reserved for DeviceIntPtr
    types.
    
    Reproducible: AutoAddDevices off and xorg.conf input sections, trigger
    server regeneration.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    (cherry picked from commit f0d7e9db28c374a3db359bcb63a7ce79fd84b541)

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 0b36163..7d9bce9 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -791,6 +791,21 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 				 NULL);
 }
 
+static InputInfoPtr
+duplicateDevice(InputInfoPtr pInfo)
+{
+    InputInfoPtr dup = calloc(1, sizeof(InputInfoRec));
+    if (dup) {
+        dup->name = strdup(pInfo->name);
+        dup->driver = strdup(pInfo->driver);
+        dup->options = xf86OptionListDuplicate(pInfo->options);
+        /* type_name is a const string */
+        dup->type_name = pInfo->type_name;
+        dup->fd = -1;
+    }
+    return dup;
+}
+
 /*
  * InitInput --
  *      Initialize all supported input devices.
@@ -799,7 +814,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 void
 InitInput(int argc, char **argv)
 {
-    InputInfoPtr* pDev;
+    InputInfoPtr* pInfo;
     DeviceIntPtr dev;
 
     xf86Info.vtRequestsPending = FALSE;
@@ -809,14 +824,21 @@ InitInput(int argc, char **argv)
     GetEventList(&xf86Events);
 
     /* Initialize all configured input devices */
-    for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) {
+    for (pInfo = xf86ConfigLayout.inputs; pInfo && *pInfo; pInfo++) {
+        InputInfoPtr dup;
         /* Replace obsolete keyboard driver with kbd */
-        if (!xf86NameCmp((*pDev)->driver, "keyboard")) {
-            strcpy((*pDev)->driver, "kbd");
+        if (!xf86NameCmp((*pInfo)->driver, "keyboard")) {
+            strcpy((*pInfo)->driver, "kbd");
         }
 
+        /* Data passed into xf86NewInputDevice will be freed on shutdown.
+         * Duplicate from xf86ConfigLayout.inputs, otherwise we don't have any
+         * xorg.conf input devices in the second generation
+         */
+        dup = duplicateDevice(*pInfo);
+
         /* If one fails, the others will too */
-        if (xf86NewInputDevice(*pDev, &dev, TRUE) == BadAlloc)
+        if (xf86NewInputDevice(dup, &dev, TRUE) == BadAlloc)
             break;
     }
 
commit e6336c357251836caa4e76e305c066a363e382f6
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Jun 27 16:30:28 2011 +1000

    xfree86: Remove devices that failed to enable on startup
    
    Devices that succeeded during PreInit and DEVICE_INIT but failed in
    DEVICE_ON would be deleted through xf86DeleteInput but not removed from the
    list of input devices (and not turned off). The result was a double free on
    server shutdown.
    
    Fix this by calling RemoveDevice if EnableDevice fails.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    (cherry picked from commit 8ffddbcf72170e246826ee0f39f18989a29fa218)

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 2bac33a..579ee09 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -825,6 +825,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
         {
             OsReleaseSignals();
             xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
+            RemoveDevice(dev, TRUE);
             rval = BadMatch;
             goto unwind;
         }


More information about the Xquartz-changes mailing list