mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-30 15:31:34 +00:00
placessidebar: Fix dnd cancellation
When the drag is canceled by being dropped outside, we get a ::cancel emission, that we want to handle just like ::dnd-finished. Fixes: #3037
This commit is contained in:
parent
e18de295c6
commit
dbbc9b5c58
@ -1896,6 +1896,14 @@ dnd_finished_cb (GdkDrag *drag,
|
||||
stop_drop_feedback (sidebar);
|
||||
}
|
||||
|
||||
static void
|
||||
dnd_cancel_cb (GdkDrag *drag,
|
||||
GdkDragCancelReason reason,
|
||||
GtkPlacesSidebar *sidebar)
|
||||
{
|
||||
stop_drop_feedback (sidebar);
|
||||
}
|
||||
|
||||
/* This functions is called every time the drag source leaves
|
||||
* the sidebar widget.
|
||||
* The problem is that, we start showing hints for drop when the source
|
||||
@ -3494,6 +3502,7 @@ on_row_dragged (GtkGestureDrag *gesture,
|
||||
g_object_unref (content);
|
||||
|
||||
g_signal_connect (drag, "dnd-finished", G_CALLBACK (dnd_finished_cb), sidebar);
|
||||
g_signal_connect (drag, "cancel", G_CALLBACK (dnd_cancel_cb), sidebar);
|
||||
|
||||
gtk_widget_get_allocation (sidebar->drag_row, &allocation);
|
||||
gtk_widget_hide (sidebar->drag_row);
|
||||
|
Loading…
Reference in New Issue
Block a user