[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'upstream-experimental'



 Xext/geext.c                          |    9 --
 Xi/xiproperty.c                       |    5 +
 configure.ac                          |   10 +-
 fb/fb.h                               |    3 
 fb/fbpict.c                           |  118 +++++-----------------------------
 fb/fbtrap.c                           |    4 -
 hw/xfree86/modes/xf86EdidModes.c      |   15 ++--
 hw/xquartz/mach-startup/bundle-main.c |   36 ++++++----
 hw/xquartz/mach-startup/stub.c        |    1 
 test/input.c                          |   54 +++++++++++++++
 10 files changed, 123 insertions(+), 132 deletions(-)

New commits:
commit 1fff1b37a91c989c046d96d961862d592a307496
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Nov 27 14:58:57 2009 +1000

    xserver 1.7.2
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index 5579795..8500db4 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.7.1.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2009-11-20"
+AC_INIT([xorg-server], 1.7.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2009-11-27"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE

commit 196aff9b18381d700fb28027186cce6e68ad587c
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Tue Nov 24 10:21:28 2009 -0800

    Bug #25136: Revert "Fix clipping when windows are used as sources"
    
    That change causes lib(w)fb to make accelerated driver calls after the driver
    has entered a software fallback.  Most drivers don't expect this, which leads to
    corruption or crashes.  A change to make this code do the copy in software is
    unacceptably slow.
    
    This reverts commit e9aa61e9f0d663d5b34a397b943b4d1df44e873d.
    
    Conflicts:
    
    	configure.ac
    	fb/fbpict.c
    
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/fb/fb.h b/fb/fb.h
index c35e765..6c9f8a1 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -2080,8 +2080,7 @@ fbFillRegionSolid (DrawablePtr	pDrawable,
 
 extern _X_EXPORT pixman_image_t *
 image_from_pict (PicturePtr pict,
-		 Bool       has_clip,
-		 Bool	    is_src);
+		 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 2fbef15..8057e90 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -163,9 +163,9 @@ fbComposite (CARD8      op,
     if (pMask)
 	miCompositeSourceValidate (pMask, xMask, yMask, width, height);
     
-    src = image_from_pict (pSrc, TRUE, TRUE);
-    mask = image_from_pict (pMask, TRUE, TRUE);
-    dest = image_from_pict (pDst, TRUE, FALSE);
+    src = image_from_pict (pSrc, TRUE);
+    mask = image_from_pict (pMask, TRUE);
+    dest = image_from_pict (pDst, TRUE);
 
     if (src && dest && !(pMask && !mask))
     {
@@ -268,80 +268,24 @@ create_conical_gradient_image (PictGradient *gradient)
 	gradient->nstops);
 }
 
-static DrawablePtr 
-copy_drawable (DrawablePtr pDraw)
-{
-    ScreenPtr pScreen = pDraw->pScreen;
-    PixmapPtr pPixmap;
-    GCPtr pGC;
-    int width, height;
-    ChangeGCVal gcv[2];
-    
-    width = pDraw->width;
-    height = pDraw->height;
-    
-    pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pDraw->depth, 0);
-    
-    if (!pPixmap)
-	return NULL;
-    
-    pGC = GetScratchGC (pDraw->depth, pScreen);
-    
-    if (!pGC)
-    {
-	(*pScreen->DestroyPixmap) (pPixmap);
-	return NULL;
-    }
-    
-    /* First fill the pixmap with zeros */
-    gcv[0].val = 0x00000000;
-    gcv[1].val = IncludeInferiors;
-    dixChangeGC (NullClient, pGC, GCBackground | GCSubwindowMode, NULL, gcv);
-    ValidateGC ((DrawablePtr)pPixmap, pGC);
-    miClearDrawable ((DrawablePtr)pPixmap, pGC);
-    
-    /* Then copy the window there */
-    ValidateGC(&pPixmap->drawable, pGC);
-    (* pGC->ops->CopyArea) (pDraw, &pPixmap->drawable, pGC, 0, 0, width, height, 0, 0);
-    
-    FreeScratchGC (pGC);
-    
-    return &pPixmap->drawable;
-}
-
-static void
-destroy_drawable (pixman_image_t *image, void *data)
-{
-    DrawablePtr pDrawable = data;
-    ScreenPtr pScreen = pDrawable->pScreen;
-
-    pScreen->DestroyPixmap ((PixmapPtr)pDrawable);
-}
-
 static pixman_image_t *
 create_bits_picture (PicturePtr pict,
-		     Bool	has_clip,
-		     Bool       is_src)
+		     Bool       has_clip)
 {
     FbBits *bits;
     FbStride stride;
     int bpp, xoff, yoff;
     pixman_image_t *image;
-    DrawablePtr drawable;
-
-    if (is_src && pict->pDrawable->type == DRAWABLE_WINDOW)
-	drawable = copy_drawable (pict->pDrawable);
-    else
-	drawable = pict->pDrawable;
     
-    fbGetDrawable (drawable, bits, stride, bpp, xoff, yoff);
+    fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
 
     bits = (FbBits*)((CARD8*)bits +
-		     (drawable->y + yoff) * stride * sizeof(FbBits) +
-		     (drawable->x + xoff) * (bpp / 8));
+		     (pict->pDrawable->y + yoff) * stride * sizeof(FbBits) +
+		     (pict->pDrawable->x + xoff) * (bpp / 8));
 
     image = pixman_image_create_bits (
-	pict->format, drawable->width, drawable->height,
+	pict->format,
+	pict->pDrawable->width, pict->pDrawable->height,
 	(uint32_t *)bits, stride * sizeof (FbStride));
     
     
@@ -359,46 +303,25 @@ create_bits_picture (PicturePtr pict,
 #endif
 #endif
     
+    /* pCompositeClip is undefined for source pictures, so
+     * only set the clip region for pictures with drawables
+     */
     if (has_clip)
     {
-	if (is_src)
-	{
-	    if (pict->clientClipType != CT_NONE)
-	    {
-		pixman_image_set_has_client_clip (image, TRUE);
+	if (pict->clientClipType != CT_NONE)
+	    pixman_image_set_has_client_clip (image, TRUE);
 
-		pixman_region_translate (pict->clientClip,
-					 pict->clipOrigin.x,
-					 pict->clipOrigin.y);
-		
-		pixman_image_set_clip_region (image, pict->clientClip);
+	pixman_region_translate (pict->pCompositeClip, - pict->pDrawable->x, - pict->pDrawable->y);
 
-		pixman_region_translate (pict->clientClip,
-					 - pict->clipOrigin.x,
-					 - pict->clipOrigin.y);
-	    }
-	}
-	else
-	{
-	    pixman_region_translate (pict->pCompositeClip,
-				     - pict->pDrawable->x,
-				     - pict->pDrawable->y);
+	pixman_image_set_clip_region (image, pict->pCompositeClip);
 
-	    pixman_image_set_clip_region (image, pict->pCompositeClip);
-	    
-	    pixman_region_translate (pict->pCompositeClip,
-				     pict->pDrawable->x,
-				     pict->pDrawable->y);
-	}
+	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);
 
-    if (drawable != pict->pDrawable)
-	pixman_image_set_destroy_function (image, destroy_drawable, drawable);
-    
     return image;
 }
 
@@ -438,7 +361,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
     
     if (pict->alphaMap)
     {
-	pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, TRUE, TRUE);
+	pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, TRUE);
 	
 	pixman_image_set_alpha_map (
 	    image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
@@ -472,8 +395,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
 
 pixman_image_t *
 image_from_pict (PicturePtr pict,
-		 Bool has_clip,
-		 Bool is_src)
+		 Bool has_clip)
 {
     pixman_image_t *image = NULL;
 
@@ -482,7 +404,7 @@ image_from_pict (PicturePtr pict,
 
     if (pict->pDrawable)
     {
-	image = create_bits_picture (pict, has_clip, is_src);
+	image = create_bits_picture (pict, has_clip);
     }
     else if (pict->pSourcePict)
     {
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index b1e1eff..830603a 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -40,7 +40,7 @@ fbAddTraps (PicturePtr	pPicture,
 	    int		ntrap,
 	    xTrap	*traps)
 {
-    pixman_image_t *image = image_from_pict (pPicture, FALSE, FALSE);
+    pixman_image_t *image = image_from_pict (pPicture, FALSE);
 
     if (!image)
 	return;
@@ -56,7 +56,7 @@ fbRasterizeTrapezoid (PicturePtr    pPicture,
 		      int	    x_off,
 		      int	    y_off)
 {
-    pixman_image_t *image = image_from_pict (pPicture, FALSE, FALSE);
+    pixman_image_t *image = image_from_pict (pPicture, FALSE);
 
     if (!image)
 	return;

commit 8eca8eaef56526b9649b48aa5f83c3d7914cfdc4
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Nov 24 15:31:48 2009 +1000

    Xi: when deleting all properties, reset property handler to NULL.
    
    Trying to unregister property handlers during the device closure process
    leads to invalid memory accesses.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit 1b127ab8429616adf9ec31ba4d8bdd9af6e104a9)

diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 4821857..ecb326e 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -630,6 +630,8 @@ XIDeleteAllDeviceProperties (DeviceIntPtr device)
         xfree(curr_handler);
         curr_handler = next_handler;
     }
+
+    device->properties.handlers = NULL;
 }
 
 
diff --git a/test/input.c b/test/input.c
index 71e1504..2de55bc 100644
--- a/test/input.c
+++ b/test/input.c
@@ -716,6 +716,59 @@ static void include_byte_padding_macros(void)
 
 }
 
+static void xi_unregister_handlers(void)
+{
+    DeviceIntRec dev;
+    int handler;
+
+    memset(&dev, 0, sizeof(dev));
+
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 1);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 2);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 3);
+
+    g_test_message("Unlinking from front.");
+
+    XIUnregisterPropertyHandler(&dev, 4); /* NOOP */
+    g_assert(dev.properties.handlers->id == 3);
+    XIUnregisterPropertyHandler(&dev, 3);
+    g_assert(dev.properties.handlers->id == 2);
+    XIUnregisterPropertyHandler(&dev, 2);
+    g_assert(dev.properties.handlers->id == 1);
+    XIUnregisterPropertyHandler(&dev, 1);
+    g_assert(dev.properties.handlers == NULL);
+
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 4);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 5);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 6);
+    XIUnregisterPropertyHandler(&dev, 3); /* NOOP */
+    g_assert(dev.properties.handlers->next->next->next == NULL);
+    XIUnregisterPropertyHandler(&dev, 4);
+    g_assert(dev.properties.handlers->next->next == NULL);
+    XIUnregisterPropertyHandler(&dev, 5);
+    g_assert(dev.properties.handlers->next == NULL);
+    XIUnregisterPropertyHandler(&dev, 6);
+    g_assert(dev.properties.handlers == NULL);
+
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 7);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 8);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 9);
+
+    XIDeleteAllDeviceProperties(&dev);
+    g_assert(dev.properties.handlers == NULL);
+    XIUnregisterPropertyHandler(&dev, 7); /* NOOP */
+
+}
+
 int main(int argc, char** argv)
 {
     g_test_init(&argc, &argv,NULL);
@@ -727,6 +780,7 @@ int main(int argc, char** argv)
     g_test_add_func("/dix/input/xi2-struct-sizes", xi2_struct_sizes);
     g_test_add_func("/dix/input/grab_matching", dix_grab_matching);
     g_test_add_func("/include/byte_padding_macros", include_byte_padding_macros);
+    g_test_add_func("/Xi/xiproperty/register-unregister", xi_unregister_handlers);
 
     return g_test_run();
 }

