summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-12-09 02:25:14 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-12-09 02:25:14 +0000
commite4c9e2ebcad6167cc304cff2a284df32a4666d43 (patch)
tree95677fdcd559662b083c92210317c238d5660d5e /gdk
parentfac76f942636905932240a4327cd8d76c6360017 (diff)
downloadgdk-pixbuf-e4c9e2ebcad6167cc304cff2a284df32a4666d43.tar.gz
When allocating non-writeable colors, fill in the flags field of the
Sun Dec 8 21:22:46 2002 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkcolor-x11.c (gdk_colormap_alloc_colors_private): When allocating non-writeable colors, fill in the flags field of the XColor, and insert the returned color into our color hash. (#100023, Naofumi Yasufuku) * gdk/x11/gdkcolor-x11.c (gdk_colormap_free_colors): Fix a typo (my fault) that slipped in in the last patch.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/x11/gdkcolor-x11.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gdk/x11/gdkcolor-x11.c b/gdk/x11/gdkcolor-x11.c
index 5cc43e136..53d53cce3 100644
--- a/gdk/x11/gdkcolor-x11.c
+++ b/gdk/x11/gdkcolor-x11.c
@@ -715,7 +715,7 @@ gdk_colormap_free_colors (GdkColormap *colormap,
}
}
- if (npixels_to_free && !private->private_val && !private->screen->closed)
+ if (npixels && !private->private_val && !private->screen->closed)
XFreeColors (GDK_SCREEN_XDISPLAY (private->screen), private->xcolormap,
pixels, npixels, 0);
@@ -868,12 +868,18 @@ gdk_colormap_alloc_colors_private (GdkColormap *colormap,
store[nstore].blue = colors[i].blue;
store[nstore].green = colors[i].green;
store[nstore].pixel = index;
+ store[nstore].flags = DoRed | DoGreen | DoBlue;
nstore++;
success[i] = TRUE;
-
colors[i].pixel = index;
+
+ colormap->colors[i] = colors[i];
private->info[index].ref_count++;
+
+ g_hash_table_insert (private->hash,
+ &colormap->colors[index],
+ &colormap->colors[index]);
}
else
nremaining++;