[Xquartz-changes] xserver: Branch 'server-1.8-apple' - 41 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Tue Mar 23 10:36:17 PDT 2010


Rebased ref, commits from common ancestor:
commit 6a891765bda04f172369eab3c45cf6c04aecf01a
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 02d6c03..ed21f9e 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -2082,11 +2082,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 dddfce8..07a2286 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -158,24 +158,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);
     }
 
@@ -275,22 +270,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));
     
     
@@ -316,52 +311,30 @@ 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 void
-set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
+set_image_properties (pixman_image_t *image, PicturePtr pict)
 {
     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)
@@ -388,8 +361,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
     
     if (pict->alphaMap)
     {
-	int alpha_xoff, alpha_yoff;
-	pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff);
+	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);
@@ -422,7 +394,8 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
 }
 
 pixman_image_t *
-image_from_pict (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
+image_from_pict (PicturePtr pict,
+		 Bool has_clip)
 {
     pixman_image_t *image = NULL;
 
@@ -431,7 +404,7 @@ image_from_pict (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)
     {
@@ -452,11 +425,10 @@ image_from_pict (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);
+	set_image_properties (image, pict);
     
     return image;
 }
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index 515e2e1..830603a 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -40,8 +40,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;
@@ -57,8 +56,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 e081ef1d26c03a38da58f1eacf21ebe8fff5a7d9
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Mon Mar 22 14:20:56 2010 -0700

    XKB: Fix garbage initialization
    
    XkbEnableDisableControls set extra garbage bits on the xkbControlsNotify
    changedControls mask because it was uninitialized on the stack.
    
    Found by clang
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 5b317c9..e287997 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -753,7 +753,7 @@ XkbSrvLedInfoPtr	sli;
     if (cause!=NULL) {
 	xkbControlsNotify cn;
 	cn.numGroups= ctrls->num_groups;
-	cn.changedControls|= XkbControlsEnabledMask;
+	cn.changedControls= XkbControlsEnabledMask;
 	cn.enabledControls= ctrls->enabled_ctrls;
 	cn.enabledControlChanges= (ctrls->enabled_ctrls^old);
 	cn.keycode= cause->kc;
commit 5303287b0e5d82caaaa2d48296a4031b019c51c0
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Mon Mar 22 09:33:09 2010 -0700

    GLX: Fix initialization of some glXDispSwap requests
    
    __glXDispSwap_DestroyPbuffer
    __glXDispSwap_DestroyGLXPbufferSGIX
    __glXDispSwap_ChangeDrawableAttributes
    __glXDispSwap_ChangeDrawableAttributesSGIX
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Ian Romanick <idr at freedesktop.org>

diff --git a/glx/glxcmdsswap.c b/glx/glxcmdsswap.c
index f1c0ce6..c414dc8 100644
--- a/glx/glxcmdsswap.c
+++ b/glx/glxcmdsswap.c
@@ -354,7 +354,7 @@ int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
 
 int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
 {
-    xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) req;
+    xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
     __GLX_DECLARE_SWAP_VARIABLES;
 
     __GLX_SWAP_INT(&req->pbuffer);
@@ -364,7 +364,7 @@ int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
 
 int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
 {
-    xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) req;
+    xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
     __GLX_DECLARE_SWAP_VARIABLES;
 
     __GLX_SWAP_INT(&req->pbuffer);
@@ -375,7 +375,7 @@ int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
 int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXChangeDrawableAttributesReq *req =
-	(xGLXChangeDrawableAttributesReq *) req;
+	(xGLXChangeDrawableAttributesReq *) pc;
     __GLX_DECLARE_SWAP_VARIABLES;
     __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
     CARD32 *attribs;
@@ -392,7 +392,7 @@ int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState *cl,
 					       GLbyte *pc)
 {
     xGLXChangeDrawableAttributesSGIXReq *req =
-	(xGLXChangeDrawableAttributesSGIXReq *) req;
+	(xGLXChangeDrawableAttributesSGIXReq *) pc;
     __GLX_DECLARE_SWAP_VARIABLES;
     __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
     CARD32 *attribs;
commit 1c307d64d74ae8719680afcb750840851d33161f
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Mon Mar 22 09:30:51 2010 -0700

    GLX: Remove a redundant initialization
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/glx/indirect_dispatch.c b/glx/indirect_dispatch.c
index 6665519..ecd2bc8 100644
--- a/glx/indirect_dispatch.c
+++ b/glx/indirect_dispatch.c
@@ -98,8 +98,6 @@ void __glXDisp_CallLists(GLbyte * pc)
     const GLenum type = *(GLenum   *)(pc +  4);
     const GLvoid * lists =  (const GLvoid *)(pc +  8);
 
-    lists = (const GLvoid *) (pc + 8);
-
     CALL_CallLists( GET_DISPATCH(), (
         n,
         type,
commit 3083c5d0c4386cdd7083b7a83ac72fdad2f1e61e
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Mon Mar 22 18:01:17 2010 +0100

    Xext: Fix cursor reference counting hazard.
    
    Make sure the reference count of the new cursor is increased before the old
    one is decreased, otherwise bad things will happen if they're one and the
    same and the reference count is 1 initially. Not sure this can actually happen
    here, but better safe than sorry.
    
    Signed-off-by: Michel Dänzer <daenzer at vmware.com>
    Reviewed-by: Roland Scheidegger <sroland at vmware.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/saver.c b/Xext/saver.c
index 2549e8a..aa2e614 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -620,10 +620,10 @@ CreateSaverWindow (ScreenPtr pScreen)
     	    	FreeResource (pWin->drawable.id, RT_NONE);
     	    	return FALSE;
 	    }
+	pAttr->pCursor->refcnt++;
 	if (pWin->optional->cursor)
 	    FreeCursor (pWin->optional->cursor, (Cursor)0);
 	pWin->optional->cursor = pAttr->pCursor;
-	pAttr->pCursor->refcnt++;
 	pWin->cursorIsNone = FALSE;
 	CheckWindowOptionalNeed (pWin);
 	mask |= CWCursor;
commit b29220dc765cb6f878c5466e00e4bd21f3bd803d
Merge: c3da766... ed31d50...
Author: Keith Packard <keithp at keithp.com>
Date:   Sun Mar 21 23:01:58 2010 -0700

    Merge remote branch 'jeremyhu/master'

commit c3da76643aeebdd24047e3e14a860507eac37ec3
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Thu Mar 18 23:19:20 2010 -0500

    Cygwin/X: Make X -> XWin symlink during install
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 0577300..89b021b 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -194,6 +194,9 @@ xwinconfig_DATA = system.XWinrc
 
 include $(top_srcdir)/cpprules.in
 
+install-exec-hook:
+	(cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) XWin$(EXEEXT) X)
+
 EXTRA_DIST = \
 	$(GLX_EXTRAS) \
 	$(MAN_SRCS) \
commit abf4e0b7e349b0238b2b97a16b8a308b5026af31
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Mon Mar 22 00:44:28 2010 -0500

    New header for XF86Bigfont server functions
    
    Xext/xf86bigfont.c contains three non-static functions which are called
    elsewhere in the server.  This creates a new header containing these
    declarations in order to fix several warnings:
    
    xf86bigfont.c:285: warning: no previous prototype for `XF86BigfontFreeFontShm'
    dixfonts.c:502: warning: implicit declaration of function `XF86BigfontFreeFontS$
    dixfonts.c:502: warning: nested extern declaration of `XF86BigfontFreeFontShm'
    log.c:436: warning: implicit declaration of function `XF86BigfontCleanup'
    log.c:436: warning: nested extern declaration of `XF86BigfontCleanup'
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index 193d6e5..53cbc1f 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -107,7 +107,7 @@ MODULE_SRCS  += $(MULTIBUFFER_SRCS)
 endif
 
 # XF86 Big Font extension
-BIGFONT_SRCS = xf86bigfont.c
+BIGFONT_SRCS = xf86bigfont.c xf86bigfontsrv.h
 if XF86BIGFONT
 BUILTIN_SRCS += $(BIGFONT_SRCS)
 endif
diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index ce33fda..a4eb3f6 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -74,6 +74,7 @@
 #include "protocol-versions.h"
 
 #include <X11/extensions/xf86bigfproto.h>
+#include "xf86bigfontsrv.h"
 
 static void XF86BigfontResetProc(
     ExtensionEntry *	/* extEntry */
diff --git a/Xext/xf86bigfontsrv.h b/Xext/xf86bigfontsrv.h
new file mode 100644
index 0000000..2c78dc4
--- /dev/null
+++ b/Xext/xf86bigfontsrv.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright © 2010 Yaakov Selkowitz
+ *
+ * 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 (including the
+ * next paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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 _XF86BIGFONTSRV_H_
+#define _XF86BIGFONTSRV_H_
+
+#include <X11/fonts/font.h>
+
+extern void XFree86BigfontExtensionInit(void);
+extern void XF86BigfontFreeFontShm(FontPtr);
+extern void XF86BigfontCleanup(void);
+
+#endif
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 329318d..6dc8193 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -71,8 +71,7 @@ Equipment Corporation.
 #endif
 
 #ifdef XF86BIGFONT
-#define _XF86BIGFONT_SERVER_
-#include <X11/extensions/xf86bigfont.h>
+#include "xf86bigfontsrv.h"
 #endif
 
 #define QUERYCHARINFO(pci, pr)  *(pr) = (pci)->metrics
diff --git a/os/log.c b/os/log.c
index 0002e59..f4832c1 100644
--- a/os/log.c
+++ b/os/log.c
@@ -99,8 +99,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
 #endif
 
 #ifdef XF86BIGFONT
-#define _XF86BIGFONT_SERVER_
-#include <X11/extensions/xf86bigfont.h>
+#include "xf86bigfontsrv.h"
 #endif
 
 #ifdef DDXOSVERRORF
commit 57a049ea89b008c0b60316c3b6e6ff5c8fbd4cad
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Thu Mar 18 04:46:20 2010 -0500

    Xext: fix old-style function definitions in xf86bigfont.c
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index ba8b603..ce33fda 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -143,7 +143,7 @@ CheckForShmSyscall(void)
 #endif
 
 void
-XFree86BigfontExtensionInit()
+XFree86BigfontExtensionInit(void)
 {
     if (AddExtension(XF86BIGFONTNAME,
 		     XF86BigfontNumberEvents,
@@ -302,7 +302,7 @@ XF86BigfontFreeFontShm(
 
 /* Called upon fatal signal. */
 void
-XF86BigfontCleanup()
+XF86BigfontCleanup(void)
 {
 #ifdef HAS_SHM
     while (ShmList)
commit 822b9f9a3e822df8848995eda246f83864d1366f
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Sun Feb 21 01:24:44 2010 -0600

    mi: remove deprecated #include <X11/extensions/xf86bigfstr.h> in miinitext.c
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/mi/miinitext.c b/mi/miinitext.c
index 2a67fd3..692be86 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -185,7 +185,7 @@ typedef void (*InitExtension)(INITARGS);
 #include <X11/extensions/panoramiXproto.h>
 #endif
 #ifdef XF86BIGFONT
-#include <X11/extensions/xf86bigfstr.h>
+#include <X11/extensions/xf86bigfproto.h>
 #endif
 #ifdef RES
 #include <X11/extensions/XResproto.h>
commit 946b49ebcbf47e030a6e00ce1a699f3b055f638a
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Wed Mar 17 17:37:05 2010 -0500

    Catch errors in recursive relink targets
    
    If make relink fails in a subdirectory, we need to catch the error
    otherwise make will continue iterating the 'for' loop.
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>

diff --git a/hw/Makefile.am b/hw/Makefile.am
index 92b007a..6c2cc6b 100644
--- a/hw/Makefile.am
+++ b/hw/Makefile.am
@@ -38,4 +38,4 @@ SUBDIRS =			\
 DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive
 
 relink:
-	$(AM_V_at)for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink ; done
+	$(AM_V_at)for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done
diff --git a/hw/kdrive/Makefile.am b/hw/kdrive/Makefile.am
index 55d940f..471ca89 100644
--- a/hw/kdrive/Makefile.am
+++ b/hw/kdrive/Makefile.am
@@ -27,4 +27,4 @@ SUBDIRS =			\
 DIST_SUBDIRS = fbdev ephyr src linux fake
 
 relink:
-	$(AM_V_at)for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink ; done
+	$(AM_V_at)for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done
commit 0820a6e2fb005b5f856dda25e1644f34fc994129
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Wed Mar 17 13:40:41 2010 -0500

    Fix .man.N targets for AM_SILENT_RULES
    
    Add $(AM_V_GEN) for sed-based rules so they appear as expected with
    automake silent rules, and $(AM_V_at) to completely hide cp/ln/rm
    commands which are not prone to fail.
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/doc/Makefile.am b/doc/Makefile.am
index bee64b6..2ff683c 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -14,9 +14,9 @@ CLEANFILES = $(appman_PROCESSED) $(appman_DATA)
 include $(top_srcdir)/cpprules.in
 
 .man.$(APP_MAN_SUFFIX):
-	cp $< $@
+	$(AM_V_at)cp $< $@
 
-EXTRAMANDEFS = -D__default_font_path__="`echo $(COMPILEDDEFAULTFONTPATH) | sed -e 's/,/, /g'`"
+EXTRAMANDEFS = -D__default_font_path__="`echo $(COMPILEDDEFAULTFONTPATH) | $(SED) -e 's/,/, /g'`"
 
 # Docs about X server internals that we ship with source but don't install
 DEVEL_DOCS = smartsched
diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index fc9fde7..0d06346 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -109,7 +109,7 @@ MAN_SUBSTS = \
 SUFFIXES = .$(APP_MAN_SUFFIX) .man
 
 .man.$(APP_MAN_SUFFIX):
-	$(SED) $(MAN_SUBSTS) < $< > $@
+	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
 
 EXTRA_DIST = $(appman_PRE)
 
diff --git a/hw/dmx/config/Makefile.am b/hw/dmx/config/Makefile.am
index 7de745f..25a814e 100644
--- a/hw/dmx/config/Makefile.am
+++ b/hw/dmx/config/Makefile.am
@@ -69,7 +69,7 @@ XORGRELSTRING = @PACKAGE_STRING@
 MAN_SUBSTS = -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' 
 
 .man.$(APP_MAN_SUFFIX):
-	$(SED) $(MAN_SUBSTS) < $< > $@
+	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
 
 EXTRA_DIST = \
 	$(appman_PRE) \
diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index d1dd630..8646703 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -89,8 +89,8 @@ appmandir = $(APP_MAN_DIR)
 appman_DATA = Xephyr.$(APP_MAN_SUFFIX)
 
 Xephyr.$(APP_MAN_SUFFIX): Xephyr.man
-	-rm -f Xephyr.$(APP_MAN_SUFFIX)
-	$(LN_S) Xephyr.man Xephyr.$(APP_MAN_SUFFIX)
+	-$(AM_V_at)rm -f Xephyr.$(APP_MAN_SUFFIX)
+	$(AM_V_at)$(LN_S) Xephyr.man Xephyr.$(APP_MAN_SUFFIX)
 
 include $(top_srcdir)/cpprules.in
 
diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am
index a183824..4ac0c8f 100644
--- a/hw/vfb/Makefile.am
+++ b/hw/vfb/Makefile.am
@@ -43,8 +43,8 @@ CLEANFILES = $(appman_PRE) $(appman_DATA)
 SUFFIXES += .$(APP_MAN_SUFFIX) .man
 
 .man.$(APP_MAN_SUFFIX):
-	-rm -f $@
-	$(LN_S) $< $@
+	-$(AM_V_at)rm -f $@
+	$(AM_V_at)$(LN_S) $< $@
 
 EXTRA_DIST = Xvfb.man.pre
 
diff --git a/hw/xfree86/doc/man/Makefile.am b/hw/xfree86/doc/man/Makefile.am
index d8b2aa7..737166b 100644
--- a/hw/xfree86/doc/man/Makefile.am
+++ b/hw/xfree86/doc/man/Makefile.am
@@ -8,12 +8,12 @@ filemandir = $(FILE_MAN_DIR)
 fileman_DATA = xorg.conf.$(FILE_MAN_SUFFIX)
 
 Xorg.$(APP_MAN_SUFFIX): Xorg.man
-	-rm -f Xorg.$(APP_MAN_SUFFIX)
-	$(LN_S) Xorg.man Xorg.$(APP_MAN_SUFFIX)
+	-$(AM_V_at)rm -f Xorg.$(APP_MAN_SUFFIX)
+	$(AM_V_at)$(LN_S) Xorg.man Xorg.$(APP_MAN_SUFFIX)
 
 xorg.conf.$(FILE_MAN_SUFFIX): xorg.conf.man
-	-rm -f xorg.conf.$(FILE_MAN_SUFFIX)
-	$(LN_S) xorg.conf.man xorg.conf.$(FILE_MAN_SUFFIX)
+	-$(AM_V_at)rm -f xorg.conf.$(FILE_MAN_SUFFIX)
+	$(AM_V_at)$(LN_S) xorg.conf.man xorg.conf.$(FILE_MAN_SUFFIX)
 
 include $(top_srcdir)/cpprules.in
 
diff --git a/hw/xfree86/exa/Makefile.am b/hw/xfree86/exa/Makefile.am
index 9eb2e17..da9b720 100644
--- a/hw/xfree86/exa/Makefile.am
+++ b/hw/xfree86/exa/Makefile.am
@@ -22,7 +22,7 @@ driverman_DATA = exa.$(DRIVER_MAN_SUFFIX)
 CLEANFILES = $(driverman_DATA) exa.man
 
 exa.$(DRIVER_MAN_SUFFIX): exa.man
-	-rm -f exa.$(DRIVER_MAN_SUFFIX)
-	$(LN_S) exa.man exa.$(DRIVER_MAN_SUFFIX)
+	-$(AM_V_at)rm -f exa.$(DRIVER_MAN_SUFFIX)
+	$(AM_V_at)$(LN_S) exa.man exa.$(DRIVER_MAN_SUFFIX)
 
 EXTRA_DIST = exa.man.pre
diff --git a/hw/xfree86/fbdevhw/Makefile.am b/hw/xfree86/fbdevhw/Makefile.am
index 6a4a6e4..0663525 100644
--- a/hw/xfree86/fbdevhw/Makefile.am
+++ b/hw/xfree86/fbdevhw/Makefile.am
@@ -22,7 +22,7 @@ driverman_DATA = fbdevhw.$(DRIVER_MAN_SUFFIX)
 CLEANFILES = $(driverman_DATA) fbdevhw.man
 
 fbdevhw.$(DRIVER_MAN_SUFFIX): fbdevhw.man
-	-rm -f fbdevhw.$(DRIVER_MAN_SUFFIX)
-	$(LN_S) fbdevhw.man fbdevhw.$(DRIVER_MAN_SUFFIX)
+	-$(AM_V_at)rm -f fbdevhw.$(DRIVER_MAN_SUFFIX)
+	$(AM_V_at)$(LN_S) fbdevhw.man fbdevhw.$(DRIVER_MAN_SUFFIX)
 
 EXTRA_DIST = fbpriv.h fbdevhw.man.pre README
diff --git a/hw/xfree86/utils/gtf/Makefile.am b/hw/xfree86/utils/gtf/Makefile.am
index 3ca568d..d1a6d61 100644
--- a/hw/xfree86/utils/gtf/Makefile.am
+++ b/hw/xfree86/utils/gtf/Makefile.am
@@ -40,5 +40,5 @@ CLEANFILES = $(appman_PRE) $(appman_DATA)
 SUFFIXES += .$(APP_MAN_SUFFIX) .man
 
 .man.$(APP_MAN_SUFFIX):
-	-rm -f $@
-	$(LN_S) $< $@
+	-$(AM_V_at)rm -f $@
+	$(AM_V_at)$(LN_S) $< $@
diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am
index 877ab8b..666a0f0 100644
--- a/hw/xnest/Makefile.am
+++ b/hw/xnest/Makefile.am
@@ -85,8 +85,8 @@ CLEANFILES = $(appman_PRE) $(appman_DATA)
 SUFFIXES += .$(APP_MAN_SUFFIX) .man
 
 .man.$(APP_MAN_SUFFIX):
-	-rm -f $@
-	$(LN_S) $< $@
+	-$(AM_V_at)rm -f $@
+	$(AM_V_at)$(LN_S) $< $@
 
 relink:
 	$(AM_V_at)rm -f Xnest$(EXEEXT) && $(MAKE) Xnest$(EXEEXT)
diff --git a/hw/xquartz/doc/Makefile.am b/hw/xquartz/doc/Makefile.am
index b812af1..7310de3 100644
--- a/hw/xquartz/doc/Makefile.am
+++ b/hw/xquartz/doc/Makefile.am
@@ -8,7 +8,7 @@ CLEANFILES = $(appman_PROCESSED) $(appman_DATA)
 include $(top_srcdir)/cpprules.in
 
 .man.$(APP_MAN_SUFFIX):
-	cp $< $@
+	$(AM_V_at)cp $< $@
 
 EXTRA_DIST = \
 	Xquartz.man.pre
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 41a4515..0577300 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -180,12 +180,12 @@ filemandir = $(FILE_MAN_DIR)
 fileman_DATA = XWinrc.$(FILE_MAN_SUFFIX)
 
 XWin.$(APP_MAN_SUFFIX): XWin.man
-	-rm -f XWin.$(APP_MAN_SUFFIX)
-	$(LN_S) XWin.man XWin.$(APP_MAN_SUFFIX)
+	-$(AM_V_at)rm -f XWin.$(APP_MAN_SUFFIX)
+	$(AM_V_at)$(LN_S) XWin.man XWin.$(APP_MAN_SUFFIX)
 
 XWinrc.$(FILE_MAN_SUFFIX): XWinrc.man
-	-rm -f XWinrc.$(FILE_MAN_SUFFIX)
-	$(LN_S) XWinrc.man XWinrc.$(FILE_MAN_SUFFIX)
+	-$(AM_V_at)rm -f XWinrc.$(FILE_MAN_SUFFIX)
+	$(AM_V_at)$(LN_S) XWinrc.man XWinrc.$(FILE_MAN_SUFFIX)
 
 EXTRAMANDEFS = -D__logdir__=$(logdir) -D__sysconfdir__=$(sysconfdir) -D__datadir__=$(datadir)
 
commit 9be4157391edf0c5fc4ee36adfb1eb1c3bdb8e3b
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Wed Mar 17 13:33:39 2010 -0500

    Respect value of SED from configure
    
    We now use libtool, which calls AC_PROG_SED and sets SED as the path to
    a fully-functional 'sed' (which may also be called 'gsed' if GNU sed is
    installed alongside a proprietary version).  Therefore we should respect
    the value of SED so we are sure to use the correct one.
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/cpprules.in b/cpprules.in
index 2e0856b..301305e 100644
--- a/cpprules.in
+++ b/cpprules.in
@@ -2,8 +2,6 @@
 # Rules for generating files using the C pre-processor
 # (Replaces CppFileTarget from Imake)
 
-SED = sed
-
 SUFFIXES = .pre .man .man.pre
 
 # Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index cdee586..fc9fde7 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -109,7 +109,7 @@ MAN_SUBSTS = \
 SUFFIXES = .$(APP_MAN_SUFFIX) .man
 
 .man.$(APP_MAN_SUFFIX):
-	sed $(MAN_SUBSTS) < $< > $@
+	$(SED) $(MAN_SUBSTS) < $< > $@
 
 EXTRA_DIST = $(appman_PRE)
 
diff --git a/hw/dmx/config/Makefile.am b/hw/dmx/config/Makefile.am
index 9fa7113..7de745f 100644
--- a/hw/dmx/config/Makefile.am
+++ b/hw/dmx/config/Makefile.am
@@ -69,7 +69,7 @@ XORGRELSTRING = @PACKAGE_STRING@
 MAN_SUBSTS = -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' 
 
 .man.$(APP_MAN_SUFFIX):
-	sed $(MAN_SUBSTS) < $< > $@
+	$(SED) $(MAN_SUBSTS) < $< > $@
 
 EXTRA_DIST = \
 	$(appman_PRE) \
commit 5e00f464c546debf9164f24c6d648623f7ee5946
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Wed Mar 17 14:56:24 2010 -0500

    Fix relink targets for silent rules
    
    Add $(AM_V_at) to all relink make targets to silence them when automake
    silent rules are in use.
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/Makefile.am b/Makefile.am
index 667c0de..8b7a2c8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -94,4 +94,4 @@ DIST_SUBDIRS = \
 
 # gross hack
 relink: all
-	$(MAKE) -C hw relink
+	$(AM_V_at)$(MAKE) -C hw relink
diff --git a/hw/Makefile.am b/hw/Makefile.am
index 7409906..92b007a 100644
--- a/hw/Makefile.am
+++ b/hw/Makefile.am
@@ -38,4 +38,4 @@ SUBDIRS =			\
 DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive
 
 relink:
-	for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink ; done
+	$(AM_V_at)for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink ; done
diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index 1e3e5da..cdee586 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -114,4 +114,4 @@ SUFFIXES = .$(APP_MAN_SUFFIX) .man
 EXTRA_DIST = $(appman_PRE)
 
 relink:
-	rm -f Xdmx$(EXEEXT) && $(MAKE) Xdmx$(EXEEXT)
+	$(AM_V_at)rm -f Xdmx$(EXEEXT) && $(MAKE) Xdmx$(EXEEXT)
diff --git a/hw/kdrive/Makefile.am b/hw/kdrive/Makefile.am
index 9e6c18e..55d940f 100644
--- a/hw/kdrive/Makefile.am
+++ b/hw/kdrive/Makefile.am
@@ -27,4 +27,4 @@ SUBDIRS =			\
 DIST_SUBDIRS = fbdev ephyr src linux fake
 
 relink:
-	@for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink ; done
+	$(AM_V_at)for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink ; done
diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index bd74791..d1dd630 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -81,7 +81,7 @@ Xephyr_DEPENDENCIES =	\
 Xephyr_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
 relink:
-	rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS)
+	$(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS)
 
 MAN_SRCS = Xephyr.man.pre
 
diff --git a/hw/kdrive/fake/Makefile.am b/hw/kdrive/fake/Makefile.am
index 6a5cedf..6d3ed05 100644
--- a/hw/kdrive/fake/Makefile.am
+++ b/hw/kdrive/fake/Makefile.am
@@ -27,4 +27,4 @@ Xfake_DEPENDENCIES =	\
 	@KDRIVE_LOCAL_LIBS@
 
 relink:
-	rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS)
+	$(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS)
diff --git a/hw/kdrive/fbdev/Makefile.am b/hw/kdrive/fbdev/Makefile.am
index a1664ec..ec9df95 100644
--- a/hw/kdrive/fbdev/Makefile.am
+++ b/hw/kdrive/fbdev/Makefile.am
@@ -25,5 +25,5 @@ Xfbdev_DEPENDENCIES =	\
 Xfbdev_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
 relink:
-	rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS)
+	$(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS)
 endif
diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am
index c6601c2..a183824 100644
--- a/hw/vfb/Makefile.am
+++ b/hw/vfb/Makefile.am
@@ -49,4 +49,4 @@ SUFFIXES += .$(APP_MAN_SUFFIX) .man
 EXTRA_DIST = Xvfb.man.pre
 
 relink:
-	rm -f Xvfb$(EXEEXT) && $(MAKE) Xvfb$(EXEEXT)
+	$(AM_V_at)rm -f Xvfb$(EXEEXT) && $(MAKE) Xvfb$(EXEEXT)
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 914e11f..116113b 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -114,7 +114,7 @@ CPP_FILES_FLAGS = \
 	-DMODULEPATH=\"$(DEFAULT_MODULE_PATH)\"
 
 relink:
-	rm -f Xorg && $(MAKE) Xorg
+	$(AM_V_at)rm -f Xorg && $(MAKE) Xorg
 
 xorg.conf.example.pre: xorgconf.cpp
 	cp $(srcdir)/xorgconf.cpp $@
diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am
index 3e97490..877ab8b 100644
--- a/hw/xnest/Makefile.am
+++ b/hw/xnest/Makefile.am
@@ -89,4 +89,4 @@ SUFFIXES += .$(APP_MAN_SUFFIX) .man
 	$(LN_S) $< $@
 
 relink:
-	rm -f Xnest$(EXEEXT) && $(MAKE) Xnest$(EXEEXT)
+	$(AM_V_at)rm -f Xnest$(EXEEXT) && $(MAKE) Xnest$(EXEEXT)
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 8bf6546..41a4515 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -222,4 +222,4 @@ EXTRA_DIST = \
 	xlaunch/window/wizard.h
 
 relink:
-	rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT)
+	$(AM_V_at)rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT)
commit fa7e062962d17862032bc600bfcffd486addb063
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Wed Mar 17 13:52:38 2010 -0500

    Use EXEEXT in relink rules for portable DDXs
    
    On Cygwin and MinGW, executables use the .exe suffix.  Autoconf and
    automake set EXEEXT on these platforms, and leave it empty on others
    where no suffix is used.  $(EXEEXT) must be appended to executable names
    in custom rules for portability:
    
    http://www.gnu.org/software/automake/manual/html_node/EXEEXT.html
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index 3c59320..1e3e5da 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -114,4 +114,4 @@ SUFFIXES = .$(APP_MAN_SUFFIX) .man
 EXTRA_DIST = $(appman_PRE)
 
 relink:
-	rm -f Xdmx && $(MAKE) Xdmx
+	rm -f Xdmx$(EXEEXT) && $(MAKE) Xdmx$(EXEEXT)
diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am
index c5b49a3..c6601c2 100644
--- a/hw/vfb/Makefile.am
+++ b/hw/vfb/Makefile.am
@@ -49,4 +49,4 @@ SUFFIXES += .$(APP_MAN_SUFFIX) .man
 EXTRA_DIST = Xvfb.man.pre
 
 relink:
-	rm -f Xvfb && $(MAKE) Xvfb
+	rm -f Xvfb$(EXEEXT) && $(MAKE) Xvfb$(EXEEXT)
diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am
index f95aab1..3e97490 100644
--- a/hw/xnest/Makefile.am
+++ b/hw/xnest/Makefile.am
@@ -89,4 +89,4 @@ SUFFIXES += .$(APP_MAN_SUFFIX) .man
 	$(LN_S) $< $@
 
 relink:
-	rm -f Xnest && $(MAKE) Xnest
+	rm -f Xnest$(EXEEXT) && $(MAKE) Xnest$(EXEEXT)
commit 037869d7b876f43158df88d63788b93a5d6187c1
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Wed Mar 17 13:48:49 2010 -0500

    kdrive: Use $(MAKE) in relink rules
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/hw/kdrive/Makefile.am b/hw/kdrive/Makefile.am
index 906a14c..9e6c18e 100644
--- a/hw/kdrive/Makefile.am
+++ b/hw/kdrive/Makefile.am
@@ -27,4 +27,4 @@ SUBDIRS =			\
 DIST_SUBDIRS = fbdev ephyr src linux fake
 
 relink:
-	@for i in $(SERVER_SUBDIRS) ; do make -C $$i relink ; done
+	@for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink ; done
diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index ec6f445..bd74791 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -81,7 +81,7 @@ Xephyr_DEPENDENCIES =	\
 Xephyr_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
 relink:
-	rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS)
+	rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS)
 
 MAN_SRCS = Xephyr.man.pre
 
diff --git a/hw/kdrive/fake/Makefile.am b/hw/kdrive/fake/Makefile.am
index be0fa42..6a5cedf 100644
--- a/hw/kdrive/fake/Makefile.am
+++ b/hw/kdrive/fake/Makefile.am
@@ -27,4 +27,4 @@ Xfake_DEPENDENCIES =	\
 	@KDRIVE_LOCAL_LIBS@
 
 relink:
-	rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS)
+	rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS)
diff --git a/hw/kdrive/fbdev/Makefile.am b/hw/kdrive/fbdev/Makefile.am
index 5d0ca3f..a1664ec 100644
--- a/hw/kdrive/fbdev/Makefile.am
+++ b/hw/kdrive/fbdev/Makefile.am
@@ -25,5 +25,5 @@ Xfbdev_DEPENDENCIES =	\
 Xfbdev_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
 relink:
-	rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS)
+	rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS)
 endif
commit 8e5de45513577c63a33833931f2afd0cc59d42a7
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Wed Feb 24 02:56:59 2010 -0600

    Use libtool -export-dynamic flag for portability
    
    The linker flag required for exporting symbols in executables varies
    by platform.  libtool handles this with a single -export-dynamic
    flag (not to be confused with the similarly-named ELF linker flag)
    which tells it to use the correct platform-specific flag at link time.
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index e497e76..d379b3a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1440,17 +1440,9 @@ UTILS_SYS_LIBS="${SYS_LIBS}"
 AC_SUBST([UTILS_SYS_LIBS])
 
 # The Xorg binary needs to export symbols so that they can be used from modules
-# Some platforms require extra flags to do this.   gcc should set these flags
-# when -rdynamic is passed to it, other compilers/linkers may need to be added
-# here.
-if test "x$GCC" = "xyes"; then
-       LD_EXPORT_SYMBOLS_FLAG="-rdynamic"
-fi
-case $host_os in
-       openbsd*)
-       LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-dynamic"
-       ;;
-esac
+# Some platforms require extra flags to do this.   libtool should set the
+# necessary flags for each platform when -export-dynamic is passed to it.
+LD_EXPORT_SYMBOLS_FLAG="-export-dynamic"
 AC_SUBST([LD_EXPORT_SYMBOLS_FLAG])
 
 dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so
commit 2a11ffa977d2267d8b2f27b76490a98e9c73b8c7
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Fri Feb 19 14:31:28 2010 -0600

    Rename xdmx client to dmxinfo
    
    The DMX Xdmx server and xdmx client cannot both be installed on
    case-insensitive file systems.  The client is undocumented and
    so renaming it is the best option.
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/dmx/examples/.gitignore b/hw/dmx/examples/.gitignore
index 5a86a71..d86e7eb 100644
--- a/hw/dmx/examples/.gitignore
+++ b/hw/dmx/examples/.gitignore
@@ -1,6 +1,7 @@
 #		Add & Override for this directory and it's subdirectories
 dmxaddinput
 dmxaddscreen
+dmxinfo
 dmxreconfig
 dmxresize
 dmxrminput
@@ -10,7 +11,6 @@ ev
 evi
 res
 xbell
-xdmx
 xinput
 xled
 xtest
diff --git a/hw/dmx/examples/Makefile.am b/hw/dmx/examples/Makefile.am
index d814339..229bb57 100644
--- a/hw/dmx/examples/Makefile.am
+++ b/hw/dmx/examples/Makefile.am
@@ -4,14 +4,14 @@ EV_PROG = ev
 endif
 
 bin_PROGRAMS = \
-	xdmx dmxwininfo dmxreconfig dmxresize \
+	dmxinfo dmxwininfo dmxreconfig dmxresize \
 	dmxaddscreen dmxrmscreen \
 	dmxaddinput dmxrminput
 noinst_PROGRAMS = xinput xtest evi res xled xbell $(EV_PROG)
 
-xdmx_SOURCES = xdmx.c
-xdmx_LDADD = @DMXEXAMPLES_DEP_LIBS@
-xdmx_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+dmxinfo_SOURCES = dmxinfo.c
+dmxinfo_LDADD = @DMXEXAMPLES_DEP_LIBS@
+dmxinfo_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
 
 dmxwininfo_SOURCES = dmxwininfo.c
 dmxwininfo_LDADD = @DMXXMUEXAMPLES_DEP_LIBS@
diff --git a/hw/dmx/examples/dmxinfo.c b/hw/dmx/examples/dmxinfo.c
new file mode 100644
index 0000000..dedce6e
--- /dev/null
+++ b/hw/dmx/examples/dmxinfo.c
@@ -0,0 +1,239 @@
+/*
+ * Copyright 2001,2002 Red Hat Inc., Durham, North Carolina.
+ *
+ * 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 on 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 (including the
+ * next paragraph) 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
+ * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * 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.
+ */
+
+/*
+ * Authors:
+ *   Rickard E. (Rik) Faith <faith at redhat.com>
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <X11/Xlib.h>
+#include <X11/extensions/dmxext.h>
+
+static void indent(int level)
+{
+    int i;
+    for (i = 0; i < level; i++) printf("    ");
+}
+
+static void print_window_id(const char *displayName, Display *display,
+                            Window window, int level, int child)
+{
+    char                 *name;
+    
+    if (!XFetchName(display, window, &name)) name = NULL;
+    indent(level);
+    if (child) printf("(%d) ", child);
+    printf("%s window 0x%08lx: %s%s\n",
+           displayName,
+           (long unsigned)window,
+           name ? name : "",
+           (window == DefaultRootWindow(display))
+           ? " (DMX root window)" : "");
+    if (name) XFree(name);
+}
+
+static void print_info(Display *display, Window window, int level, int child)
+{
+    DMXWindowAttributes winfo[128];
+    int                 count;
+    int                 i;
+    
+    if (!DMXGetWindowAttributes(display, window, &count, 128, winfo)) {
+        printf("Could not get window information for 0x%08lx\n",
+               (long unsigned)window);
+        exit(-2);
+    }
+    printf("\n");
+    print_window_id("DMX", display, window, level, child);
+    for (i = 0; i < count; i++) {
+        DMXScreenAttributes  sinfo;
+        Display              *backend;
+
+        /* This could also be cached -- the information doesn't change. */
+        if (!DMXGetScreenAttributes(display, winfo[i].screen, &sinfo)) {
+            printf("Could not get screen information for screen %d\n", i);
+            exit(-2);
+        }
+        if (!(backend = XOpenDisplay(sinfo.displayName))) {
+            printf("Cannot open backend display %s\n", sinfo.displayName);
+            exit(-2);
+        }
+        XCloseDisplay(backend);
+        
+        indent(level+1);
+        printf("%s window 0x%08lx: %dx%d%+d%+d",
+               sinfo.displayName,
+               (long unsigned)winfo[i].window,
+               winfo[i].pos.width, winfo[i].pos.height,
+               winfo[i].pos.x, winfo[i].pos.y);
+        if (!winfo[i].vis.width
+            && !winfo[i].vis.height
+            && !winfo[i].vis.x
+            && !winfo[i].vis.y) printf(" not visible\n");
+        else if (winfo[i].vis.width == winfo[i].pos.width
+                 && winfo[i].vis.height == winfo[i].pos.height) {
+            printf( " %+d%+d\n", winfo[i].vis.x, winfo[i].vis.y);
+        } else {
+            printf( " %dx%d%+d%+d\n",
+                    winfo[i].vis.width, winfo[i].vis.height,
+                    winfo[i].vis.x, winfo[i].vis.y);
+        }
+    }
+}
+
+static void print_tree(Display *display, Window window, int level, int child)
+{
+    Window       root, parent;
+    Window       *list;
+    unsigned int count;
+    unsigned int i;
+
+    print_info(display, window, level, child);
+    
+    if (!XQueryTree(display, window, &root, &parent, &list, &count)) {
+        printf("Cannot query window tree for 0x%08lx\n",
+               (long unsigned)window);
+        exit(-3);
+    }
+
+    if (count) {
+        indent(level+1);
+        printf("%d child%s:\n", count, count > 1 ? "ren" : "");
+        for (i = 0; i < count; i++) {
+            print_tree(display, list[i], level+1, i+1);
+        }
+    }
+}
+
+static const char *core(DMXInputAttributes *iinfo)
+{
+    if (iinfo->isCore)         return "core";
+    else if (iinfo->sendsCore) return "extension (sends core)";
+    else                       return "extension";
+}
+
+int main(int argc, char **argv)
+{
+    Display              *display = NULL;
+    Window               window   = 0;
+    int                  event_base;
+    int                  error_base;
+    int                  major_version, minor_version, patch_version;
+    DMXScreenAttributes  sinfo;
+    DMXInputAttributes   iinfo;
+    int                  count;
+    int                  i;
+
+    if (argc == 2 || argc == 3) {
+        if (!(display = XOpenDisplay(argv[1]))) {
+            printf("Cannot open display %s\n", argv[1]);
+            return -1;
+        }
+        if (argc == 3) window = strtol(argv[2], NULL, 0);
+    } else {
+        printf("Usage: %s display [windowid]\n", argv[0]);
+        return -1;
+    }
+
+    if (!display && !(display = XOpenDisplay(NULL))) {
+        printf("Cannot open default display\n");
+        return -1;
+    }
+
+    if (!DMXQueryExtension(display, &event_base, &error_base)) {
+        printf("DMX extension not present\n");
+        return -1;
+    }
+    printf("DMX extension present: event_base = %d, error_base = %d\n",
+           event_base, error_base);
+
+    if (!DMXQueryVersion(display,
+                         &major_version, &minor_version, &patch_version)) {
+        printf("Could not get extension version\n");
+        return -1;
+    }
+    printf("Extension version: %d.%d patch %d\n",
+           major_version, minor_version, patch_version);
+
+    if (!DMXGetScreenCount(display, &count)) {
+        printf("Could not get screen count\n");
+        return -1;
+    }
+    printf("Screen count = %d\n", count);
+
+    for (i = 0; i < count; i++) {
+        if (!DMXGetScreenAttributes(display, i, &sinfo)) {
+            printf("Could not get screen information for %d\n", i);
+            return -1;
+        }
+        printf("%d: %s %ux%u+%d+%d %d @%dx%d (root: %dx%d%+d%+d)\n",
+               i, sinfo.displayName,
+               sinfo.screenWindowWidth, sinfo.screenWindowHeight,
+               sinfo.screenWindowXoffset, sinfo.screenWindowYoffset,
+               sinfo.logicalScreen,
+               sinfo.rootWindowXorigin, sinfo.rootWindowYorigin,
+               sinfo.rootWindowWidth, sinfo.rootWindowHeight,
+               sinfo.rootWindowXoffset, sinfo.rootWindowYoffset);
+    }
+
+    if (major_version == 1 && minor_version >= 1) {
+        if (!DMXGetInputCount(display, &count)) {
+            printf("Could not get input count\n");
+            return -1;
+        }
+        printf("Input count = %d\n", count);
+        for (i = 0; i < count; i++) {
+            if (!DMXGetInputAttributes(display, i, &iinfo)) {
+                printf("Could not get input information for id %d\n", i);
+                return -1;
+            }
+            switch (iinfo.inputType) {
+            case DMXLocalInputType:
+                printf("  %2d local   %-20.20s %s\n", i, "", core(&iinfo));
+                break;
+            case DMXConsoleInputType:
+                printf("  %2d console %-20.20s %s\n",
+                       i, iinfo.name, core(&iinfo));
+                break;
+            case DMXBackendInputType:
+                printf("  %2d backend %-20.20s id=%2d screen=%2d %s\n",
+                       i, iinfo.name, iinfo.physicalId, iinfo.physicalScreen,
+                       core(&iinfo));
+                break;
+            }
+        }
+    }
+
+    if (window) print_info(display, window, 0, 0);
+    else        print_tree(display, DefaultRootWindow(display), 0, 0);
+    
+    XCloseDisplay(display);
+    return 0;
+}
diff --git a/hw/dmx/examples/xdmx.c b/hw/dmx/examples/xdmx.c
deleted file mode 100644
index dedce6e..0000000
--- a/hw/dmx/examples/xdmx.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Copyright 2001,2002 Red Hat Inc., Durham, North Carolina.
- *
- * 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 on 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 (including the
- * next paragraph) 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
- * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
- * 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.
- */
-
-/*
- * Authors:
- *   Rickard E. (Rik) Faith <faith at redhat.com>
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <X11/Xlib.h>
-#include <X11/extensions/dmxext.h>
-
-static void indent(int level)
-{
-    int i;
-    for (i = 0; i < level; i++) printf("    ");
-}
-
-static void print_window_id(const char *displayName, Display *display,
-                            Window window, int level, int child)
-{
-    char                 *name;
-    
-    if (!XFetchName(display, window, &name)) name = NULL;
-    indent(level);
-    if (child) printf("(%d) ", child);
-    printf("%s window 0x%08lx: %s%s\n",
-           displayName,
-           (long unsigned)window,
-           name ? name : "",
-           (window == DefaultRootWindow(display))
-           ? " (DMX root window)" : "");
-    if (name) XFree(name);
-}
-
-static void print_info(Display *display, Window window, int level, int child)
-{
-    DMXWindowAttributes winfo[128];
-    int                 count;
-    int                 i;
-    
-    if (!DMXGetWindowAttributes(display, window, &count, 128, winfo)) {
-        printf("Could not get window information for 0x%08lx\n",
-               (long unsigned)window);
-        exit(-2);
-    }
-    printf("\n");
-    print_window_id("DMX", display, window, level, child);
-    for (i = 0; i < count; i++) {
-        DMXScreenAttributes  sinfo;
-        Display              *backend;
-
-        /* This could also be cached -- the information doesn't change. */
-        if (!DMXGetScreenAttributes(display, winfo[i].screen, &sinfo)) {
-            printf("Could not get screen information for screen %d\n", i);
-            exit(-2);
-        }
-        if (!(backend = XOpenDisplay(sinfo.displayName))) {
-            printf("Cannot open backend display %s\n", sinfo.displayName);
-            exit(-2);
-        }
-        XCloseDisplay(backend);
-        
-        indent(level+1);
-        printf("%s window 0x%08lx: %dx%d%+d%+d",
-               sinfo.displayName,
-               (long unsigned)winfo[i].window,
-               winfo[i].pos.width, winfo[i].pos.height,
-               winfo[i].pos.x, winfo[i].pos.y);
-        if (!winfo[i].vis.width
-            && !winfo[i].vis.height
-            && !winfo[i].vis.x
-            && !winfo[i].vis.y) printf(" not visible\n");
-        else if (winfo[i].vis.width == winfo[i].pos.width
-                 && winfo[i].vis.height == winfo[i].pos.height) {
-            printf( " %+d%+d\n", winfo[i].vis.x, winfo[i].vis.y);
-        } else {
-            printf( " %dx%d%+d%+d\n",
-                    winfo[i].vis.width, winfo[i].vis.height,
-                    winfo[i].vis.x, winfo[i].vis.y);
-        }
-    }
-}
-
-static void print_tree(Display *display, Window window, int level, int child)
-{
-    Window       root, parent;
-    Window       *list;
-    unsigned int count;
-    unsigned int i;
-
-    print_info(display, window, level, child);
-    
-    if (!XQueryTree(display, window, &root, &parent, &list, &count)) {
-        printf("Cannot query window tree for 0x%08lx\n",
-               (long unsigned)window);
-        exit(-3);
-    }
-
-    if (count) {
-        indent(level+1);
-        printf("%d child%s:\n", count, count > 1 ? "ren" : "");
-        for (i = 0; i < count; i++) {
-            print_tree(display, list[i], level+1, i+1);
-        }
-    }
-}
-
-static const char *core(DMXInputAttributes *iinfo)
-{
-    if (iinfo->isCore)         return "core";
-    else if (iinfo->sendsCore) return "extension (sends core)";
-    else                       return "extension";
-}
-
-int main(int argc, char **argv)
-{
-    Display              *display = NULL;
-    Window               window   = 0;
-    int                  event_base;
-    int                  error_base;
-    int                  major_version, minor_version, patch_version;
-    DMXScreenAttributes  sinfo;
-    DMXInputAttributes   iinfo;
-    int                  count;
-    int                  i;
-
-    if (argc == 2 || argc == 3) {
-        if (!(display = XOpenDisplay(argv[1]))) {
-            printf("Cannot open display %s\n", argv[1]);
-            return -1;
-        }
-        if (argc == 3) window = strtol(argv[2], NULL, 0);
-    } else {
-        printf("Usage: %s display [windowid]\n", argv[0]);
-        return -1;
-    }
-
-    if (!display && !(display = XOpenDisplay(NULL))) {
-        printf("Cannot open default display\n");
-        return -1;
-    }
-
-    if (!DMXQueryExtension(display, &event_base, &error_base)) {
-        printf("DMX extension not present\n");
-        return -1;
-    }
-    printf("DMX extension present: event_base = %d, error_base = %d\n",
-           event_base, error_base);
-
-    if (!DMXQueryVersion(display,
-                         &major_version, &minor_version, &patch_version)) {
-        printf("Could not get extension version\n");
-        return -1;
-    }
-    printf("Extension version: %d.%d patch %d\n",
-           major_version, minor_version, patch_version);
-
-    if (!DMXGetScreenCount(display, &count)) {
-        printf("Could not get screen count\n");
-        return -1;
-    }
-    printf("Screen count = %d\n", count);
-
-    for (i = 0; i < count; i++) {
-        if (!DMXGetScreenAttributes(display, i, &sinfo)) {
-            printf("Could not get screen information for %d\n", i);
-            return -1;
-        }
-        printf("%d: %s %ux%u+%d+%d %d @%dx%d (root: %dx%d%+d%+d)\n",
-               i, sinfo.displayName,
-               sinfo.screenWindowWidth, sinfo.screenWindowHeight,
-               sinfo.screenWindowXoffset, sinfo.screenWindowYoffset,
-               sinfo.logicalScreen,
-               sinfo.rootWindowXorigin, sinfo.rootWindowYorigin,
-               sinfo.rootWindowWidth, sinfo.rootWindowHeight,
-               sinfo.rootWindowXoffset, sinfo.rootWindowYoffset);
-    }
-
-    if (major_version == 1 && minor_version >= 1) {
-        if (!DMXGetInputCount(display, &count)) {
-            printf("Could not get input count\n");
-            return -1;
-        }
-        printf("Input count = %d\n", count);
-        for (i = 0; i < count; i++) {
-            if (!DMXGetInputAttributes(display, i, &iinfo)) {
-                printf("Could not get input information for id %d\n", i);
-                return -1;
-            }
-            switch (iinfo.inputType) {
-            case DMXLocalInputType:
-                printf("  %2d local   %-20.20s %s\n", i, "", core(&iinfo));
-                break;
-            case DMXConsoleInputType:
-                printf("  %2d console %-20.20s %s\n",
-                       i, iinfo.name, core(&iinfo));
-                break;
-            case DMXBackendInputType:
-                printf("  %2d backend %-20.20s id=%2d screen=%2d %s\n",
-                       i, iinfo.name, iinfo.physicalId, iinfo.physicalScreen,
-                       core(&iinfo));
-                break;
-            }
-        }
-    }
-
-    if (window) print_info(display, window, 0, 0);
-    else        print_tree(display, DefaultRootWindow(display), 0, 0);
-    
-    XCloseDisplay(display);
-    return 0;
-}
commit fbb4903eaa23174d21ab8c640d9de1fe3eb17539
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Sun Feb 21 02:08:08 2010 -0600

    Cygwin/X: Fix windres rule for automake silent rules
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Rémi Cardona <rem at gentoo.org>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index daba679..8bf6546 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -150,7 +150,7 @@ XWin_DEPENDENCIES = $(XWIN_LIBS)
 XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS)
 
 .rc.o:
-	$(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include
+	$(AM_V_GEN)$(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include
 
 XWin_LDFLAGS = -mwindows -static
 
commit 8db894690988f2bac9c0acb96fd39811d2b42f47
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Fri Feb 19 00:05:28 2010 -0600

    Cygwin/X: Fix make dist after 11252ed82e1f361b99e86521ac9314f868bd1a3a
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Acked-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index fbaf092..daba679 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -197,6 +197,7 @@ include $(top_srcdir)/cpprules.in
 EXTRA_DIST = \
 	$(GLX_EXTRAS) \
 	$(MAN_SRCS) \
+	$(xwinconfig_DATA) \
 	X.ico \
 	XWin.rc \
 	xlaunch/config.cc \
commit ed31d50b5f7f25e4db986711699704e615b8afcb
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Mar 19 17:24:27 2010 -0700

    XQuartz: Constrain the pointer to the updated display bounds on display reconfigure.
    
    http://xquartz.macosforge.org/trac/ticket/346

diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 3c04205..59107be 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -241,6 +241,7 @@ void QuartzUpdateScreens(void) {
     WindowPtr pRoot;
     int x, y, width, height, sx, sy;
     xEvent e;
+    BoxRec bounds;
     
     if (noPseudoramiXExtension || screenInfo.numScreens != 1)
     {
@@ -277,8 +278,16 @@ void QuartzUpdateScreens(void) {
     //pScreen->PaintWindowBackground (pRoot, &pRoot->borderClip,  PW_BACKGROUND);
     miPaintWindow(pRoot, &pRoot->borderClip,  PW_BACKGROUND);
 
-//  TODO: This is a noop in 1.6 and nuked in master... we may need to do something else now to handle it
-//    DefineInitialRootWindow(pRoot);
+    /* <rdar://problem/7770779> pointer events are clipped to old display region after display reconfiguration
+     * http://xquartz.macosforge.org/trac/ticket/346
+     */
+    bounds.x1 = 0;
+    bounds.x2 = width;
+    bounds.y1 = 0;
+    bounds.y2 = height;
+    pScreen->ConstrainCursor(inputInfo.pointer, pScreen, &bounds);
+    inputInfo.pointer->spriteInfo->sprite->physLimits = bounds;
+    inputInfo.pointer->spriteInfo->sprite->hotLimits = bounds;
 
     DEBUG_LOG("Root Window: %dx%d @ (%d, %d) darwinMainScreen (%d, %d) xy (%d, %d) dixScreenOrigins (%d, %d)\n", width, height, x - sx, y - sy, darwinMainScreenX, darwinMainScreenY, x, y, dixScreenOrigins[pScreen->myNum].x, dixScreenOrigins[pScreen->myNum].y);
 
commit 927480be12ff61deb4e8120d2f90ddef3a1a6beb
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Mar 20 11:03:28 2010 -0700

    XQuartz: pbproxy: Make standalone xpbproxy respect the launchd prefix
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>

diff --git a/hw/xquartz/pbproxy/Makefile.am b/hw/xquartz/pbproxy/Makefile.am
index 02da6b2..1886642 100644
--- a/hw/xquartz/pbproxy/Makefile.am
+++ b/hw/xquartz/pbproxy/Makefile.am
@@ -1,5 +1,7 @@
-AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
-AM_CFLAGS=$(XPBPROXY_CFLAGS)
+AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \
+	-DLAUNCHD_ID_PREFIX=\"$(LAUNCHD_ID_PREFIX)\"
+
+AM_CFLAGS=$(XPBPROXY_CFLAGS) 
 
 noinst_LTLIBRARIES = libxpbproxy.la
 libxpbproxy_la_SOURCES = \
diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index b30dfb8..b00e90a 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -34,7 +34,7 @@
 #include <unistd.h> /*for getpid*/
 #include <Cocoa/Cocoa.h>
 
-static const char *app_prefs_domain = "org.x.X11";
+static const char *app_prefs_domain = 	LAUNCHD_ID_PREFIX".xpbproxy";
 CFStringRef app_prefs_domain_cfstr;
 
 /* Stubs */
@@ -73,7 +73,7 @@ int main (int argc, const char *argv[]) {
             printf("usage: xpbproxy OPTIONS\n"
                    "Pasteboard proxying for X11.\n\n"
                    "--prefs-domain <domain>   Change the domain used for reading preferences\n"
-                   "                          (default: org.x.X11)\n");
+                   "                          (default: %s)\n", app_prefs_domain);
             return 0;
         } else {
             fprintf(stderr, "usage: xpbproxy OPTIONS...\n"
commit d16bc8a3cdbe0e8b9cba836c7aa2ff7c0458049e
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Mar 20 03:28:57 2010 -0700

    XQuartz: xpbproxy: Cleanup xpbproxy threading
    
    Confine xpbproxy to a single thread
    Runs inside its own CFRunLoop
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 3faa1cb..5406640 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -52,7 +52,7 @@
 #include <Xplugin.h>
 
 // pbproxy/pbproxy.h
-extern BOOL xpbproxy_init (void);
+extern int xpbproxy_run (void);
 
 #define DEFAULTS_FILE X11LIBDIR"/X11/xserver/Xquartz.plist"
 
@@ -908,6 +908,26 @@ environment the next time you start X11?", @"Startup xinitrc dialog");
     [X11App prefs_synchronize];
 }
 
+static inline pthread_t create_thread(void *func, void *arg) {
+    pthread_attr_t attr;
+    pthread_t tid;
+    
+    pthread_attr_init(&attr);
+    pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
+    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+    pthread_create(&tid, &attr, func, arg);
+    pthread_attr_destroy(&attr);
+    
+    return tid;
+}
+
+static void *xpbproxy_x_thread(void *args) {
+    xpbproxy_run();
+
+    fprintf(stderr, "xpbproxy thread is terminating unexpectedly.\n");
+    return NULL;
+}
+
 void X11ApplicationMain (int argc, char **argv, char **envp) {
     NSAutoreleasePool *pool;
 
@@ -962,8 +982,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
      */
     check_xinitrc();
     
-    if(!xpbproxy_init())
-        fprintf(stderr, "Error initializing xpbproxy\n");
+    create_thread(xpbproxy_x_thread, NULL);
 
 #if XQUARTZ_SPARKLE
     [[X11App controller] setup_sparkle];
diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index f3f683a..b30dfb8 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -84,16 +84,10 @@ int main (int argc, const char *argv[]) {
     
     app_prefs_domain_cfstr = CFStringCreateWithCString(NULL, app_prefs_domain, kCFStringEncodingUTF8);
     
-    if(!xpbproxy_init())
-        return EXIT_FAILURE;
-    
     signal (SIGINT, signal_handler);
     signal (SIGTERM, signal_handler);
     signal (SIGHUP, signal_handler);
     signal (SIGPIPE, SIG_IGN);
 
-    [NSApplication sharedApplication];
-    [NSApp run];
-    
-    return EXIT_SUCCESS;
+    return xpbproxy_run();
 }
diff --git a/hw/xquartz/pbproxy/main.m b/hw/xquartz/pbproxy/main.m
index d26b1b1..560cf01 100644
--- a/hw/xquartz/pbproxy/main.m
+++ b/hw/xquartz/pbproxy/main.m
@@ -82,25 +82,12 @@ static int x_error_handler (Display *dpy, XErrorEvent *errevent) {
     return 0;
 }
 
-static inline pthread_t create_thread(void *func, void *arg) {
-    pthread_attr_t attr;
-    pthread_t tid;
-    
-    pthread_attr_init(&attr);
-    pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
-    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-    pthread_create(&tid, &attr, func, arg);
-    pthread_attr_destroy(&attr);
-    
-    return tid;
-}
-
-static void *xpbproxy_x_thread(void *args) {
+int xpbproxy_run (void) {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     size_t i;
-
+    
     wait_for_server_init();
-
+    
     for(i=0, xpbproxy_dpy=NULL; !xpbproxy_dpy && i<5; i++) {
         xpbproxy_dpy = XOpenDisplay(NULL);
         
@@ -108,7 +95,7 @@ static void *xpbproxy_x_thread(void *args) {
             char _display[32];
             snprintf(_display, sizeof(_display), ":%s", display);
             setenv("DISPLAY", _display, TRUE);
-
+            
             xpbproxy_dpy=XOpenDisplay(_display);
         }
         if(!xpbproxy_dpy)
@@ -118,7 +105,7 @@ static void *xpbproxy_x_thread(void *args) {
     if (xpbproxy_dpy == NULL) {
         fprintf (stderr, "xpbproxy: can't open default display\n");
         [pool release];
-        return NULL;
+        return EXIT_FAILURE;
     }
     
     XSetIOErrorHandler (x_io_error_handler);
@@ -128,11 +115,11 @@ static void *xpbproxy_x_thread(void *args) {
                                  &xpbproxy_apple_wm_error_base)) {
         fprintf (stderr, "xpbproxy: can't open AppleWM server extension\n");
         [pool release];
-        return NULL;
+        return EXIT_FAILURE;
     }
-    
+
     xpbproxy_have_xfixes = XFixesQueryExtension(xpbproxy_dpy, &xpbproxy_xfixes_event_base, &xpbproxy_xfixes_error_base);
-    
+
     XAppleWMSelectInput (xpbproxy_dpy, AppleWMActivationNotifyMask |
                          AppleWMPasteboardNotifyMask);
     
@@ -140,18 +127,14 @@ static void *xpbproxy_x_thread(void *args) {
     
     if(!xpbproxy_input_register()) {
         [pool release];
-        return NULL;
+        return EXIT_FAILURE;
     }
-
+    
     [pool release];
- 
-    xpbproxy_input_loop();
-    return NULL;
-}
+    
+    CFRunLoopRun();
 
-BOOL xpbproxy_init (void) {
-    create_thread(xpbproxy_x_thread, NULL);
-    return TRUE;
+    return EXIT_SUCCESS;
 }
 
 id xpbproxy_selection_object (void) {
diff --git a/hw/xquartz/pbproxy/pbproxy.h b/hw/xquartz/pbproxy/pbproxy.h
index a6798ef..013f981 100644
--- a/hw/xquartz/pbproxy/pbproxy.h
+++ b/hw/xquartz/pbproxy/pbproxy.h
@@ -67,7 +67,7 @@ extern void xpbproxy_set_is_active (BOOL state);
 extern BOOL xpbproxy_get_is_active (void);
 extern id xpbproxy_selection_object (void);
 extern Time xpbproxy_current_timestamp (void);
-extern BOOL xpbproxy_init (void);
+extern int xpbproxy_run (void);
 
 extern Display *xpbproxy_dpy;
 extern int xpbproxy_apple_wm_event_base, xpbproxy_apple_wm_error_base;
@@ -76,7 +76,6 @@ extern BOOL xpbproxy_have_xfixes;
 
 /* from x-input.m */
 extern BOOL xpbproxy_input_register (void);
-extern void xpbproxy_input_loop();
 
 #ifdef DEBUG
 /* BEWARE: this can cause a string memory leak, according to the leaks program. */
diff --git a/hw/xquartz/pbproxy/x-input.m b/hw/xquartz/pbproxy/x-input.m
index 6ba30c6..405ba3c 100644
--- a/hw/xquartz/pbproxy/x-input.m
+++ b/hw/xquartz/pbproxy/x-input.m
@@ -39,17 +39,12 @@
 
 #include <unistd.h>
 
-#include <pthread.h>
-
 static CFRunLoopSourceRef xpbproxy_dpy_source;
 
 #ifdef STANDALONE_XPBPROXY
 BOOL xpbproxy_prefs_reload = NO;
 #endif
 
-static pthread_mutex_t xpbproxy_dpy_rdy_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t xpbproxy_dpy_rdy_cond = PTHREAD_COND_INITIALIZER;
-
 /* Timestamp when the X server last told us it's active */
 static Time last_activation_time;
 
@@ -88,58 +83,51 @@ static void x_event_apple_wm_notify(XAppleWMNotifyEvent *e) {
     }
 }
 
-void xpbproxy_input_loop() {
-    pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
-    while(true) {
-        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+static void xpbproxy_process_xevents(void) {
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+    
+    if(pool == nil) {
+        fprintf(stderr, "unable to allocate/init auto release pool!\n");
+        return;
+    }
+    
+    while (XPending(xpbproxy_dpy) != 0) {
+        XEvent e;
         
-        if(pool == nil) {
-            fprintf(stderr, "unable to allocate/init auto release pool!\n");
-            break;
-        }
+        XNextEvent (xpbproxy_dpy, &e);
         
-        while (XPending(xpbproxy_dpy) != 0) {
-            XEvent e;
-            
-            pthread_mutex_unlock(&xpbproxy_dpy_rdy_lock);
-            XNextEvent (xpbproxy_dpy, &e);
-            
-            switch (e.type) {                
-                case SelectionClear:
-                    if([xpbproxy_selection_object() is_active])
-                        [xpbproxy_selection_object () clear_event:&e.xselectionclear];
-                    break;
-                    
-                case SelectionRequest:
-                    [xpbproxy_selection_object () request_event:&e.xselectionrequest];
-                    break;
-                    
-                case SelectionNotify:
-                    [xpbproxy_selection_object () notify_event:&e.xselection];
-                    break;
-                    
-                case PropertyNotify:
-                    [xpbproxy_selection_object () property_event:&e.xproperty];
-                    break;
-                    
-                default:
-                    if(e.type >= xpbproxy_apple_wm_event_base &&
-                       e.type < xpbproxy_apple_wm_event_base + AppleWMNumberEvents) {
-                        x_event_apple_wm_notify((XAppleWMNotifyEvent *) &e);
-                    } else if(e.type == xpbproxy_xfixes_event_base + XFixesSelectionNotify) {
-                        [xpbproxy_selection_object() xfixes_selection_notify:(XFixesSelectionNotifyEvent *)&e];
-                    }
-                    break;
-            }
-            
-            XFlush(xpbproxy_dpy);
-            pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
+        switch (e.type) {                
+            case SelectionClear:
+                if([xpbproxy_selection_object() is_active])
+                    [xpbproxy_selection_object () clear_event:&e.xselectionclear];
+                break;
+                
+            case SelectionRequest:
+                [xpbproxy_selection_object () request_event:&e.xselectionrequest];
+                break;
+                
+            case SelectionNotify:
+                [xpbproxy_selection_object () notify_event:&e.xselection];
+                break;
+                
+            case PropertyNotify:
+                [xpbproxy_selection_object () property_event:&e.xproperty];
+                break;
+                
+            default:
+                if(e.type >= xpbproxy_apple_wm_event_base &&
+                   e.type < xpbproxy_apple_wm_event_base + AppleWMNumberEvents) {
+                    x_event_apple_wm_notify((XAppleWMNotifyEvent *) &e);
+                } else if(e.type == xpbproxy_xfixes_event_base + XFixesSelectionNotify) {
+                    [xpbproxy_selection_object() xfixes_selection_notify:(XFixesSelectionNotifyEvent *)&e];
+                }
+                break;
         }
         
-        [pool release];
-        
-        pthread_cond_wait(&xpbproxy_dpy_rdy_cond, &xpbproxy_dpy_rdy_lock);
+        XFlush(xpbproxy_dpy);
     }
+    
+    [pool release];
 }
 
 static BOOL add_input_socket (int sock, CFOptionFlags callback_types,
@@ -161,7 +149,7 @@ static BOOL add_input_socket (int sock, CFOptionFlags callback_types,
     if (*cf_source == NULL)
         return FALSE;
     
-    CFRunLoopAddSource (CFRunLoopGetMain (),
+    CFRunLoopAddSource (CFRunLoopGetCurrent (),
                         *cf_source, kCFRunLoopDefaultMode);
     return TRUE;
 }
@@ -175,10 +163,8 @@ static void x_input_callback (CFSocketRef sock, CFSocketCallBackType type,
         xpbproxy_prefs_reload = NO;
     }
 #endif
-
-    pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
-    pthread_cond_broadcast(&xpbproxy_dpy_rdy_cond);
-    pthread_mutex_unlock(&xpbproxy_dpy_rdy_lock);
+    
+    xpbproxy_process_xevents();
 }
 
 BOOL xpbproxy_input_register(void) {
commit 9c9c3a85b094a3c7b2763a572715d710325091aa
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Mar 19 17:23:12 2010 -0700

    XQuartz: Minor cleanup
    
    Move RandRInit to where it will need to be (not yet implemented)
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index c4142a8..3c04205 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -166,6 +166,11 @@ void QuartzInitOutput(
         FatalError("Could not register block and wakeup handlers.");
     }
 
+#if defined(RANDR) && !defined(FAKE_RANDR)
+    if(!QuartzRandRInit(pScreen))
+        FatalError("Failed to init RandR extension.\n");
+#endif
+
     // Do display mode specific initialization
     quartzProcs->DisplayInit();
 }
@@ -259,16 +264,11 @@ void QuartzUpdateScreens(void) {
     pScreen->width = width;
     pScreen->height = height;
     
-#ifndef FAKE_RANDR
-    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;
+    sx = x + darwinMainScreenX;
+    sy = y + darwinMainScreenY;
     
     /* Adjust the root window. */
     pRoot = WindowTable[pScreen->myNum];
commit bb75d0df8b5238bfe8b011bb5737fae2a3584290
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Mar 19 15:26:50 2010 -0700

    XQuartz: GLX: Fix Availability for Tiger ppc workaround
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>

diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index c092c1d..f2af3ff 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -120,7 +120,7 @@
 /* Tiger PPC doesn't have the associated symbols, but glext.h says it does.  Liars!
  * http://trac.macports.org/ticket/20638
  */
-#if defined(__ppc__) && MAC_OS_X_VERSION_MIN_REQUIRED == 1040
+#if defined(__ppc__) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
 #undef GL_EXT_gpu_program_parameters
 #define GL_EXT_gpu_program_parameters 0
 #endif
commit eac7cdabecafb7c505795207182ab2578d672c06
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue Mar 16 11:29:08 2010 -0700

    Revert "XQuartz: Explicitly pass a bellProc to make XBell() work again."
    
    I'm not quite sure why this was necessary, but DDXRingBell is being called
    from CoreKeyboardBell, so we don't need a separate bellProc which would
    result in multiple rings.
    
    This reverts commit 9071b0d69748cfa7ecca17b4cb0e431bbb0ef2a4.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 7e36a9a..c9ef7cc 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -184,12 +184,6 @@ static void DarwinChangeKeyboardControl(DeviceIntPtr device, KeybdCtrl *ctrl) {
     // keyclick, bell volume / pitch, autorepead, LED's
 }
 
-static void DarwinKeyboardBell(int volume, DeviceIntPtr pDev, pointer arg, int something) {
-    KeybdCtrl *ctrl = arg;
-
-    DDXRingBell(volume, ctrl->bell_pitch, ctrl->bell_duration);
-}
-
 //-----------------------------------------------------------------------------
 // Utility functions to help parse Darwin keymap
 //-----------------------------------------------------------------------------
@@ -301,7 +295,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
     // for a kIOHIDParamConnectType connection.
     assert(darwinParamConnect = NXOpenEventStatus());
 
-    InitKeyboardDeviceStruct(pDev, NULL, DarwinKeyboardBell, DarwinChangeKeyboardControl);
+    InitKeyboardDeviceStruct(pDev, NULL, NULL, DarwinChangeKeyboardControl);
 
     DarwinKeyboardReloadHandler();
 
commit 13c007f9224ad871193e40466e64df1477ed26b0
Author: Keith Packard <keithp at keithp.com>
Date:   Sun Mar 21 17:23:46 2010 -0700

    Bump to 1.7.99.902 -- 1.8 RC2

diff --git a/configure.ac b/configure.ac
index 065016f..e497e76 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.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2010-02-12"
+AC_INIT([xorg-server], 1.7.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2010-03-21"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
commit 235fa5030428084368e5be57fca695647b7b79c4
Merge: 1c612ac... fa5103a...
Author: Keith Packard <keithp at keithp.com>
Date:   Sun Mar 21 15:38:40 2010 -0700

    Merge commit 'fa5103a02bd509e4a102afdad2ab26cb22210367'

commit 1c612acca8568fcdf9761d23f112adaf4d496f1b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Mar 17 14:32:38 2010 +1000

    dix: if owner-events is true for passive grabs, add the window mask (#25400)
    
    A client requesting a GrabModeSync button grab, owner-events true, with only
    the ButtonRelease mask set would never receive the press event even if the
    grab window had the ButtonPress mask set.
    
    The protocol requires that if owner-events is true, then the delivery mask
    is the combination of the grab mask + the window event mask.
    
    X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Jim Ramsay <i.am at jimramsay.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/events.c b/dix/events.c
index 0e9bc31..6541652 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3552,6 +3552,8 @@ CheckPassiveGrabsOnWindow(
                 xE = &core;
                 count = 1;
                 mask = grab->eventMask;
+                if (grab->ownerEvents)
+                    mask |= pWin->eventMask;
             } else if (match & XI2_MATCH)
             {
                 rc = EventToXI2((InternalEvent*)event, &xE);
@@ -3573,6 +3575,24 @@ CheckPassiveGrabsOnWindow(
                     mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
                 else if (event->type == XI_Enter || event->type == XI_FocusIn)
                     mask = grab->xi2mask[device->id][event->type/8];
+
+                if (grab->ownerEvents && wOtherInputMasks(grab->window))
+                {
+                    InputClientsPtr icp =
+                        wOtherInputMasks(grab->window)->inputClients;
+
+                    while(icp)
+                    {
+                        if (rClient(icp) == rClient(grab))
+                        {
+                            int evtype = (xE) ? ((xGenericEvent*)xE)->evtype : event->type;
+                            mask |= icp->xi2mask[device->id][evtype/8];
+                            break;
+                        }
+
+                        icp = icp->next;
+                    }
+                }
             } else
             {
                 rc = EventToXI((InternalEvent*)event, &xE, &count);
@@ -3584,6 +3604,22 @@ CheckPassiveGrabsOnWindow(
                     continue;
                 }
                 mask = grab->eventMask;
+                if (grab->ownerEvents && wOtherInputMasks(grab->window))
+                {
+                    InputClientsPtr icp =
+                        wOtherInputMasks(grab->window)->inputClients;
+
+                    while(icp)
+                    {
+                        if (rClient(icp) == rClient(grab))
+                        {
+                            mask |= icp->mask[device->id];
+                            break;
+                        }
+
+                        icp = icp->next;
+                    }
+                }
             }
 
 	    (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
commit 95ca39b981624df5338a16b506289014c431ae82
Merge: e7ff956... bf18191...
Author: Keith Packard <keithp at keithp.com>
Date:   Sun Mar 21 15:24:06 2010 -0700

    Merge remote branch 'jturney/master'

commit e7ff956638780dc1c6f160a1fd041b92cebff9ac
Author: Oliver McFadden <oliver.mcfadden at nokia.com>
Date:   Mon Mar 15 23:46:36 2010 +0200

    common: xf86Configure: alloc_strlen: Allocated memory does not have space for the terminating NUL of the string
    
    buffer_alloc: Called allocating function "realloc" which allocated memory dictated by parameter "len + strlen(displaySize_string)"
    alloc_strlen: Allocated memory does not have space for the terminating NUL of the string
    var_assign: Assigned "ptr->mon_comment" to storage allocated by "realloc(ptr->mon_comment, len + strlen(displaySize_string))"
    
    Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index d74d90b..67bf08b 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -612,7 +612,7 @@ configureDDCMonitorSection (int screennum)
 	  len = 0;
 	}
 	if ((ptr->mon_comment =
-	     realloc(ptr->mon_comment, len+strlen(displaySize_string)))) {
+	     realloc(ptr->mon_comment, len + strlen(displaySize_string) + 1))) {
 	  strcpy(ptr->mon_comment + len, displaySize_string);
 	}
       }
commit aeae6637b52b042cf8b07c6943abcd5d31968d49
Author: Oliver McFadden <oliver.mcfadden at nokia.com>
Date:   Mon Mar 15 23:46:34 2010 +0200

    fb: fbFinishScreenInit: leaked_storage: Variable "(visuals|depths)" goes out of scope
    
    Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index 24eadde..53e2ada 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -228,7 +228,11 @@ fbFinishScreenInit(ScreenPtr	pScreen,
     rootdepth = 0;
     if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
 			&defaultVisual,((unsigned long)1<<(imagebpp-1)), 8))
+    {
+	xfree (visuals);
+	xfree (depths);
 	return FALSE;
+    }
     if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
 			rootdepth, ndepths, depths,
 			defaultVisual, nvisuals, visuals))
commit d9ee31ab05efbd2d598cc93a41a8834f84d30803
Author: Oliver McFadden <oliver.mcfadden at nokia.com>
Date:   Mon Mar 15 23:46:33 2010 +0200

    exa: exaFinishAccess: Overrun of static array "pExaScr->access" of size 6 at position 6 with index variable "i"
    
    Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/exa/exa.c b/exa/exa.c
index c5ac7de..590d9a5 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -417,8 +417,8 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
 
     /* Catch unbalanced Prepare/FinishAccess calls. */
     if (i == EXA_NUM_PREPARE_INDICES)
-	EXA_FatalErrorDebug(("EXA bug: FinishAccess called without PrepareAccess for pixmap 0x%p.\n",
-			     pPixmap));
+      EXA_FatalErrorDebugWithRet(("EXA bug: FinishAccess called without PrepareAccess for pixmap 0x%p.\n",
+				  pPixmap),);
 
     pExaScr->access[i].pixmap = NULL;
 
commit bf181915e103b0659c5a0bc3b2f6bccb18c9ec36
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Mon Feb 1 17:11:51 2010 +0000

    Cygwin/X: Allow the default log location to be configurable
    
    Allow the default log location to be configurable (e.g. /var/log),
    and use separate logs for each display instance (e.g. XWin.0.log).
    
    Make the type of g_pszLogFile const char*, per os/log.c:LogInit().
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/configure.ac b/configure.ac
index 3e8ea10..065016f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1829,6 +1829,7 @@ AC_MSG_RESULT([$XWIN])
 if test "x$XWIN" = xyes; then
 	PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no])
 	AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [Location of system.XWinrc])
+	AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location])
 	AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
 	AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
 	AC_CHECK_TOOL(WINDRES, windres)
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index d8fd59f..175cd9d 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -69,7 +69,7 @@ extern int			g_iLastScreen;
 extern char *			g_pszCommandLine;
 extern Bool			g_fSilentFatalError;
 
-extern char *			g_pszLogFile;
+extern const char *		g_pszLogFile;
 extern Bool			g_fLogFileChanged;
 extern int			g_iLogVerbose;
 Bool				g_fLogInited;
@@ -244,7 +244,7 @@ ddxGiveUp (void)
 #endif
 
   if (!g_fLogInited) {
-    LogInit (g_pszLogFile, NULL);
+    g_pszLogFile = LogInit (g_pszLogFile, NULL);
     g_fLogInited = TRUE;
   }  
   LogClose ();
@@ -689,9 +689,6 @@ OsVendorInit (void)
   /* Re-initialize global variables on server reset */
   winInitializeGlobals ();
 
-  LogInit (NULL, NULL);
-  LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose);
-
   winFixupPaths();
 
 #ifdef DDXOSVERRORF
@@ -706,7 +703,7 @@ OsVendorInit (void)
      * avoid the second call 
      */  
     g_fLogInited = TRUE;
-    LogInit (g_pszLogFile, NULL);
+    g_pszLogFile = LogInit (g_pszLogFile, NULL);
   } 
   LogSetParameter (XLOG_FLUSH, 1);
   LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose);
@@ -927,7 +924,7 @@ ddxUseMsg(void)
 
   /* Log file will not be opened for UseMsg unless we open it now */
   if (!g_fLogInited) {
-    LogInit (g_pszLogFile, NULL);
+    g_pszLogFile = LogInit (g_pszLogFile, NULL);
     g_fLogInited = TRUE;
   }  
   LogClose ();
@@ -935,9 +932,9 @@ ddxUseMsg(void)
   /* Notify user where UseMsg text can be found.*/
   if (!g_fNoHelpMessageBox)
     winMessageBoxF ("The " PROJECT_NAME " help text has been printed to "
-		  "/tmp/XWin.log.\n"
-		  "Please open /tmp/XWin.log to read the help text.\n",
-		  MB_ICONINFORMATION);
+		  "%s.\n"
+		  "Please open %s to read the help text.\n",
+		  MB_ICONINFORMATION, g_pszLogFile, g_pszLogFile);
 }
 
 /* See Porting Layer Definition - p. 20 */
diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
index 9ed27c3..191b9a9 100644
--- a/hw/xwin/winerror.c
+++ b/hw/xwin/winerror.c
@@ -41,8 +41,9 @@
 
 /* References to external symbols */
 extern char *		g_pszCommandLine;
-extern char *		g_pszLogFile;
+extern const char *	g_pszLogFile;
 extern Bool		g_fSilentFatalError;
+extern Bool		g_fLogInited;
 
 
 #ifdef DDXOSVERRORF
@@ -87,6 +88,12 @@ OsVendorFatalError (void)
   if (g_fSilentFatalError)
     return;
 
+  if (!g_fLogInited) {
+    g_fLogInited = TRUE;
+    g_pszLogFile = LogInit (g_pszLogFile, NULL);
+  }
+  LogClose ();
+
   winMessageBoxF (
           "A fatal error has occurred and " PROJECT_NAME " will now exit.\n" \
 		  "Please open %s for more information.\n",
diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c
index 7bb4a60..926ce69 100644
--- a/hw/xwin/winglobals.c
+++ b/hw/xwin/winglobals.c
@@ -69,9 +69,9 @@ Bool           g_fAuthEnabled = FALSE;
 HICON		g_hIconX = NULL;
 HICON		g_hSmallIconX = NULL;
 #ifndef RELOCATE_PROJECTROOT
-char *		g_pszLogFile = "/tmp/XWin.log";
+const char *	g_pszLogFile = DEFAULT_LOGDIR "/XWin.%s.log";
 #else
-char *		g_pszLogFile = "XWin.log";
+const char *	g_pszLogFile = "XWin.log";
 Bool		g_fLogFileChanged = FALSE;
 #endif
 int		g_iLogVerbose = 2;
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 159e533..66da76f 100755
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -53,7 +53,7 @@ extern Bool			g_fUnicodeClipboard;
 extern Bool			g_fClipboard;
 #endif
 extern int			g_iLogVerbose;
-extern char *			g_pszLogFile;
+extern const char *		g_pszLogFile;
 #ifdef RELOCATE_PROJECTROOT
 extern Bool			g_fLogFileChanged;
 #endif
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 4f3e895..85dc10f 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -42,7 +42,7 @@
  */
 
 extern HWND			g_hDlgExit;
-extern char *g_pszLogFile;
+extern const char *g_pszLogFile;
 
 /*
  * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
diff --git a/include/xwin-config.h.in b/include/xwin-config.h.in
index 21ceb29..13b51ca 100644
--- a/include/xwin-config.h.in
+++ b/include/xwin-config.h.in
@@ -32,3 +32,5 @@
 /* Location of system.XWinrc */
 #undef SYSCONFDIR
 
+/* Default log location */
+#undef DEFAULT_LOGDIR
commit cca4952d750779a4c58a11fe08a53336042930bb
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Feb 26 14:40:30 2010 +0000

    Xming: Warning fixes
    
    Fix warnings due to prototypes not specifying function arguments
    Fix warning with RegQueryValueEx()
    Tidy up an include
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 9ab8ed9..5cda970 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -196,7 +196,7 @@
  * Windows headers
  */
 #include "winms.h"
-#include "./winresource.h"
+#include "winresource.h"
 
 
 /*
diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c
index fcd1872..f4c4005 100644
--- a/hw/xwin/winauth.c
+++ b/hw/xwin/winauth.c
@@ -122,7 +122,7 @@ GenerateAuthorization(
  */
 
 Bool
-winGenerateAuthorization ()
+winGenerateAuthorization (void)
 {
   Bool				fFreeAuth = FALSE;
   SecurityAuthorizationPtr	pAuth = NULL;
diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
index 259b3d2..b05867b 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -330,7 +330,7 @@ winConfigKeyboard (DeviceIntPtr pDevice)
         const char          regtempl[] = 
           "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\";
         char                *regpath;
-        char                lname[256];
+        unsigned char       lname[256];
         DWORD               namesize = sizeof(lname);
 
         regpath = malloc(sizeof(regtempl) + KL_NAMELENGTH + 1);
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 00572a1..7dce7e3 100755
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -81,7 +81,7 @@ make_box (int x, int y, int w, int h)
 }
 
 void
-winWindowsWMExtensionInit ()
+winWindowsWMExtensionInit (void)
 {
   ExtensionEntry* extEntry;
 
diff --git a/os/osdep.h b/os/osdep.h
index 3d75bba..7b1c699 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -200,7 +200,7 @@ extern int *ConnectionTranslation;
 #else
 extern int GetConnectionTranslation(int conn);
 extern void SetConnectionTranslation(int conn, int client);
-extern void ClearConnectionTranslation();
+extern void ClearConnectionTranslation(void);
 #endif
  
 extern Bool NewOutputPending;
commit b8cf4153f84404b2a1b62a247d5d36d24bf481da
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Feb 26 14:41:00 2010 +0000

    Xming: Dead code removal
    
    Remove some dead code, mostly code made obsolete by mandatory XKB
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 8b18972..fbaf092 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -109,7 +109,6 @@ SRCS =	InitInput.c \
 	winconfig.h \
 	win.h \
 	winkeybd.h \
-	winkeymap.h \
 	winkeynames.h \
 	winlayouts.h \
 	winmessages.h \
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index a423b49..ad9e66a 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -49,9 +49,6 @@ static Bool g_winKeyState[NUM_KEYCODES];
  */
 
 static void
-winGetKeyMappings (KeySymsPtr pKeySyms, CARD8 *pModMap);
-
-static void
 winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
 	      pointer pCtrl, int iClass);
 
@@ -119,89 +116,6 @@ winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode)
 }
 
 
-/*
- * We call this function from winKeybdProc when we are
- * initializing the keyboard.
- */
-
-static void
-winGetKeyMappings (KeySymsPtr pKeySyms, CARD8 *pModMap)
-{
-  int			i;
-  KeySym		*pMap = map;
-  KeySym		*pKeySym;
-
-  /*
-   * Initialize all key states to up... which may not be true
-   * but it is close enough.
-   */
-  ZeroMemory (g_winKeyState, sizeof (g_winKeyState[0]) * NUM_KEYCODES);
-
-  /* MAP_LENGTH is defined in Xserver/include/input.h to be 256 */
-  for (i = 0; i < MAP_LENGTH; i++)
-    pModMap[i] = NoSymbol;  /* make sure it is restored */
-
-  /* Loop through all valid entries in the key symbol table */
-  for (pKeySym = pMap, i = MIN_KEYCODE;
-       i < (MIN_KEYCODE + NUM_KEYCODES);
-       i++, pKeySym += GLYPHS_PER_KEY)
-    {
-      switch (*pKeySym)
-	{
-	case XK_Shift_L:
-	case XK_Shift_R:
-	  pModMap[i] = ShiftMask;
-	  break;
-
-	case XK_Control_L:
-	case XK_Control_R:
-	  pModMap[i] = ControlMask;
-	  break;
-
-	case XK_Caps_Lock:
-	  pModMap[i] = LockMask;
-	  break;
-
-	case XK_Alt_L:
-	case XK_Alt_R:
-	  pModMap[i] = AltMask;
-	  break;
-
-	case XK_Num_Lock:
-	  pModMap[i] = NumLockMask;
-	  break;
-
-	case XK_Scroll_Lock:
-	  pModMap[i] = ScrollLockMask;
-	  break;
-
-#if 0
-	case XK_Super_L:
-	case XK_Super_R:
-	  pModMap[i] = Mod4Mask;
-	  break;
-#else
-	/* Hirigana/Katakana toggle */
-	case XK_Kana_Lock:
-	case XK_Kana_Shift:
-	  pModMap[i] = KanaMask;
-	  break;
-#endif
-
-	/* alternate toggle for multinational support */
-	case XK_Mode_switch:
-	  pModMap[i] = AltLangMask;
-	  break;
-	}
-    }
-
-  pKeySyms->map        = (KeySym *) pMap;
-  pKeySyms->mapWidth   = GLYPHS_PER_KEY;
-  pKeySyms->minKeyCode = MIN_KEYCODE;
-  pKeySyms->maxKeyCode = MAX_KEYCODE;
-}
-
-
 /* Ring the keyboard bell (system speaker on PCs) */
 static void
 winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
diff --git a/hw/xwin/winkeybd.h b/hw/xwin/winkeybd.h
index d0d6b9c..5b2a589 100644
--- a/hw/xwin/winkeybd.h
+++ b/hw/xwin/winkeybd.h
@@ -35,14 +35,6 @@
  */
 #include "winkeynames.h"
 
-
-/*
- * Include the standard ASCII keymap.
- *
- * This header declares a static KeySym array called 'map'.
- */
-#include "winkeymap.h"
-
 #define		WIN_KEYMAP_COLS		3
 
 /* Rows 160 through 165 correspond to software-generated codes, which
diff --git a/hw/xwin/winkeymap.h b/hw/xwin/winkeymap.h
deleted file mode 100644
index 3862f03..0000000
--- a/hw/xwin/winkeymap.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * For Scancodes see notes in winkeynames.h  !!!!
- *
- */
-
-static KeySym map[NUM_KEYCODES * GLYPHS_PER_KEY] = {
-    /* 0x00 */  NoSymbol,       NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x01 */  XK_Escape,      NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x02 */  XK_1,           XK_exclam,	NoSymbol,	NoSymbol,
-    /* 0x03 */  XK_2,           XK_at,		NoSymbol,	NoSymbol,
-    /* 0x04 */  XK_3,           XK_numbersign,	NoSymbol,	NoSymbol,
-    /* 0x05 */  XK_4,           XK_dollar,	NoSymbol,	NoSymbol,
-    /* 0x06 */  XK_5,           XK_percent,	NoSymbol,	NoSymbol,
-    /* 0x07 */  XK_6,           XK_asciicircum,	NoSymbol,	NoSymbol,
-    /* 0x08 */  XK_7,           XK_ampersand,	NoSymbol,	NoSymbol,
-    /* 0x09 */  XK_8,           XK_asterisk,	NoSymbol,	NoSymbol,
-    /* 0x0a */  XK_9,           XK_parenleft,	NoSymbol,	NoSymbol,
-    /* 0x0b */  XK_0,           XK_parenright,	NoSymbol,	NoSymbol,
-    /* 0x0c */  XK_minus,       XK_underscore,	NoSymbol,	NoSymbol,
-    /* 0x0d */  XK_equal,       XK_plus,	NoSymbol,	NoSymbol,
-    /* 0x0e */  XK_BackSpace,   NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x0f */  XK_Tab,         XK_ISO_Left_Tab,NoSymbol,	NoSymbol,
-    /* 0x10 */  XK_Q,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x11 */  XK_W,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x12 */  XK_E,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x13 */  XK_R,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x14 */  XK_T,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x15 */  XK_Y,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x16 */  XK_U,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x17 */  XK_I,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x18 */  XK_O,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x19 */  XK_P,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x1a */  XK_bracketleft, XK_braceleft,	NoSymbol,	NoSymbol,
-    /* 0x1b */  XK_bracketright,XK_braceright,	NoSymbol,	NoSymbol,
-    /* 0x1c */  XK_Return,      NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x1d */  XK_Control_L,   NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x1e */  XK_A,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x1f */  XK_S,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x20 */  XK_D,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x21 */  XK_F,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x22 */  XK_G,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x23 */  XK_H,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x24 */  XK_J,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x25 */  XK_K,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x26 */  XK_L,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x27 */  XK_semicolon,   XK_colon,	NoSymbol,	NoSymbol,
-    /* 0x28 */  XK_quoteright,  XK_quotedbl,	NoSymbol,	NoSymbol,
-    /* 0x29 */  XK_quoteleft,	XK_asciitilde,	NoSymbol,	NoSymbol,
-    /* 0x2a */  XK_Shift_L,     NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x2b */  XK_backslash,   XK_bar,		NoSymbol,	NoSymbol,
-    /* 0x2c */  XK_Z,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x2d */  XK_X,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x2e */  XK_C,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x2f */  XK_V,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x30 */  XK_B,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x31 */  XK_N,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x32 */  XK_M,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x33 */  XK_comma,       XK_less,	NoSymbol,	NoSymbol,
-    /* 0x34 */  XK_period,      XK_greater,	NoSymbol,	NoSymbol,
-    /* 0x35 */  XK_slash,       XK_question,	NoSymbol,	NoSymbol,
-    /* 0x36 */  XK_Shift_R,     NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x37 */  XK_KP_Multiply, NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x38 */  XK_Alt_L,	XK_Meta_L,	NoSymbol,	NoSymbol,
-    /* 0x39 */  XK_space,       NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3a */  XK_Caps_Lock,   NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3b */  XK_F1,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3c */  XK_F2,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3d */  XK_F3,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3e */  XK_F4,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3f */  XK_F5,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x40 */  XK_F6,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x41 */  XK_F7,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x42 */  XK_F8,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x43 */  XK_F9,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x44 */  XK_F10,         NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x45 */  XK_Num_Lock,    NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x46 */  XK_Scroll_Lock,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x47 */  XK_KP_Home,	XK_KP_7,	NoSymbol,	NoSymbol,
-    /* 0x48 */  XK_KP_Up,	XK_KP_8,	NoSymbol,	NoSymbol,
-    /* 0x49 */  XK_KP_Prior,	XK_KP_9,	NoSymbol,	NoSymbol,
-    /* 0x4a */  XK_KP_Subtract, NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x4b */  XK_KP_Left,	XK_KP_4,	NoSymbol,	NoSymbol,
-    /* 0x4c */  XK_KP_Begin,	XK_KP_5,	NoSymbol,	NoSymbol,
-    /* 0x4d */  XK_KP_Right,	XK_KP_6,	NoSymbol,	NoSymbol,
-    /* 0x4e */  XK_KP_Add,      NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x4f */  XK_KP_End,	XK_KP_1,	NoSymbol,	NoSymbol,
-    /* 0x50 */  XK_KP_Down,	XK_KP_2,	NoSymbol,	NoSymbol,
-    /* 0x51 */  XK_KP_Next,	XK_KP_3,	NoSymbol,	NoSymbol,
-    /* 0x52 */  XK_KP_Insert,	XK_KP_0,	NoSymbol,	NoSymbol,
-    /* 0x53 */  XK_KP_Delete,	XK_KP_Decimal,	NoSymbol,	NoSymbol,
-    /* 0x54 */  XK_Sys_Req,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x55 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x56 */  XK_less,	XK_greater,	NoSymbol,	NoSymbol,
-    /* 0x57 */  XK_F11,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x58 */  XK_F12,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x59 */  XK_Home,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5a */  XK_Up,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5b */  XK_Prior,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5c */  XK_Left,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5d */  XK_Begin,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5e */  XK_Right,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5f */  XK_End,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x60 */  XK_Down,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x61 */  XK_Next,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x62 */  XK_Insert,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x63 */  XK_Delete,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x64 */  XK_KP_Enter,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x65 */  XK_Control_R,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x66 */  XK_Pause,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x67 */  XK_Print,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x68 */  XK_KP_Divide,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x69 */  XK_Alt_R,	XK_Meta_R,	NoSymbol,	NoSymbol,
-    /* 0x6a */  XK_Break,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x6b */  XK_Meta_L,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x6c */  XK_Meta_R,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x6d */  XK_Menu,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x6e */  XK_F13,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x6f */  XK_F14,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x70 */  XK_F15,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x71 */  XK_F16,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x72 */  XK_F17,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x73 */  XK_backslash,	XK_underscore,	NoSymbol,	NoSymbol,
-    /* 0x74 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x75 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x76 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x77 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x78 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x79 */  XK_Henkan,	XK_Mode_switch,	NoSymbol,	NoSymbol,
-    /* 0x7a */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x7b */  XK_Muhenkan,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x7c */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x7d */  XK_backslash,	XK_bar,		NoSymbol,	NoSymbol,
-    /* 0x7e */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x7f */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-};
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 3436824..00572a1 100755
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -326,14 +326,6 @@ winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg,
     }
 }
 
-/* Safe to call from any thread. */
-unsigned int
-WindowsWMSelectedEvents (void)
-{
-  return eventMask;
-}
-
-
 /* general utility functions */
 
 static int
commit 9b18f7ac0ba9aadb8c86bc2717cbdff75e951b69
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 26 14:22:57 2010 +0000

    Cygwin/X: Tidy up some cosmetic issues in log strings
    
    Tidy up some cosmetic issues in log strings:
    - Add missing '\n'
    - Fix some strings starting with '\n'
    - Remove '\f' from some log strings
    
    These all just look daft in a log with timestamps.
    
    Also clarify log message about screen origin coordinates
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/dix/registry.c b/dix/registry.c
index ec853b3..1381a3d 100644
--- a/dix/registry.c
+++ b/dix/registry.c
@@ -313,7 +313,7 @@ dixResetRegistry(void)
 	fclose(fh);
     fh = fopen(FILENAME, "r");
     if (!fh)
-	LogMessage(X_WARNING, "Failed to open protocol names file " FILENAME);
+	LogMessage(X_WARNING, "Failed to open protocol names file " FILENAME "\n");
 
     /* Add built-in resources */
     RegisterResourceName(RT_NONE, "NONE");
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index a380903..5d2b948 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -453,7 +453,7 @@ winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr)
 static int
 winClipboardIOErrorHandler (Display *pDisplay)
 {
-  ErrorF ("\nwinClipboardIOErrorHandler!\n\n");
+  ErrorF ("winClipboardIOErrorHandler!\n\n");
 
   /* Restart at the main entry point */
   longjmp (g_jmpEntry, WIN_JMP_ERROR_IO);
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 21d913e..2fcad32 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -944,7 +944,7 @@ winMultiWindowXMsgProc (void *pArg)
       if (pProcArg->pDisplay == NULL)
 	{
 	  ErrorF ("winMultiWindowXMsgProc - Could not open display, try: %d, "
-		  "sleeping: %d\n\f",
+		  "sleeping: %d\n",
 		  iRetries + 1, WIN_CONNECT_DELAY);
 	  ++iRetries;
 	  sleep (WIN_CONNECT_DELAY);
@@ -1327,7 +1327,7 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
       if (pWMInfo->pDisplay == NULL)
 	{
 	  ErrorF ("winInitMultiWindowWM - Could not open display, try: %d, "
-		  "sleeping: %d\n\f",
+		  "sleeping: %d\n",
 		  iRetries + 1, WIN_CONNECT_DELAY);
 	  ++iRetries;
 	  sleep (WIN_CONNECT_DELAY);
@@ -1430,7 +1430,7 @@ winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr)
 static int
 winMultiWindowWMIOErrorHandler (Display *pDisplay)
 {
-  ErrorF ("\nwinMultiWindowWMIOErrorHandler!\n\n");
+  ErrorF ("winMultiWindowWMIOErrorHandler!\n\n");
 
   if (g_shutdown)
     pthread_exit(NULL);
@@ -1470,7 +1470,7 @@ winMultiWindowXMsgProcErrorHandler (Display *pDisplay, XErrorEvent *pErr)
 static int
 winMultiWindowXMsgProcIOErrorHandler (Display *pDisplay)
 {
-  ErrorF ("\nwinMultiWindowXMsgProcIOErrorHandler!\n\n");
+  ErrorF ("winMultiWindowXMsgProcIOErrorHandler!\n\n");
 
   /* Restart at the main entry point */
   longjmp (g_jmpXMsgProcEntry, WIN_JMP_ERROR_IO);
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 37ec27e..c8cd646 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -246,7 +246,7 @@ winScreenInit (int index,
   dixScreenOrigins[index].x = pScreenInfo->dwInitialX - GetSystemMetrics(SM_XVIRTUALSCREEN);
   dixScreenOrigins[index].y = pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN);
 
-  ErrorF("Screen %d added at XINERAMA coordinate (%d,%d).\n",
+  ErrorF("Screen %d added at virtual desktop coordinate (%d,%d).\n",
          index, dixScreenOrigins[index].x, dixScreenOrigins[index].y);
 
 #if CYGDEBUG || YES
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 8334441..4f3e895 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -651,7 +651,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
 	      "pixmap header to point to the new address.  If you get "
 	      "this message and "PROJECT_NAME" freezes or crashes "
 	      "after this message then send a problem report and your "
-	      "%s file to " BUILDERADDR, g_pszLogFile);
+	      "%s file to " BUILDERADDR "\n", g_pszLogFile);
 
       /* Location of shadow framebuffer has changed */
       pScreenInfo->pfb = pScreenPriv->pddsdShadow->lpSurface;
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index ef5c214..e78fbd9 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -554,7 +554,7 @@ winFinishCreateWindowsWindowDDNL (WindowPtr pWin)
   int			iWidth, iHeight;
   int			iX, iY;
 
-  winDebug ("\nwinFinishCreateWindowsWindowDDNL!\n\n");
+  winDebug ("winFinishCreateWindowsWindowDDNL!\n\n");
 
   iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
   iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
commit 178e830378c3514b9c53a5b1c6d2d5f930c3779b
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Feb 22 19:13:30 2010 +0000

    Cygwin/X: Fix thinko in mount option checking
    
    Fix a thinko in mount option checking.
    Use symbolic names for values assigned to binary flag for clarity.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index acb7d4a..d8fd59f 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -1,3 +1,4 @@
+
 /*
 
 Copyright 1993, 1998  The Open Group
@@ -361,11 +362,11 @@ winCheckMount(void)
       continue;
     level = curlevel;
 
-    if ((winCheckMntOpt(ent, "binary") == NULL) ||
+    if ((winCheckMntOpt(ent, "binary") == NULL) &&
         (winCheckMntOpt(ent, "binmode") == NULL))
-      binary = 0;
+      binary = FALSE;
     else
-      binary = 1;
+      binary = TRUE;
   }
     
   if (endmntent(mnt) != 1)
commit fa5103a02bd509e4a102afdad2ab26cb22210367
Author: Francisco Jerez <currojerez at riseup.net>
Date:   Wed Feb 24 23:18:01 2010 +0100

    dri2: No need to blit from front on DRI2GetBuffers if they're just being reused.
    
    It can be quite an expensive operation, so we're better off not doing
    it unless it's totally required.
    
    Signed-off-by: Francisco Jerez <currojerez at riseup.net>
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index cd69ca0..48618e1 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -202,27 +202,25 @@ find_attachment(DRI2DrawablePtr pPriv, unsigned attachment)
     return -1;
 }
 
-static DRI2BufferPtr
+static Bool
 allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
 			 DRI2DrawablePtr pPriv,
 			 unsigned int attachment, unsigned int format,
-			 int dimensions_match)
+			 int dimensions_match, DRI2BufferPtr *buffer)
 {
-    DRI2BufferPtr buffer;
-    int old_buf;
-
-    old_buf = find_attachment(pPriv, attachment);
+    int old_buf = find_attachment(pPriv, attachment);
 
     if ((old_buf < 0)
 	|| !dimensions_match
 	|| (pPriv->buffers[old_buf]->format != format)) {
-	buffer = (*ds->CreateBuffer)(pDraw, attachment, format);
+	*buffer = (*ds->CreateBuffer)(pDraw, attachment, format);
+	return TRUE;
+
     } else {
-	buffer = pPriv->buffers[old_buf];
+	*buffer = pPriv->buffers[old_buf];
 	pPriv->buffers[old_buf] = NULL;
+	return FALSE;
     }
-
-    return buffer;
 }
 
 static DRI2BufferPtr *
@@ -238,6 +236,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
     int have_fake_front = 0;
     int front_format = 0;
     int dimensions_match;
+    int buffers_changed = 0;
     int i;
 
     if (!pPriv) {
@@ -256,8 +255,10 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
 	const unsigned attachment = *(attachments++);
 	const unsigned format = (has_format) ? *(attachments++) : 0;
 
-	buffers[i] = allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment,
-					      format, dimensions_match);
+	if (allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment,
+				     format, dimensions_match,
+				     &buffers[i]))
+		buffers_changed = 1;
 
 	/* If the drawable is a window and the front-buffer is requested,
 	 * silently add the fake front-buffer to the list of requested
@@ -287,15 +288,18 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
     }
 
     if (need_real_front > 0) {
-	buffers[i++] = allocate_or_reuse_buffer(pDraw, ds, pPriv,
-						DRI2BufferFrontLeft,
-						front_format, dimensions_match);
+	if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFrontLeft,
+				     front_format, dimensions_match,
+				     &buffers[i++]))
+	    buffers_changed = 1;
     }
 
     if (need_fake_front > 0) {
-	buffers[i++] = allocate_or_reuse_buffer(pDraw, ds, pPriv,
-						DRI2BufferFakeFrontLeft,
-						front_format, dimensions_match);
+	if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFakeFrontLeft,
+				     front_format, dimensions_match,
+				     &buffers[i++]))
+	    buffers_changed = 1;
+
 	have_fake_front = 1;
     }
 
@@ -324,7 +328,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
      * contents of the real front-buffer.  This ensures correct operation of
      * applications that call glXWaitX before calling glDrawBuffer.
      */
-    if (have_fake_front) {
+    if (have_fake_front && buffers_changed) {
 	BoxRec box;
 	RegionRec region;
 
commit e38e01081af42825bb7b44d18aa35845318f8556
Author: Francisco Jerez <currojerez at riseup.net>
Date:   Wed Feb 24 23:18:00 2010 +0100

    Import linked list helpers from the intel DDX.
    
    Borrowed from i830.h, except for list_for_each_entry().
    
    Signed-off-by: Francisco Jerez <currojerez at riseup.net>
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

diff --git a/include/Makefile.am b/include/Makefile.am
index d684f9c..eddc86c 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -27,6 +27,7 @@ sdk_HEADERS =		\
 	globals.h	\
 	input.h		\
 	inputstr.h	\
+	list.h		\
 	misc.h		\
 	miscstruct.h	\
 	opaque.h	\
diff --git a/include/list.h b/include/list.h
new file mode 100644
index 0000000..a126a65
--- /dev/null
+++ b/include/list.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ * Copyright © 2010 Francisco Jerez <currojerez at riseup.net>
+ *
+ * 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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 _LIST_H_
+#define _LIST_H_
+
+/* classic doubly-link circular list */
+struct list {
+    struct list *next, *prev;
+};
+
+static void
+list_init(struct list *list)
+{
+    list->next = list->prev = list;
+}
+
+static inline void
+__list_add(struct list *entry,
+	    struct list *prev,
+	    struct list *next)
+{
+    next->prev = entry;
+    entry->next = next;
+    entry->prev = prev;
+    prev->next = entry;
+}
+
+static inline void
+list_add(struct list *entry, struct list *head)
+{
+    __list_add(entry, head, head->next);
+}
+
+static inline void
+__list_del(struct list *prev, struct list *next)
+{
+    next->prev = prev;
+    prev->next = next;
+}
+
+static inline void
+list_del(struct list *entry)
+{
+    __list_del(entry->prev, entry->next);
+    list_init(entry);
+}
+
+static inline Bool
+list_is_empty(struct list *head)
+{
+    return head->next == head;
+}
+
+#ifndef container_of
+#define container_of(ptr, type, member) \
+    (type *)((char *)(ptr) - (char *) &((type *)0)->member)
+#endif
+
+#define list_entry(ptr, type, member) \
+    container_of(ptr, type, member)
+
+#define list_first_entry(ptr, type, member) \
+    list_entry((ptr)->next, type, member)
+
+#define __container_of(ptr, sample, member)				\
+    (void *)((char *)(ptr)						\
+	     - ((char *)&(sample)->member - (char *)(sample)))
+
+#define list_for_each_entry(pos, head, member)				\
+    for (pos = __container_of((head)->next, pos, member);		\
+	 &pos->member != (head);					\
+	 pos = __container_of(pos->member.next, pos, member))
+
+#endif
commit b8a3be5f34016b745e38cd53825a4e398c6127bc
Author: Francisco Jerez <currojerez at riseup.net>
Date:   Wed Feb 24 23:17:59 2010 +0100

    Add a ConfigNotify hook.
    
    Executed from the ConfigureWindow request, right before sending
    ConfigureNotify to the clients.
    
    This commit breaks the ScreenRec ABI.
    
    Signed-off-by: Francisco Jerez <currojerez at riseup.net>
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

diff --git a/dix/window.c b/dix/window.c
index 2676a54..c7201df 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -2303,6 +2303,9 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
     return(Success);
 
 ActuallyDoSomething:
+    if (pWin->drawable.pScreen->ConfigNotify)
+	(*pWin->drawable.pScreen->ConfigNotify)(pWin, x, y, w, h, bw, pSib);
+
     if (SubStrSend(pWin, pParent))
     {
 	memset(&event, 0, sizeof(xEvent));
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index ab50e7a..c42119d 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -399,6 +399,15 @@ typedef    void (* PostChangeSaveUnderProcPtr)(
 	WindowPtr /*pLayerWin*/,
 	WindowPtr /*firstChild*/);
 
+typedef    void (* ConfigNotifyProcPtr)(
+	WindowPtr /*pWin*/,
+	int /*x*/,
+	int /*y*/,
+	int /*w*/,
+	int /*h*/,
+	int /*bw*/,
+	WindowPtr /*pSib*/);
+
 typedef    void (* MoveWindowProcPtr)(
 	WindowPtr /*pWin*/,
 	int /*x*/,
@@ -581,6 +590,7 @@ typedef struct _Screen {
     MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
     ChangeSaveUnderProcPtr	ChangeSaveUnder;
     PostChangeSaveUnderProcPtr	PostChangeSaveUnder;
+    ConfigNotifyProcPtr		ConfigNotify;
     MoveWindowProcPtr		MoveWindow;
     ResizeWindowProcPtr		ResizeWindow;
     GetLayerWindowProcPtr	GetLayerWindow;


More information about the Xquartz-changes mailing list