commit 9998105a387e0294054502331a56e1e020cd93e4
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Nov 17 09:25:47 2009 +1000

    Move xdmxconfig modules into DMX conditionals (#25102)
    
    xdmxconfig requires additional modules not checked for if Xdmx build is set
    to auto (the default). This may lead to build errors if the Xdmx modules are
    installed, but not the extra ones required for xdmxconfig.
    
    X.Org Bug 25102 <http://bugs.freedesktop.org/show_bug.cgi?id=25102>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Remi Cardona <remi@gentoo.org>
    Acked-by: Julien Cristau <jcristau@debian.org>
    (cherry picked from commit 8806375ed72a3cd465fe0a49ead079a334accd6b)

diff --git a/configure.ac b/configure.ac
index cfe8e59..5579795 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1808,10 +1808,11 @@ AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"])
 AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes])
 
 dnl DMX DDX
-
 PKG_CHECK_MODULES([DMXMODULES],
     [xmuu $LIBXEXT x11 xrender xfixes xfont $LIBXI $DMXPROTO xau $XDMCP_MODULES],
-    [have_dmx=yes], [have_dmx=no])
+    PKG_CHECK_MODULES([XDMXCONFIG_DEP], [xaw7 xmu xt xpm x11], [have_dmx=yes],
+                      [have_dmx=no]),
+    [have_dmx=no])
 AC_MSG_CHECKING([whether to build Xdmx DDX])
 if test "x$DMX" = xauto; then
 	DMX="$have_dmx"
