[nautilus/wip/corey/selection-performance: 25/26] files-view: Only update the background menu on clipboard owner changed




commit 9ef15a2ec4aa381b0588d76c79d284a45a70c635
Author: Corey Berla <corey berla me>
Date:   Sat Oct 1 08:18:10 2022 -0700

    files-view: Only update the background menu on clipboard owner changed
    
    Every time the clipboard owner is changed, we are updating the entire
    context menus.  This is file with small folders, but if you have
    100,000 items selected and you simply switch windows, it will
    recalculate the entire selection menu.  To make matters worse, if you
    receive a popup that the operation is taking a long time to complete,
    that is a clipboard owner change, and it will recalculate again.
    The only operation that we need from on_clipboard_owner_changed,
    is whether to paste or not, so just update the background menu.

 src/nautilus-files-view.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index c274174be..d60fed0d8 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -345,6 +345,8 @@ static void     set_search_query_internal (NautilusFilesView *files_view,
 
 static gboolean nautilus_files_view_is_read_only (NautilusFilesView *view);
 
+static void update_background_menu (NautilusFilesView *view);
+
 G_DEFINE_TYPE_WITH_CODE (NautilusFilesView,
                          nautilus_files_view,
                          ADW_TYPE_BIN,
@@ -7404,7 +7406,7 @@ on_clipboard_owner_changed (GdkClipboard *clipboard,
     NautilusFilesView *self = NAUTILUS_FILES_VIEW (user_data);
 
     /* Update paste menu item */
-    nautilus_files_view_update_context_menus (self);
+    update_background_menu (self);
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]