[nautilus] list-base: Only calculate preferred action when in a drop
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] list-base: Only calculate preferred action when in a drop
- Date: Thu, 7 Jul 2022 22:43:48 +0000 (UTC)
commit c70517bcb4b48da0bfa6501dc2d2d2802c0a3576
Author: Corey Berla <corey berla me>
Date: Wed Jul 6 08:35:52 2022 -0700
list-base: Only calculate preferred action when in a drop
The begin_loading() function in list-base calculates the preferred
action for the view every time even in a current drop isn't occuring.
This is wasteful.
Check if the current drop is not NULL before calculating the
preferred aciton.
src/nautilus-list-base.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index 9060283c3..152bb1455 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -937,9 +937,12 @@ real_begin_loading (NautilusFilesView *files_view)
/* When DnD is used to navigate between directories, the normal callbacks
* 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;
+ if (gtk_drop_target_get_current_drop (priv->view_drop_target) != NULL)
+ {
+ 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;
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]