diff options
author | 21:10:15 Tim Janik <timj@imendio.com> | 2008-05-21 19:15:12 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2008-05-21 19:15:12 +0000 |
commit | b3d160ced5fd07f7ba5e8d2a61386e77882993a2 (patch) | |
tree | 657522a0fad2410ca66da7e9c4ba05af511916c0 /tests | |
parent | aa4ab3f03731f269d8c3a322cee653bc88fec3a4 (diff) | |
download | gtk+-b3d160ced5fd07f7ba5e8d2a61386e77882993a2.tar.gz |
added GdkRectangle *clip_rect to gtk_widget_get_snapshot().
2008-05-21 21:10:15 Tim Janik <timj@imendio.com>
* gtk/gtkwidget.h: added GdkRectangle *clip_rect to gtk_widget_get_snapshot().
* gtk/gtkwidget.c: clip the returned snapshot pixmap to clip_rect.
return snapshot pixmap coordinates widget relative in *clip_rect.
* tests/testgtk.c: fixed bogus NULL pointer unref.
svn path=/trunk/; revision=20124
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testgtk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c index e0a47e9b45..7b89acff75 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -12259,16 +12259,16 @@ snapshot_widget_event (GtkWidget *widget, if (res_widget) { GdkPixmap *pixmap; - GdkPixbuf *pixbuf = NULL; GtkWidget *window, *image; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - pixmap = gtk_widget_get_snapshot (res_widget); + pixmap = gtk_widget_get_snapshot (res_widget, NULL); gtk_widget_realize (window); if (gdk_drawable_get_depth (window->window) != gdk_drawable_get_depth (pixmap)) { /* this branch is needed to convert ARGB -> RGB */ int width, height; + GdkPixbuf *pixbuf; gdk_drawable_get_size (pixmap, &width, &height); pixbuf = gdk_pixbuf_get_from_drawable (NULL, pixmap, gtk_widget_get_colormap (res_widget), @@ -12276,10 +12276,10 @@ snapshot_widget_event (GtkWidget *widget, 0, 0, width, height); image = gtk_image_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); } else image = gtk_image_new_from_pixmap (pixmap, NULL); - g_object_unref (pixbuf); gtk_container_add (GTK_CONTAINER (window), image); g_object_unref (pixmap); gtk_widget_show_all (window); |