[nautilus] Revert "list-base: Update drag action without holding a DropTarget in priv"
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Revert "list-base: Update drag action without holding a DropTarget in priv"
- Date: Thu, 7 Jul 2022 22:43:48 +0000 (UTC)
commit b084571e65bcd80f34faae44f6cbe89d5633595d
Author: Corey Berla <corey berla me>
Date: Wed Jul 6 08:30:59 2022 -0700
Revert "list-base: Update drag action without holding a DropTarget in priv"
This reverts commit ec9a7beceee648cd14fb0bf7cff27fc478caff6d.
We are going back to the previous solution, but making it less wasteful in
the next commit.
src/nautilus-list-base.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index 15a57d18b..9060283c3 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -50,7 +50,7 @@ struct _NautilusListBasePrivate
GdkDragAction drag_item_action;
GdkDragAction drag_view_action;
guint hover_timer_id;
- gboolean drag_view_action_invalidated;
+ GtkDropTarget *view_drop_target;
};
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (NautilusListBase, nautilus_list_base, NAUTILUS_TYPE_FILES_VIEW)
@@ -803,16 +803,6 @@ on_view_drag_motion (GtkDropTarget *target,
NautilusListBase *self = user_data;
NautilusListBasePrivate *priv = nautilus_list_base_get_instance_private (self);
- if (priv->drag_view_action_invalidated)
- {
- NautilusFile *dest_file;
-
- dest_file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (self));
- priv->drag_view_action = get_preferred_action (dest_file,
- gtk_drop_target_get_value (target));
- priv->drag_view_action_invalidated = FALSE;
- }
-
return priv->drag_view_action;
}
@@ -946,8 +936,9 @@ real_begin_loading (NautilusFilesView *files_view)
priv->deny_background_click = FALSE;
/* When DnD is used to navigate between directories, the normal callbacks
- * are ignored. Invalidate / clear actions when changing directories*/
- priv->drag_view_action_invalidated = TRUE;
+ * are ignored. Update DnD variables here upon navigating to a directory*/
+ priv->drag_view_action = get_preferred_action (nautilus_files_view_get_directory_as_file (files_view),
+ gtk_drop_target_get_value (priv->view_drop_target));
priv->drag_item_action = 0;
}
@@ -1714,6 +1705,7 @@ nautilus_list_base_get_model (NautilusListBase *self)
void
nautilus_list_base_setup_gestures (NautilusListBase *self)
{
+ NautilusListBasePrivate *priv = nautilus_list_base_get_instance_private (self);
GtkWidget *view_ui = nautilus_list_base_get_view_ui (self);
GtkEventController *controller;
GtkDropTarget *drop_target;
@@ -1742,4 +1734,5 @@ nautilus_list_base_setup_gestures (NautilusListBase *self)
g_signal_connect (drop_target, "motion", G_CALLBACK (on_view_drag_motion), self);
g_signal_connect (drop_target, "drop", G_CALLBACK (on_view_drop), self);
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (drop_target));
+ priv->view_drop_target = drop_target;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]