[Xquartz-changes] xserver: Branch 'server-1.9-apple' - 6 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Sun May 23 00:31:01 PDT 2010


Rebased ref, commits from common ancestor:
commit 35bca4e32e47bd281a1a0a8571ec461df6e2b4fc
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 91c91ee..6d15b79 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -2078,11 +2078,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 896d33e..00f9ada 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -156,24 +156,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);
     }
 
@@ -271,22 +266,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));
     
     
@@ -312,52 +307,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)
@@ -384,8 +357,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);
@@ -418,7 +390,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;
 
@@ -427,7 +400,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)
     {
@@ -448,11 +421,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 9f5c39f..9c55236 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -38,8 +38,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;
@@ -55,8 +54,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 0e78410f57f4e1336f55d477a8dd17b8bab8b164
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Apr 30 13:08:25 2010 -0700

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

diff --git a/mi/miexpose.c b/mi/miexpose.c
index 57968dd..172cc07 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -525,6 +525,7 @@ void RootlessSetPixmapOfAncestors(WindowPtr pWin);
 void RootlessStartDrawing(WindowPtr pWin);
 void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
 Bool IsFramedWindow(WindowPtr pWin);
+#include "../fb/fb.h"
 #endif 
 
 void
@@ -552,24 +553,37 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     Bool	solid = TRUE;
     DrawablePtr	drawable = &pWin->drawable;
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("START %d BS %d (pR = %ld)\n", what, pWin->backgroundState, ParentRelative);
+    ErrorF("      Rgn: %d %d %d %d\n", prgn->extents.x1, prgn->extents.y1,
+	                               prgn->extents.x2 - prgn->extents.x1,
+	                               prgn->extents.y2 - prgn->extents.y1);
+    ErrorF("      Win: %d %d (%d %d) %d %d\n", pWin->origin.x, pWin->origin.y,
+	                                       pWin->winSize.extents.x1, pWin->winSize.extents.y1,
+	                                       pWin->winSize.extents.x2 - pWin->winSize.extents.x1,
+					       pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
+    ErrorF("     Draw: %d %d %d %d\n", pWin->drawable.x, pWin->drawable.y,
+				       pWin->drawable.width, pWin->drawable.height);
+#endif
+
 #ifdef ROOTLESS
     if(!drawable || drawable->type == UNDRAWABLE_WINDOW)
 	return;
-
-    if(IsFramedWindow(pWin)) {
-        RootlessStartDrawing(pWin);
-        RootlessDamageRegion(pWin, prgn);
-    
-        if(pWin->backgroundState == ParentRelative) {
-            if((what == PW_BACKGROUND) || 
-               (what == PW_BORDER && !pWin->borderIsPixel))
-                RootlessSetPixmapOfAncestors(pWin);
-        }
-    }
 #endif
     
     if (what == PW_BACKGROUND)
     {
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+
+	    if(pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
 	while (pWin->backgroundState == ParentRelative)
 	    pWin = pWin->parent;
 
@@ -591,6 +605,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     {
 	PixmapPtr   pixmap;
 
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+	    
+	    if(!pWin->borderIsPixel &&
+		pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
 	tile_x_off = drawable->x;
 	tile_y_off = drawable->y;
 	
@@ -599,6 +625,12 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 	    return;
 	pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable);
 	drawable = &pixmap->drawable;
+
+#ifdef XQUARTZ_CLIP_DEBUG
+	ErrorF("     Draw: %d %d %d %d\n",
+	       drawable->x, drawable->y, drawable->width, drawable->height);    
+#endif
+	
 #ifdef COMPOSITE
 	draw_x_off = pixmap->screen_x;
 	draw_y_off = pixmap->screen_y;
@@ -661,6 +693,57 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     ChangeGC (NullClient, pGC, gcmask, gcval);
     ValidateGC (drawable, pGC);
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
+#endif
+    
+#ifdef XQUARTZ
+    /* Looks like our clipping isn't set right for some reason:
+     * http://xquartz.macosforge.org/trac/ticket/290
+     */
+    if(what == PW_BORDER) {
+
+#if 0
+	if(solid) {
+#if 1
+	    fbFillRegionSolid(&pWin->drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       pWin->drawable.bitsPerPixel));
+#else
+	    fbFillRegionSolid(drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       drawable->bitsPerPixel));
+#endif
+	    return;
+	}
+#endif
+    
+	pGC->pCompositeClip->extents.x1 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y1 += prgn->extents.y1;
+	pGC->pCompositeClip->extents.x2 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y2 += prgn->extents.y1;
+	
+	if(pGC->pCompositeClip->extents.x2 > drawable->pScreen->width)
+	    pGC->pCompositeClip->extents.x2 = drawable->pScreen->width;
+	if(pGC->pCompositeClip->extents.y2 > drawable->pScreen->height)
+	    pGC->pCompositeClip->extents.y2 = drawable->pScreen->height;
+    }
+#endif
+
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);    
+#endif
+
     numRects = REGION_NUM_RECTS(prgn);
     pbox = REGION_RECTS(prgn);
     for (i= numRects; --i >= 0; pbox++, prect++)
commit c51534961e1bb4c68ff881758862d2f85f572ce7
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat May 22 11:11:48 2010 -0700

    xorg-server.pc Requires: xproto >= 7.0.17
    
    Since the headers we export in the SDK use the _X_NORETURN #define
    introduced in xproto 7.0.17, drivers built with the SDK will also
    need to have at least that version of xproto installed.
    
    I considered exporting the version from configure.ac, but decided not
    to since the minimum required to build the X server may not always
    be the same as the minimum required to build drivers (for instance,
    if the X server used a new #define in its .c files or internal headers,
    but didn't export it in any of the SDK headers).
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/xorg-server.pc.in b/xorg-server.pc.in
index 376cb93..44f886a 100644
--- a/xorg-server.pc.in
+++ b/xorg-server.pc.in
@@ -15,6 +15,6 @@ abi_extension=@abi_extension@
 Name: xorg-server
 Description: Modular X.Org X Server
 Version: @PACKAGE_VERSION@
-Requires: pixman-1 pciaccess
+Requires: pixman-1 pciaccess xproto >= 7.0.17
 Cflags: -I${sdkdir} @symbol_visibility@
 Libs: -L${libdir}
commit e90f20eed394de2200aba42bd61fd31c1067ac33
Author: Jamey Sharp <jamey at minilop.net>
Date:   Fri May 21 22:16:50 2010 -0700

    Declare functions that unconditionally call FatalError as _X_NORETURN.
    
    For AtomError, this should fix a clang warning; in the other cases it's
    just good documentation.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Cc: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/include/dix.h b/include/dix.h
index 893338f..3d09bbe 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -300,7 +300,7 @@ extern _X_EXPORT Bool ValidAtom(
 extern _X_EXPORT const char *NameForAtom(
     Atom /*atom*/);
 
-extern _X_EXPORT void AtomError(void);
+extern _X_EXPORT void AtomError(void) _X_NORETURN;
 
 extern _X_EXPORT void FreeAllAtoms(void);
 
diff --git a/include/dixstruct.h b/include/dixstruct.h
index 5b1a698..9610427 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -53,7 +53,7 @@ typedef void (*ReplySwapPtr) (
 extern _X_EXPORT void ReplyNotSwappd (
 		ClientPtr	/* pClient */,
 		int		/* size */,
-		void *		/* pbuf */);
+		void *		/* pbuf */) _X_NORETURN;
 
 typedef enum {ClientStateInitial,
 	      ClientStateAuthenticating,
diff --git a/include/extnsionst.h b/include/extnsionst.h
index 19c76fc..bb66dfb 100644
--- a/include/extnsionst.h
+++ b/include/extnsionst.h
@@ -84,7 +84,7 @@ extern _X_EXPORT EventSwapPtr EventSwapVector[128];
 
 extern _X_EXPORT void NotImplemented (	/* FIXME: this may move to another file... */
 	xEvent *,
-	xEvent *);
+	xEvent *) _X_NORETURN;
 
 #define    SetGCVector(pGC, VectorElement, NewRoutineAddress, Atom)    \
     pGC->VectorElement = NewRoutineAddress;
commit 9d31d5b639c2a6ab8b1a80a0e2f0ee2c4f8cddd3
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon May 10 11:48:31 2010 -0400

    vfb: Remove dead variable and header file
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c
index 10bb6a5..801aaa0 100644
--- a/hw/vfb/InitInput.c
+++ b/hw/vfb/InitInput.c
@@ -38,7 +38,6 @@ from The Open Group.
 #include <X11/Xos.h>
 #include "mibstore.h"
 #include "mipointer.h"
-#include "lk201kbd.h"
 #include "xkbsrv.h"
 #include <X11/keysym.h>
 #include "xserver-properties.h"
@@ -63,7 +62,6 @@ void DDXRingBell(int volume, int pitch, int duration)
 
 #define VFB_MIN_KEY 8
 #define VFB_MAX_KEY 255
-KeySym  map[MAP_LENGTH * LK201_GLYPHS_PER_KEY];
 
 static int
 vfbKeybdProc(DeviceIntPtr pDevice, int onoff)
diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am
index 4ac0c8f..de5e1c5 100644
--- a/hw/vfb/Makefile.am
+++ b/hw/vfb/Makefile.am
@@ -9,7 +9,6 @@ AM_CFLAGS = -DHAVE_DIX_CONFIG_H \
 
 SRCS =	InitInput.c \
 	InitOutput.c \
-	lk201kbd.h \
 	$(top_srcdir)/Xext/dpmsstubs.c \
 	$(top_srcdir)/Xi/stubs.c \
 	$(top_srcdir)/mi/miinitext.c
diff --git a/hw/vfb/lk201kbd.h b/hw/vfb/lk201kbd.h
deleted file mode 100644
index d0198d0..0000000
--- a/hw/vfb/lk201kbd.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/***********************************************************
-
-Copyright 1987, 1998  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-OPEN GROUP 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.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
-                        All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its 
-documentation for any purpose and without fee is hereby granted, 
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in 
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.  
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-
-#define MIN_LK201_KEY            86
-#define MAX_LK201_KEY           251
-#define LK201_GLYPHS_PER_KEY      2
-
-#define KEY_F1			 86
-#define KEY_F2			 87
-#define KEY_F3			 88
-#define KEY_F4			 89
-#define KEY_F5			 90
-#define KEY_F6			100
-#define KEY_F7			101
-#define KEY_F8			102
-#define KEY_F9			103
-#define KEY_F10			104
-#define KEY_F11			113
-#define KEY_F12			114
-#define KEY_F13			115
-#define KEY_F14			116
-#define KEY_HELP		124
-#define KEY_MENU		125
-#define KEY_F17			128
-#define KEY_F18			129
-#define KEY_F19			130
-#define KEY_F20			131
-#define KEY_FIND		138
-#define KEY_INSERT_HERE		139
-#define KEY_REMOVE		140
-#define KEY_SELECT		141
-#define KEY_PREV_SCREEN		142
-#define KEY_NEXT_SCREEN		143
-#define KEY_KP_0		146	/* key pad */
-#define KEY_KP_PERIOD		148	/* key pad */
-#define KEY_KP_ENTER		149	/* key pad */
-#define KEY_KP_1		150	/* key pad */
-#define KEY_KP_2		151	/* key pad */
-#define KEY_KP_3		152	/* key pad */
-#define KEY_KP_4		153	/* key pad */
-#define KEY_KP_5		154	/* key pad */
-#define KEY_KP_6		155	/* key pad */
-#define KEY_KP_COMMA		156	/* key pad */
-#define KEY_KP_7		157	/* key pad */
-#define KEY_KP_8		158	/* key pad */
-#define KEY_KP_9		159	/* key pad */
-#define KEY_KP_HYPHEN		160
-#define KEY_KP_PF1		161
-#define KEY_KP_PF2		162
-#define KEY_KP_PF3		163
-#define KEY_KP_PF4		164
-#define KEY_LEFT		167
-#define KEY_RIGHT		168
-#define KEY_DOWN		169
-#define KEY_UP			170
-#define KEY_SHIFT		174
-#define KEY_CTRL		175
-#define KEY_LOCK		176
-#define KEY_COMPOSE		177
-#define KEY_APPLE		177
-#define KEY_META		177
-#define KEY_DELETE		188
-#define KEY_RETURN		189
-#define KEY_TAB			190
-#define KEY_TILDE		191
-#define KEY_TR_1		192	/* Top Row */
-#define KEY_Q			193
-#define KEY_A			194
-#define KEY_Z			195
-#define KEY_TR_2		197
-#define KEY_W			198
-#define KEY_S			199
-#define KEY_X			200
-#define KEY_LANGLE_RANGLE	201	/* xxx */
-#define KEY_TR_3		203
-#define KEY_E			204
-#define KEY_D			205
-#define KEY_C			206
-#define KEY_TR_4		208
-#define KEY_R			209
-#define KEY_F			210
-#define KEY_V			211
-#define KEY_SPACE		212
-#define KEY_TR_5		214
-#define KEY_T			215
-#define KEY_G			216
-#define KEY_B			217
-#define KEY_TR_6		219
-#define KEY_Y			220
-#define KEY_H			221
-#define KEY_N			222
-#define KEY_TR_7		224
-#define KEY_U			225
-#define KEY_J			226
-#define KEY_M			227
-#define KEY_TR_8		229
-#define KEY_I			230
-#define KEY_K			231
-#define KEY_COMMA		232	/* xxx */
-#define KEY_TR_9		234
-#define KEY_O			235
-#define KEY_L			236
-#define KEY_PERIOD		237	/* xxx */
-#define KEY_TR_0		239
-#define KEY_P			240
-#define KEY_SEMICOLON		242	/* xxx */
-#define KEY_QMARK		243
-#define KEY_PLUS		245	/* xxx */
-#define KEY_RBRACE		246
-#define KEY_VBAR		247	/* xxx */
-#define KEY_UBAR		249	/* xxx */
-#define KEY_LBRACE		250
-#define KEY_QUOTE		251
commit d8cbcbc01d1355d55c1c0af64f7f7f61629f6c61
Author: Jamey Sharp <jamey at minilop.net>
Date:   Fri May 21 11:12:26 2010 -0700

    doPolyText: forget about FontChange's XID after looking up pFont.
    
    As of e2929db7b737413cf93fbebdf4d15abdfebff05c, doPolyText uses pFont
    consistently rather than looking it up again from the saved XID.
    
    clang noticed that "oldfid = fid" could run when fid hadn't been
    initialized yet.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index ba1d0e2..b6d54f8 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1173,7 +1173,6 @@ int
 doPolyText(ClientPtr client, PTclosurePtr c)
 {
     FontPtr pFont = c->pGC->font, oldpFont;
-    Font	fid, oldfid;
     int err = Success, lgerr;	/* err is in X error, not font error, space */
     enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT;
     FontPathElementPtr fpe;
@@ -1221,6 +1220,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
     {
 	if (*c->pElt == FontChange)
         {
+	    Font fid;
 	    if (c->endReq - c->pElt < FontShiftSize)
 	    {
 		 err = BadLength;
@@ -1228,7 +1228,6 @@ doPolyText(ClientPtr client, PTclosurePtr c)
 	    }
 
 	    oldpFont = pFont;
-	    oldfid = fid;
 
 	    fid =  ((Font)*(c->pElt+4))		/* big-endian */
 		 | ((Font)*(c->pElt+3)) << 8
@@ -1238,9 +1237,8 @@ doPolyText(ClientPtr client, PTclosurePtr c)
 					  client, DixUseAccess);
 	    if (err != Success)
 	    {
-		/* restore pFont and fid for step 4 (described below) */
+		/* restore pFont for step 4 (described below) */
 		pFont = oldpFont;
-		fid = oldfid;
 
 		/* If we're in START_SLEEP mode, the following step
 		   shortens the request...  in the unlikely event that


More information about the Xquartz-changes mailing list