From: Egbert Eich Date: Tue Jun 3 18:17:07 2014 +0200 Subject: [PATCH]Fix number of colormap entries for DirectColor and TrueColor visuals Patch-mainline: to be upstreamed Git-commit: 071525466531009223f1c21a40aa2e081d5ef99a Git-repo: References: bnc# Signed-off-by: Egbert Eich DirectColor and TrueColor have a decomposed colormap, therefore the colormap_size field in the XVisualInfo structure is meant per sub-field (take a look at the output of xdpyinfo). With 3 sub-fields there are colormap_size^3 entires. Signed-off-by: Egbert Eich --- xterm-299/misc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: xterm-385/misc.c =================================================================== --- xterm-385.orig/misc.c +++ xterm-385/misc.c @@ -2698,6 +2698,8 @@ getColormapInfo(XtermWidget xw, unsigned if (getVisualInfo(xw)) { *typep = (unsigned) xw->visInfo->class; *sizep = (unsigned) xw->visInfo->colormap_size; + if (*typep > 3) + *sizep = (*sizep)*(*sizep)*(*sizep); } else { *typep = 0; *sizep = 0;