From d06cdf63185ba586b8bd90b8b241f6d3ea9f1b46 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 8 May 2020 08:47:06 -0400 Subject: [PATCH] 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. --- gtk/gtkdroptarget.c | 3 +-- gtk/gtkplacessidebar.c | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/gtk/gtkdroptarget.c b/gtk/gtkdroptarget.c index dac70c7da5..ad38fc683b 100644 --- a/gtk/gtkdroptarget.c +++ b/gtk/gtkdroptarget.c @@ -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 diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 178c3bde66..06712a79e2 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -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);