[nautilus] dnd: Use GDK_ACTION_ALL when possible
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] dnd: Use GDK_ACTION_ALL when possible
- Date: Sat, 9 Jul 2022 17:55:17 +0000 (UTC)
commit 778645c064de6cf6f7b0743471588d98f7ef678f
Author: Corey Berla <corey berla me>
Date: Sat Jul 9 09:35:32 2022 -0700
dnd: Use GDK_ACTION_ALL when possible
Use GDK_ACTION_ALL instead of `GDK_ACTION_MOVE | GDK_ACTION_COPY |
GDK_ACTION_LINK`
src/gtk/nautilusgtkplacessidebar.c | 2 +-
src/nautilus-list-base.c | 10 +++-------
src/nautilus-window-slot-dnd.c | 2 +-
3 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/src/gtk/nautilusgtkplacessidebar.c b/src/gtk/nautilusgtkplacessidebar.c
index 6400e6eab..5bb2b7cd7 100644
--- a/src/gtk/nautilusgtkplacessidebar.c
+++ b/src/gtk/nautilusgtkplacessidebar.c
@@ -3933,7 +3933,7 @@ nautilus_gtk_places_sidebar_init (NautilusGtkPlacesSidebar *sidebar)
gtk_widget_add_controller (GTK_WIDGET (sidebar), GTK_EVENT_CONTROLLER (gesture));
/* DND support */
- target = gtk_drop_target_new (G_TYPE_INVALID, GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK);
+ target = gtk_drop_target_new (G_TYPE_INVALID, GDK_ACTION_ALL);
gtk_drop_target_set_preload (target, TRUE);
gtk_drop_target_set_gtypes (target, (GType[2]) { NAUTILUS_TYPE_GTK_SIDEBAR_ROW, GDK_TYPE_FILE_LIST }, 2);
g_signal_connect (target, "enter", G_CALLBACK (drag_motion_callback), sidebar);
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index 1fa649bcd..e3156aa54 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -519,7 +519,7 @@ on_item_drag_prepare (GtkDragSource *source,
gtk_gesture_set_state (GTK_GESTURE (source), GTK_EVENT_SEQUENCE_CLAIMED);
- actions = GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_ASK | GDK_ACTION_MOVE;
+ actions = GDK_ACTION_ALL | GDK_ACTION_ASK;
for (GList *l = selection; l != NULL; l = l->next)
{
@@ -845,7 +845,6 @@ setup_cell_common (GtkListItem *listitem,
{
GtkEventController *controller;
GtkDropTarget *drop_target;
- GdkDragAction actions;
g_object_bind_property (listitem, "item",
cell, "item",
@@ -872,8 +871,7 @@ setup_cell_common (GtkListItem *listitem,
g_signal_connect (controller, "prepare", G_CALLBACK (on_item_drag_prepare), cell);
/* TODO: Implement GDK_ACTION_ASK */
- actions = GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK;
- drop_target = gtk_drop_target_new (G_TYPE_INVALID, actions);
+ drop_target = gtk_drop_target_new (G_TYPE_INVALID, GDK_ACTION_ALL);
gtk_drop_target_set_preload (drop_target, TRUE);
/* TODO: Implement GDK_TYPE_STRING */
gtk_drop_target_set_gtypes (drop_target, (GType[1]) { GDK_TYPE_FILE_LIST }, 1);
@@ -1718,7 +1716,6 @@ nautilus_list_base_setup_gestures (NautilusListBase *self)
GtkWidget *view_ui = nautilus_list_base_get_view_ui (self);
GtkEventController *controller;
GtkDropTarget *drop_target;
- GdkDragAction actions;
controller = GTK_EVENT_CONTROLLER (gtk_gesture_click_new ());
gtk_widget_add_controller (view_ui, controller);
@@ -1733,8 +1730,7 @@ nautilus_list_base_setup_gestures (NautilusListBase *self)
G_CALLBACK (on_view_longpress_pressed), self);
/* TODO: Implement GDK_ACTION_ASK */
- actions = GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK;
- drop_target = gtk_drop_target_new (G_TYPE_INVALID, actions);
+ drop_target = gtk_drop_target_new (G_TYPE_INVALID, GDK_ACTION_ALL);
gtk_drop_target_set_preload (drop_target, TRUE);
/* TODO: Implement GDK_TYPE_STRING */
gtk_drop_target_set_gtypes (drop_target, (GType[1]) { GDK_TYPE_FILE_LIST }, 1);
diff --git a/src/nautilus-window-slot-dnd.c b/src/nautilus-window-slot-dnd.c
index a04adc453..71aa458c9 100644
--- a/src/nautilus-window-slot-dnd.c
+++ b/src/nautilus-window-slot-dnd.c
@@ -341,7 +341,7 @@ nautilus_drag_slot_proxy_init (GtkWidget *widget,
drag_info->widget = widget;
/* TODO: Implement GDK_ACTION_ASK */
- target = gtk_drop_target_new (G_TYPE_INVALID, GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK);
+ target = gtk_drop_target_new (G_TYPE_INVALID, GDK_ACTION_ALL);
gtk_drop_target_set_preload (target, TRUE);
/* TODO: Implement GDK_TYPE_STRING */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]