[nautilus/wip/corey/selection-performance: 2/6] files-view: Only update context menus if actually pending




commit a095671c9bdf06f5dcbaa7d9d7d00c2b5ce9cd95
Author: Corey Berla <corey berla me>
Date:   Sat Oct 1 08:07:36 2022 -0700

    files-view: Only update context menus if actually pending
    
    update_context_menus_if_pending() updates the menus regardless
    of if an operation is pending.  Check if there's a pending timeout.

 src/nautilus-files-view.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 72c0b3678..894c0146c 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -4459,9 +4459,13 @@ remove_update_context_menus_timeout_callback (NautilusFilesView *view)
 static void
 update_context_menus_if_pending (NautilusFilesView *view)
 {
-    remove_update_context_menus_timeout_callback (view);
+    NautilusFilesViewPrivate *priv = nautilus_files_view_get_instance_private (view);
 
-    nautilus_files_view_update_context_menus (view);
+    if (priv->update_context_menus_timeout_id != 0)
+    {
+        remove_update_context_menus_timeout_callback (view);
+        nautilus_files_view_update_context_menus (view);
+    }
 }
 
 static gboolean


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