droptarget: Fix confusion around ::leave signal

The leave signal should not take any arguments,
don't pass the GdkDrop. Update the documentation,
fix the emission and update users to match.

This was showing up as crash when dragging files
over the places sidebar.
This commit is contained in:
Matthias Clasen 2020-05-08 08:47:06 -04:00
parent 42ca760f9c
commit d06cdf6318
2 changed files with 1 additions and 3 deletions

View File

@ -471,7 +471,7 @@ gtk_drop_target_handle_crossing (GtkEventController *controller,
crossing->new_target == widget)
return;
g_signal_emit (self, signals[LEAVE], 0, self->drop);
g_signal_emit (self, signals[LEAVE], 0);
if (!self->dropping)
gtk_drop_target_end_drop (self);
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE);
@ -731,7 +731,6 @@ gtk_drop_target_class_init (GtkDropTargetClass *class)
/**
* GtkDropTarget::leave:
* @self: the #GtkDropTarget
* @drop: the #GdkDrop
*
* The ::leave signal is emitted on the drop site when the pointer
* leaves the widget. Its main purpose it to undo things done in

View File

@ -1912,7 +1912,6 @@ dnd_finished_cb (GdkDrag *drag,
*/
static void
drag_leave_callback (GtkDropTarget *dest,
GdkDrop *drop,
gpointer user_data)
{
GtkPlacesSidebar *sidebar = GTK_PLACES_SIDEBAR (user_data);