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
This commit is contained in:
10:33:41 Tim Janik 2008-05-27 08:35:24 +00:00 committed by Tim Janik
parent 3f26314d0f
commit 727a7dbf46
2 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -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);