summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgbert Eich <eich@suse.de>2004-07-30 21:10:46 +0000
committerEgbert Eich <eich@suse.de>2004-07-30 21:10:46 +0000
commit0ba15599466ddb644728c6b68e64e05b1317ac2e (patch)
treea8ffa0ec4b451b03536e7a0789cfd7d20c5a8911
parentbbfe7bed3fe4d9bd089327cd59e6faedb592dabb (diff)
Adding a colormap index to the InitColormapPrivate() func call. Without it
it was completely useless. test if colormap with index really exists in the list of installed maps before using it.
-rw-r--r--dix/privates.c2
-rw-r--r--hw/xfree86/common/xf86cmap.c11
-rw-r--r--hw/xwin/ChangeLog6
-rw-r--r--hw/xwin/winallpriv.c6
-rw-r--r--include/screenint.h2
-rw-r--r--lbx/lbxcmap.c2
6 files changed, 19 insertions, 10 deletions
diff --git a/dix/privates.c b/dix/privates.c
index 64d705e24..672738f29 100644
--- a/dix/privates.c
+++ b/dix/privates.c
@@ -358,7 +358,7 @@ InitCmapPrivFunc initPrivFunc;
pColormap->devPrivates = privs;
- if (!privs || !(*initPrivFunc)(pColormap))
+ if (!privs || !(*initPrivFunc)(pColormap,index))
{
colormapPrivateCount--;
return -1;
diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c
index 52ab57f4a..ee682aebb 100644
--- a/hw/xfree86/common/xf86cmap.c
+++ b/hw/xfree86/common/xf86cmap.c
@@ -1,4 +1,4 @@
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.2 2004/04/23 19:20:32 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.25 2003/10/17 20:02:12 alanh Exp $ */
/*
* Copyright (c) 1998-2001 by The XFree86 Project, Inc.
@@ -117,7 +117,7 @@ static int CMapChangeGamma(int, Gamma);
static void ComputeGamma(CMapScreenPtr);
static Bool CMapAllocateColormapPrivate(ColormapPtr);
-static Bool CMapInitDefMap(ColormapPtr);
+static Bool CMapInitDefMap(ColormapPtr,int);
static void CMapRefreshColors(ColormapPtr, int, int*);
static void CMapSetOverscan(ColormapPtr, int, int *);
static void CMapReinstallMap(ColormapPtr);
@@ -211,7 +211,7 @@ Bool xf86HandleColormaps(
/* get the default map */
pDefMap = (ColormapPtr) LookupIDByType(pScreen->defColormap, RT_COLORMAP);
-
+
if(!CMapAllocateColormapPrivate(pDefMap)) {
CMapUnwrapScreen(pScreen);
return FALSE;
@@ -224,7 +224,7 @@ Bool xf86HandleColormaps(
}
static Bool
-CMapInitDefMap(ColormapPtr cmap)
+CMapInitDefMap(ColormapPtr cmap, int index)
{
return TRUE;
}
@@ -433,7 +433,8 @@ CMapInstallColormap(ColormapPtr pmap)
/* Important. We let the lower layers, namely DGA,
overwrite the choice of Colormap to install */
- pmap = miInstalledMaps[index];
+ if (miInstalledMaps[index])
+ pmap = miInstalledMaps[index];
if(!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
(pmap->pVisual->class == TrueColor) &&
diff --git a/hw/xwin/ChangeLog b/hw/xwin/ChangeLog
index 9cc35ce6e..efec39370 100644
--- a/hw/xwin/ChangeLog
+++ b/hw/xwin/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-30 Egbert Eich <set EMAIL_ADDRESS environment variable>
+
+ reviewed by: <delete if not using a buddy>
+
+ * winallpriv.c: (winInitCmapPrivates):
+
2004-07-09 Alexander Gottwald <ago@freedesktop.org>
* winconfig.c: Add entry for irish layout (ie)
diff --git a/hw/xwin/winallpriv.c b/hw/xwin/winallpriv.c
index 8fca13926..2c85645c7 100644
--- a/hw/xwin/winallpriv.c
+++ b/hw/xwin/winallpriv.c
@@ -116,7 +116,7 @@ winAllocatePrivates (ScreenPtr pScreen)
*/
Bool
-winInitCmapPrivates (ColormapPtr pcmap)
+winInitCmapPrivates (ColormapPtr pcmap, int index)
{
#if CYGDEBUG
winDebug ("winInitCmapPrivates\n");
@@ -129,7 +129,9 @@ winInitCmapPrivates (ColormapPtr pcmap)
* anything. Perhaps I am misunderstanding the purpose
* of this function.
*/
-
+ /* That's definitely true.
+ * I therefore changed the API and added the index as argument.
+ */
return TRUE;
}
diff --git a/include/screenint.h b/include/screenint.h
index b3e76c4c2..1c836952e 100644
--- a/include/screenint.h
+++ b/include/screenint.h
@@ -104,7 +104,7 @@ extern void ResetColormapPrivates(void);
typedef struct _ColormapRec *ColormapPtr;
-typedef int (*InitCmapPrivFunc)(ColormapPtr);
+typedef int (*InitCmapPrivFunc)(ColormapPtr, int);
extern int AllocateColormapPrivateIndex(
InitCmapPrivFunc /* initPrivFunc */);
diff --git a/lbx/lbxcmap.c b/lbx/lbxcmap.c
index b1366aa3f..5c2c062b3 100644
--- a/lbx/lbxcmap.c
+++ b/lbx/lbxcmap.c
@@ -104,7 +104,7 @@ LbxColormapPrivInit (ColormapPtr pmap)
static int
-LbxDefCmapPrivInit (ColormapPtr pmap)
+LbxDefCmapPrivInit (ColormapPtr pmap, int index)
{
#if 0
/* BUG: You can't do that. lbxColormapPrivIndex hasn't