diff options
author | Havoc Pennington <hp@redhat.com> | 2000-11-02 17:18:53 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2000-11-02 17:18:53 +0000 |
commit | 0ee86faa3c020df861dd4969fb587479d37aa7bd (patch) | |
tree | 456d3523a5480def91f5df00abf2c813c1a6728e /gdk | |
parent | 214c61d575a8d180eccb08e0a778f6f7c8f41eaf (diff) | |
download | gtk+-0ee86faa3c020df861dd4969fb587479d37aa7bd.tar.gz |
had a test backward
2000-11-02 Havoc Pennington <hp@redhat.com>
* gtk/testgtk.c (create_labels): had a test backward
* gdk/x11/gdkgc-x11.c (gdk_gc_copy): Copy the client-side GC
fields, so the dest GC ends up with the correct clip origin,
etc. Fixes a bug where colored labels didn't redraw
properly.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/x11/gdkgc-x11.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gdk/x11/gdkgc-x11.c b/gdk/x11/gdkgc-x11.c index a5b0088b00..0f78a853e3 100644 --- a/gdk/x11/gdkgc-x11.c +++ b/gdk/x11/gdkgc-x11.c @@ -683,9 +683,35 @@ gdk_gc_set_clip_region (GdkGC *gc, void gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc) { + GdkGCX11 *x11_src_gc; + GdkGCX11 *x11_dst_gc; + g_return_if_fail (GDK_IS_GC_X11 (dst_gc)); g_return_if_fail (GDK_IS_GC_X11 (src_gc)); + + x11_dst_gc = GDK_GC_X11 (dst_gc); + x11_src_gc = GDK_GC_X11 (src_gc); XCopyGC (GDK_GC_XDISPLAY (src_gc), GDK_GC_XGC (src_gc), ~((~1) << GCLastBit), GDK_GC_XGC (dst_gc)); + + dst_gc->clip_x_origin = src_gc->clip_x_origin; + dst_gc->clip_y_origin = src_gc->clip_y_origin; + dst_gc->ts_x_origin = src_gc->ts_x_origin; + dst_gc->ts_y_origin = src_gc->ts_y_origin; + + if (src_gc->colormap) + g_object_ref (G_OBJECT (src_gc->colormap)); + + if (dst_gc->colormap) + g_object_unref (G_OBJECT (dst_gc->colormap)); + + dst_gc->colormap = src_gc->colormap; + + if (x11_dst_gc->clip_region) + gdk_region_destroy (x11_dst_gc->clip_region); + + x11_dst_gc->clip_region = gdk_region_copy (x11_src_gc->clip_region); + + x11_dst_gc->dirty_mask = x11_src_gc->dirty_mask; } |