always call gdk_drag_status() before returning FALSE.

2004-09-10  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpcontainertreeview-dnd.c
	(gimp_container_tree_view_drop_status): always call
	gdk_drag_status() before returning FALSE.

	(gimp_container_tree_view_drag_motion): never return FALSE, an
	impossible drop location is now reported by calling
	gdk_drag_status() above. Always returning TRUE makes sure
	gimp_container_tree_view_drag_leave() is called unconditionally
	and can remove the scroll_timeout set in drag_motion().

	Fixes bug #152193 and many other obscure DND crashes caused by the
	scroll_timeout being invoked after the widget is destroyed.
This commit is contained in:
Michael Natterer 2004-09-10 12:20:16 +00:00 committed by Michael Natterer
parent 8f3ea939a8
commit 4b553f186c
2 changed files with 29 additions and 11 deletions

View file

@ -1,3 +1,18 @@
2004-09-10 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcontainertreeview-dnd.c
(gimp_container_tree_view_drop_status): always call
gdk_drag_status() before returning FALSE.
(gimp_container_tree_view_drag_motion): never return FALSE, an
impossible drop location is now reported by calling
gdk_drag_status() above. Always returning TRUE makes sure
gimp_container_tree_view_drag_leave() is called unconditionally
and can remove the scroll_timeout set in drag_motion().
Fixes bug #152193 and many other obscure DND crashes caused by the
scroll_timeout being invoked after the widget is destroyed.
2004-09-10 Sven Neumann <sven@gimp.org>
* plug-ins/common/xpm.c: improved PDB blurb and help. Very loosely

View file

@ -56,13 +56,13 @@ gimp_container_tree_view_drop_status (GimpContainerTreeView *tree_view,
GimpDndType src_type;
if (! gimp_container_view_get_reorderable (GIMP_CONTAINER_VIEW (tree_view)))
return FALSE;
goto drop_impossible;
target_list = gtk_drag_dest_get_target_list (GTK_WIDGET (tree_view->view));
target_atom = gtk_drag_dest_find_target (GTK_WIDGET (tree_view->view),
context, target_list);
if (! gtk_target_list_find (target_list, target_atom, &src_type))
return FALSE;
goto drop_impossible;
switch (src_type)
{
@ -81,12 +81,12 @@ gimp_container_tree_view_drop_status (GimpContainerTreeView *tree_view,
src_widget = gtk_drag_get_source_widget (context);
if (! src_widget)
return FALSE;
goto drop_impossible;
src_viewable = gimp_dnd_get_drag_data (src_widget);
if (! GIMP_IS_VIEWABLE (src_viewable))
return FALSE;
goto drop_impossible;
}
break;
}
@ -152,11 +152,13 @@ gimp_container_tree_view_drop_status (GimpContainerTreeView *tree_view,
return TRUE;
}
gdk_drag_status (context, 0, time);
gtk_tree_path_free (path);
}
drop_impossible:
gdk_drag_status (context, 0, time);
return FALSE;
}
@ -267,13 +269,14 @@ gimp_container_tree_view_drag_motion (GtkWidget *widget,
{
gtk_tree_view_set_drag_dest_row (tree_view->view, path, drop_pos);
gtk_tree_path_free (path);
return TRUE;
}
else
{
gtk_tree_view_unset_rows_drag_dest (tree_view->view);
}
gtk_tree_view_unset_rows_drag_dest (tree_view->view);
return FALSE;
/* always return TRUE so drag_leave() is called */
return TRUE;
}
gboolean