Silently return NULL if the widget is not realized. (#316023, Guillaume

2005-09-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon):
	* gtk/gtkiconview.c (gtk_icon_view_create_drag_icon): Silently
	return NULL if the widget is not realized.  (#316023,
	Guillaume Cottenceau)
This commit is contained in:
Matthias Clasen 2005-09-13 13:33:01 +00:00 committed by Matthias Clasen
parent fbd3568e4c
commit 676b09e798
4 changed files with 28 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2005-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon):
* gtk/gtkiconview.c (gtk_icon_view_create_drag_icon): Silently
return NULL if the widget is not realized. (#316023,
Guillaume Cottenceau)
2005-09-11 Matthias Clasen <mclasen@redhat.com> 2005-09-11 Matthias Clasen <mclasen@redhat.com>
* gdk/gdk.symbols: * gdk/gdk.symbols:

View File

@ -1,3 +1,10 @@
2005-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon):
* gtk/gtkiconview.c (gtk_icon_view_create_drag_icon): Silently
return NULL if the widget is not realized. (#316023,
Guillaume Cottenceau)
2005-09-11 Matthias Clasen <mclasen@redhat.com> 2005-09-11 Matthias Clasen <mclasen@redhat.com>
* gdk/gdk.symbols: * gdk/gdk.symbols:

View File

@ -6658,8 +6658,14 @@ gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
gint index; gint index;
GdkRectangle area; GdkRectangle area;
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), NULL);
g_return_val_if_fail (path != NULL, NULL);
widget = GTK_WIDGET (icon_view); widget = GTK_WIDGET (icon_view);
if (!GTK_WIDGET_REALIZED (widget))
return NULL;
index = gtk_tree_path_get_indices (path)[0]; index = gtk_tree_path_get_indices (path)[0];
for (l = icon_view->priv->items; l; l = l->next) for (l = icon_view->priv->items; l; l = l->next)

View File

@ -12190,8 +12190,8 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view,
* @tree_view: a #GtkTreeView * @tree_view: a #GtkTreeView
* @path: a #GtkTreePath in @tree_view * @path: a #GtkTreePath in @tree_view
* *
* Creates a #GdkPixmap representation of the row at @path. This image is used * Creates a #GdkPixmap representation of the row at @path.
* for a drag icon. * This image is used for a drag icon.
* *
* Return value: a newly-allocated pixmap of the drag icon. * Return value: a newly-allocated pixmap of the drag icon.
**/ **/
@ -12214,8 +12214,14 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view,
gint bin_window_width; gint bin_window_width;
gboolean is_separator = FALSE; gboolean is_separator = FALSE;
g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL);
g_return_val_if_fail (path != NULL, NULL);
widget = GTK_WIDGET (tree_view); widget = GTK_WIDGET (tree_view);
if (!GTK_WIDGET_REALIZED (tree_view))
return NULL;
depth = gtk_tree_path_get_depth (path); depth = gtk_tree_path_get_depth (path);
_gtk_tree_view_find_node (tree_view, _gtk_tree_view_find_node (tree_view,