Commit da1a2de8 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

remember for which GdkDragContext the icon_widget was made.

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

	* app/widgets/gimpdnd.c (gimp_dnd_data_drag_begin): remember for
	which GdkDragContext the icon_widget was made.

	(gimp_dnd_data_drag_end): destroy the icon_widget only if it was
	created for this GdkDragContext. Fixes broken DND icon_widgets
	when dragging the same source again while the old icon_widget is
	still floating back from an unsuccessful drop. Fixes bug #139337.
parent 131da633
2004-10-06 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdnd.c (gimp_dnd_data_drag_begin): remember for
which GdkDragContext the icon_widget was made.
(gimp_dnd_data_drag_end): destroy the icon_widget only if it was
created for this GdkDragContext. Fixes broken DND icon_widgets
when dragging the same source again while the old icon_widget is
still floating back from an unsuccessful drop. Fixes bug #139337.
2004-10-05 Manish Singh <yosh@gimp.org>
* tools/pdbgen/lib.pl: Slight cleanup of doc generating code.
......
......@@ -607,6 +607,9 @@ gimp_dnd_data_drag_begin (GtkWidget *widget,
gtk_drag_set_icon_widget (context, window,
DRAG_ICON_OFFSET, DRAG_ICON_OFFSET);
/* remember for which drag context the widget was made */
g_object_set_data (G_OBJECT (window), "gimp-gdk-drag-context", context);
}
}
......@@ -614,7 +617,22 @@ static void
gimp_dnd_data_drag_end (GtkWidget *widget,
GdkDragContext *context)
{
g_object_set_data (G_OBJECT (widget), "gimp-dnd-data-widget", NULL);
GtkWidget *icon_widget;
icon_widget = g_object_get_data (G_OBJECT (widget), "gimp-dnd-data-widget");
if (icon_widget)
{
/* destroy the icon_widget only if it was made for this drag
* context. See bug #139337.
*/
if (g_object_get_data (G_OBJECT (icon_widget),
"gimp-gdk-drag-context") ==
(gpointer) context)
{
g_object_set_data (G_OBJECT (widget), "gimp-dnd-data-widget", NULL);
}
}
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment