From a2ef3022b9cd1c0cef61c1183e698cf406715bea Mon Sep 17 00:00:00 2001 From: Corey Berla Date: Thu, 17 Nov 2022 13:34:24 -0800 Subject: list-base: Fix non-local DnD in x11 We are using a workaround to get the preferred action in x11 where we check the preferred action of the drag. This works for local drags, but obviously not non-local drags. The workaround is necessary because of a bug in gtk. Let's just default back to COPY for non-local drags. --- src/nautilus-list-base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c index 93c20ccd3..d19bb65f6 100644 --- a/src/nautilus-list-base.c +++ b/src/nautilus-list-base.c @@ -866,7 +866,7 @@ on_item_drop (GtkDropTarget *target, * is merged. Without this fix, the preferred action isn't set correctly. * https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4982 */ GdkDrag *drag = gdk_drop_get_drag (gtk_drop_target_get_current_drop (target)); - actions = gdk_drag_get_selected_action (drag); + actions = drag != NULL ? gdk_drag_get_selected_action (drag) : GDK_ACTION_COPY; } #endif @@ -964,7 +964,7 @@ on_view_drop (GtkDropTarget *target, * is merged. Without this fix, the preferred action isn't set correctly. * https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4982 */ GdkDrag *drag = gdk_drop_get_drag (gtk_drop_target_get_current_drop (target)); - actions = gdk_drag_get_selected_action (drag); + actions = drag != NULL ? gdk_drag_get_selected_action (drag) : GDK_ACTION_COPY; } #endif -- cgit v1.2.1