Fix problems with drag cancellation. (#376535, Michael Natterer)

2006-11-17  Matthias Clasen  <mclasen@redhat.com>

	Fix problems with drag cancellation. (#376535, Michael Natterer)

	* gtk/gtkdnd.c (gtk_drag_source_info_destroy): Disconnect signal
	handlers before emitting drag-end.
	(gtk_drag_end): Disconnect signal handlers before removing
	the grab.
This commit is contained in:
Matthias Clasen 2006-11-18 04:37:33 +00:00 committed by Matthias Clasen
parent 52ae260503
commit 1312c002df
2 changed files with 24 additions and 13 deletions

View File

@ -1,3 +1,12 @@
2006-11-17 Matthias Clasen <mclasen@redhat.com>
Fix problems with drag cancellation. (#376535, Michael Natterer)
* gtk/gtkdnd.c (gtk_drag_source_info_destroy): Disconnect signal
handlers before emitting drag-end.
(gtk_drag_end): Disconnect signal handlers before removing
the grab.
2006-11-16 Mariano Suárez-Alvarez <mariano@gnome.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init):

View File

@ -3753,15 +3753,10 @@ gtk_drag_source_info_destroy (GtkDragSourceInfo *info)
gtk_drag_remove_icon (info);
if (info->icon_pixbuf)
g_object_unref (info->icon_pixbuf);
if (!info->proxy_dest)
g_signal_emit_by_name (info->widget, "drag_end",
info->context);
if (info->widget)
g_object_unref (info->widget);
{
g_object_unref (info->icon_pixbuf);
info->icon_pixbuf = NULL;
}
g_signal_handlers_disconnect_by_func (info->ipc_widget,
gtk_drag_grab_broken_event_cb,
@ -3782,6 +3777,13 @@ gtk_drag_source_info_destroy (GtkDragSourceInfo *info)
gtk_drag_selection_get,
info);
if (!info->proxy_dest)
g_signal_emit_by_name (info->widget, "drag_end",
info->context);
if (info->widget)
g_object_unref (info->widget);
gtk_selection_remove_all (info->ipc_widget);
g_object_set_data (G_OBJECT (info->ipc_widget), I_("gtk-info"), NULL);
source_widgets = g_slist_remove (source_widgets, info->ipc_widget);
@ -3926,10 +3928,6 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
info->have_grab = FALSE;
gdk_display_pointer_ungrab (display, time);
gdk_display_keyboard_ungrab (display, time);
gtk_grab_remove (info->ipc_widget);
g_signal_handlers_disconnect_by_func (info->ipc_widget,
gtk_drag_grab_broken_event_cb,
info);
@ -3946,6 +3944,10 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
gtk_drag_key_cb,
info);
gdk_display_pointer_ungrab (display, time);
gdk_display_keyboard_ungrab (display, time);
gtk_grab_remove (info->ipc_widget);
/* Send on a release pair to the original
* widget to convince it to release its grab. We need to
* call gtk_propagate_event() here, instead of