diff --git a/ChangeLog b/ChangeLog index 538554f41e..8dc912f532 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu May 27 16:36:22 2004 Owen Taylor + + * gdk/x11/gdkcolor-x11.c (gdk_colormap_alloc_colors): Set + bits within visual->depth that aren't used for color to + 1s, in case they are alpha. + 2004-05-27 Anders Carlsson * gtk/gtkfilechooserdefault.c (save_folder_combo_create): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 538554f41e..8dc912f532 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Thu May 27 16:36:22 2004 Owen Taylor + + * gdk/x11/gdkcolor-x11.c (gdk_colormap_alloc_colors): Set + bits within visual->depth that aren't used for color to + 1s, in case they are alpha. + 2004-05-27 Anders Carlsson * gtk/gtkfilechooserdefault.c (save_folder_combo_create): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 538554f41e..8dc912f532 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Thu May 27 16:36:22 2004 Owen Taylor + + * gdk/x11/gdkcolor-x11.c (gdk_colormap_alloc_colors): Set + bits within visual->depth that aren't used for color to + 1s, in case they are alpha. + 2004-05-27 Anders Carlsson * gtk/gtkfilechooserdefault.c (save_folder_combo_create): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 538554f41e..8dc912f532 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Thu May 27 16:36:22 2004 Owen Taylor + + * gdk/x11/gdkcolor-x11.c (gdk_colormap_alloc_colors): Set + bits within visual->depth that aren't used for color to + 1s, in case they are alpha. + 2004-05-27 Anders Carlsson * gtk/gtkfilechooserdefault.c (save_folder_combo_create): diff --git a/gdk/x11/gdkcolor-x11.c b/gdk/x11/gdkcolor-x11.c index 6265dcfc7a..4a0b9ebf8a 100644 --- a/gdk/x11/gdkcolor-x11.c +++ b/gdk/x11/gdkcolor-x11.c @@ -1126,7 +1126,13 @@ gdk_colormap_alloc_colors (GdkColormap *colormap, for (i = 0; i < ncolors; i++) { - colors[i].pixel = (((colors[i].red >> (16 - visual->red_prec)) << visual->red_shift) + + /* If bits not used for color are used for something other than padding, + * it's likely alpha, so we set them to 1s. + */ + guint32 unused = ~ (visual->red_mask | visual->green_mask | visual->blue_mask | + (((~(guint32)0)) << visual->depth)); + colors[i].pixel = (unused + + ((colors[i].red >> (16 - visual->red_prec)) << visual->red_shift) + ((colors[i].green >> (16 - visual->green_prec)) << visual->green_shift) + ((colors[i].blue >> (16 - visual->blue_prec)) << visual->blue_shift)); success[i] = TRUE;