diff options
author | 10:33:41 Tim Janik <timj@imendio.com> | 2008-05-27 08:35:24 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2008-05-27 08:35:24 +0000 |
commit | 727a7dbf461b48b2c35c5a94bd61ce5996b92a92 (patch) | |
tree | b1bb523e8bf1cd4d423a9529c25abec6f7a1a0d7 | |
parent | 3f26314d0fd32a55b03c80356ed561e18558e536 (diff) | |
download | gtk+-727a7dbf461b48b2c35c5a94bd61ce5996b92a92.tar.gz |
guard gtk_widget_get_snapshot() against invalid or invisible widgets.
2008-05-27 10:33:41 Tim Janik <timj@imendio.com>
* gtk/gtkwidget.c: guard gtk_widget_get_snapshot() against
invalid or invisible widgets.
svn path=/trunk/; revision=20187
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 4 |
2 files changed, 9 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2008-05-27 10:33:41 Tim Janik <timj@imendio.com> + + * gtk/gtkwidget.c: guard gtk_widget_get_snapshot() against + invalid or invisible widgets. + 2008-05-27 Matthias Clasen <mclasen@redhat.com> Bug 531008 – Crash in gtkprintunixdialog.c diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 171be8525c..7496c00c88 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -8356,6 +8356,10 @@ gtk_widget_get_snapshot (GtkWidget *widget, GdkPixmap *pixmap; GList *windows = NULL, *list; + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); + if (!GTK_WIDGET_VISIBLE (widget)) + return NULL; + /* the widget (and parent_window) must be realized to be drawable */ if (widget->parent && !GTK_WIDGET_REALIZED (widget->parent)) gtk_widget_realize (widget->parent); |