[nautilus/1535-nautilus-crashes-when-dragging-from-archive-manager] window-slot-dnd: Fix data retrieval failure path
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/1535-nautilus-crashes-when-dragging-from-archive-manager] window-slot-dnd: Fix data retrieval failure path
- Date: Fri, 16 Jul 2021 22:37:28 +0000 (UTC)
commit 67a0c763b64a7d5c0adacfa84e875ff1060a0ed3
Author: António Fernandes <antoniof gnome org>
Date: Fri Jul 16 22:47:40 2021 +0100
window-slot-dnd: Fix data retrieval failure path
When data retrieval fails, ::drag-data-received is emitted with a
selection of negative length.
We have been treating this case as invalid data, but we never actually
call gdk_drag_finish() which is mandatory after a drop.
Instead, reset drag_info->have_data to FALSE in this case, and let
slot_proxy_handle_drop() handle the rest.
src/nautilus-window-slot-dnd.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-window-slot-dnd.c b/src/nautilus-window-slot-dnd.c
index 9509d2c97..ec0134e46 100644
--- a/src/nautilus-window-slot-dnd.c
+++ b/src/nautilus-window-slot-dnd.c
@@ -472,17 +472,21 @@ slot_proxy_drag_data_received (GtkWidget *widget,
drag_info = user_data;
g_assert (!drag_info->have_data);
-
- drag_info->have_data = TRUE;
- drag_info->info = info;
drag_info->waiting_for_data = FALSE;
if (gtk_selection_data_get_length (data) < 0)
{
- drag_info->have_valid_data = FALSE;
+ /* Data retrieval failed. */
+ if (drag_info->drop_occurred)
+ {
+ gtk_drag_finish (context, FALSE, FALSE, time);
+ }
return;
}
+ drag_info->have_data = TRUE;
+ drag_info->info = info;
+
if (info == NAUTILUS_ICON_DND_GNOME_ICON_LIST)
{
drag_info->data.selection_list = nautilus_drag_build_selection_list (data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]