@@ -1842,7 +1843,6 @@ dnl USB sources in DMX require <linux/input.h>
 dnl Linux sources in DMX require <linux/keyboard.h>
 	AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes",
 			DMX_BUILD_LNX="no")
-	PKG_CHECK_MODULES([XDMXCONFIG_DEP], [xaw7 xmu xt xpm x11])
 	AC_SUBST(XDMXCONFIG_DEP_CFLAGS)
 	AC_SUBST(XDMXCONFIG_DEP_LIBS)
 	PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11])

commit 18dcc102ac12a4b18c60b5dbabbc4d5debfe5556
Author: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Date:   Tue Nov 17 17:13:43 2009 +0200

    Xext: Fix a memory leak on GE client disconnect.
    
    Add a call to dixRequestPrivate to inform dixFreePrivates that memory
    allocated in GEClientCallback should be released when client
    disconnects. Otherwise there is a leak of sizeof(GEClientInfoRec) for
    every client connect/disconnect.
    
    Also remove the explicit allocation and let GEGetClient /
    dixLookupPrivate do it. This makes GEClientCallback similar to the
    other extension callbacks.
    
    Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit eb967ca36cfe0409972ac987a74d498cd6f6bafb)

diff --git a/Xext/geext.c b/Xext/geext.c
index 6fad4ae..2ba0ca8 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -168,12 +168,6 @@ GEClientCallback(CallbackListPtr *list,
     ClientPtr		pClient = clientinfo->client;
     GEClientInfoPtr     pGEClient = GEGetClient(pClient);
 
-    if (pGEClient == NULL)
-    {
-        pGEClient = xcalloc(1, sizeof(GEClientInfoRec));
-        dixSetPrivate(&pClient->devPrivates, GEClientPrivateKey, pGEClient);
-    }
-
     pGEClient->major_version = 0;
     pGEClient->minor_version = 0;
 }
