diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-09-06 19:36:09 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-09-06 19:36:09 +0000 |
commit | a7aa784c4afa94389ba5c2cdaf4fe11466421aea (patch) | |
tree | 2268704804db8aa99fd2458d424c775f18df78ad /gdk/gdkgc.c | |
parent | 7c7bcb243f2c0f4c6568de7b3a4a7f656c1ca87c (diff) | |
download | gtk+-a7aa784c4afa94389ba5c2cdaf4fe11466421aea.tar.gz |
Only set gc->colormap if it isn't already set. (Alex Larsson, #90632)
Fri Sep 6 15:35:01 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkgc.c (gdk_gc_new_with_values): Only set
gc->colormap if it isn't already set. (Alex Larsson,
#90632)
Diffstat (limited to 'gdk/gdkgc.c')
-rw-r--r-- | gdk/gdkgc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gdk/gdkgc.c b/gdk/gdkgc.c index 0c69e10851..3066399aa9 100644 --- a/gdk/gdkgc.c +++ b/gdk/gdkgc.c @@ -104,9 +104,15 @@ gdk_gc_new_with_values (GdkDrawable *drawable, if (values_mask & GDK_GC_TS_Y_ORIGIN) gc->ts_y_origin = values->ts_y_origin; - gc->colormap = gdk_drawable_get_colormap (drawable); - if (gc->colormap) - g_object_ref (G_OBJECT (gc->colormap)); + /* gc->colormap will already be set if gdk_gc_new_with_values() + * recurses - as in GdkPixmap => impl object. + */ + if (!gc->colormap) + { + gc->colormap = gdk_drawable_get_colormap (drawable); + if (gc->colormap) + g_object_ref (G_OBJECT (gc->colormap)); + } return gc; } |