@@ -222,6 +216,9 @@ GEExtensionInit(void)
 {
     ExtensionEntry *extEntry;
 
+    if (!dixRequestPrivate(GEClientPrivateKey, sizeof(GEClientInfoRec)))
+        FatalError("GEExtensionInit: GE private request failed.\n");
+
     if(!AddCallback(&ClientStateCallback, GEClientCallback, 0))
     {
         FatalError("GEExtensionInit: register client callback failed.\n");

commit b8904935bbd26e9d34587f03810318d94cb771f6
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Nov 23 13:07:56 2009 +1000

    Xi: don't crash when deleting invalid device properties.
    
    Deleting a property that was not set on a device leads to a null-pointer
    reference. The protocol allows deleting those properties - it has to be a
    noop.
    
    Reproducible:
    xinput --set-prop "My device" --type=int --format=8 "my property" 1
    xinput --delete-prop "My other device" "my property"
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit a30e739a144912a68adcaa9f426d600c6ecbd529)

diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 024dc44..4821857 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -643,6 +643,9 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
         if (prop->propertyName == property)
             break;
 
+    if (!prop)
+        return Success;
+
     if (fromClient && !prop->deletable)
         return BadAccess;
 

commit a5308ceb127bf390cbe6fef3ba1e33e78f222ba1
Author: Zhao Yakui <yakui.zhao@intel.com>
Date:   Fri Nov 20 14:43:35 2009 +0800

    xfree86: Edid quirk for Philips LCD LP154W01
    
    v1->v2: Make one condition case for one quirk instead of merging them
    together. This is based on the Keithp's suggestion.
    
    Move the EDID quirk for Philips LCD LP154W01 as the panel reports the vertical
    size in cm.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=24482
    
    Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit 19f7c15e2008dab3c46ba3e14dfa353d01c74f72)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 45e28dc..b057d7d 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -160,6 +160,16 @@ static Bool quirk_detailed_v_in_cm (int scrnIndex, xf86MonPtr DDC)
 	DDC->vendor.prod_id == 47360)
 	return TRUE;
 
+    /* Bug #10304: LGPhilipsLCD LP154W01-A5 */
+    if (memcmp(DDC->vendor.name, "LPL", 4) == 0 &&
+	DDC->vendor.prod_id == 0)
+	return TRUE;
+
+    /* Bug #24482: LGPhilipsLCD LP154W01-TLA1 */
+    if (memcmp(DDC->vendor.name, "LPL", 4) == 0 &&
+	DDC->vendor.prod_id == 0x2a00)
+	return TRUE;
+
     /* Bug #21750: Samsung Syncmaster 2333HD */
     if (memcmp (DDC->vendor.name, "SAM", 4) == 0 &&
 	DDC->vendor.prod_id == 1157)
@@ -170,11 +180,6 @@ static Bool quirk_detailed_v_in_cm (int scrnIndex, xf86MonPtr DDC)
 
 static Bool quirk_detailed_use_maximum_size (int scrnIndex, xf86MonPtr DDC)
 {
-    /* Bug #10304: LGPhilipsLCD LP154W01-A5 */
-    if (memcmp (DDC->vendor.name, "LPL", 4) == 0 &&
-	(DDC->vendor.prod_id == 0 || DDC->vendor.prod_id == 0x2a00))
-	return TRUE;
-
     /* Bug #21324: Iiyama Vision Master 450 */
     if (memcmp (DDC->vendor.name, "IVM", 4) == 0 &&
 	DDC->vendor.prod_id == 6400)

commit b466329c111c4b6696508b3c2c8a60c9fbc90157
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Mon Nov 23 16:33:00 2009 -0800

    XQuartz: Allow better compatability with older versions of xinit
    
    If we are id="org.x" and the launchd socket is ":0", we will claim
    the socket to match the old behavior before we prefixed the
    socket name with our id.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
    (cherry picked from commit 4677b5a80025b50ba2a3e953fd487a549586ae9f)

diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 640a91f..0366f3b 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -333,8 +333,10 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv,
     /* If we didn't get handed a launchd DISPLAY socket, we should
      * unset DISPLAY or we can run into problems with pbproxy
      */
-    if(!launchd_socket_handed_off)
+    if(!launchd_socket_handed_off) {
+        fprintf(stderr, "X11.app: No launchd socket handed off, unsetting DISPLAY\n");
         unsetenv("DISPLAY");
+    }
     
     if(!_argv || !_envp) {
         return KERN_FAILURE;
@@ -473,7 +475,7 @@ static void setup_env(void) {
 
     server_bootstrap_name = malloc(sizeof(char) * (strlen(pds) + 1));
     if(!server_bootstrap_name) {
-        fprintf(stderr, "Memory allocation error.\n");
+        fprintf(stderr, "X11.app: Memory allocation error.\n");
         exit(1);
     }
     strcpy(server_bootstrap_name, pds);
@@ -482,7 +484,7 @@ static void setup_env(void) {
     len = strlen(server_bootstrap_name);
     launchd_id_prefix = malloc(sizeof(char) * (len - 3));
     if(!launchd_id_prefix) {
-        fprintf(stderr, "Memory allocation error.\n");
+        fprintf(stderr, "X11.app: Memory allocation error.\n");
         exit(1);
     }
     strlcpy(launchd_id_prefix, server_bootstrap_name, len - 3);
@@ -497,21 +499,27 @@ static void setup_env(void) {
         }
 
         if(s && *s) {
-            temp = (char *)malloc(sizeof(char) * len);
-            if(!temp) {
-                fprintf(stderr, "Memory allocation error creating space for socket name test.\n");
-                exit(1);
-            }
-            strlcpy(temp, launchd_id_prefix, len);
-            strlcat(temp, ":0", len);
+            if(strcmp(launchd_id_prefix, "org.x") == 0 && strcmp(s, ":0") == 0) {
+                fprintf(stderr, "X11.app: Detected old style launchd DISPLAY, please update xinit.\n");
+            } else {
+                temp = (char *)malloc(sizeof(char) * len);
+                if(!temp) {
+                    fprintf(stderr, "X11.app: Memory allocation error creating space for socket name test.\n");
+                    exit(1);
+                }
+                strlcpy(temp, launchd_id_prefix, len);
+                strlcat(temp, ":0", len);
             
-            if(strcmp(temp, s) != 0) {
-                /* If we don't have a match, unset it. */
-                unsetenv("DISPLAY");
+                if(strcmp(temp, s) != 0) {
+                    /* If we don't have a match, unset it. */
+                    fprintf(stderr, "X11.app: DISPLAY (\"%s\") does not match our id (\"%s\"), unsetting.\n", disp, launchd_id_prefix);
+                    unsetenv("DISPLAY");
+                }
+                free(temp);
             }
-            free(temp);
         } else {
             /* The DISPLAY environment variable is not formatted like a launchd socket, so reset. */
+            fprintf(stderr, "X11.app: DISPLAY does not look like a launchd set variable, unsetting.\n");
             unsetenv("DISPLAY");
         }
     }
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index 8f67035..af1c59e 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -232,6 +232,7 @@ int main(int argc, char **argv, char **envp) {
 
     kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp);
     if(kr != KERN_SUCCESS) {
+        fprintf(stderr, "Xquartz: Unable to locate waiting server: %s\n", server_bootstrap_name);
         pid_t child;
         set_x11_path();
 


Reply to: