[nautilus/gtk4-preparation-trunk: 48/49] files-view: Stop using gtk_widget_get_action_group()




commit 5263ed0b74eeb59dc1cc46640fc346f36ddab155
Author: António Fernandes <antoniof gnome org>
Date:   Fri Dec 31 19:10:47 2021 +0000

    files-view: Stop using gtk_widget_get_action_group()
    
    The function is gone in GTK 4.
    
    This has been introduced to fix https://bugzilla.gnome.org/show_bug.cgi?id=765489
    
    By studying the code and testing, I seems that checking whether this
    is the current active view is equivalent.

 src/nautilus-files-view.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index d7b13bd61..ea6d50be1 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -9226,13 +9226,11 @@ on_parent_changed (GObject    *object,
     else
     {
         remove_update_context_menus_timeout_callback (view);
-        /* Only remove the action group if it matchs the current view
-         * action group. If not, we can remove an action group set by
-         * a different view i.e. if the slot_active function is called
-         * before this one
+        /* Only remove the action group if this is still the active view.
+         * Otherwise we might be removing an action group set by a different
+         * view i.e. if slot_active_changed() is called before this one.
          */
-        if (gtk_widget_get_action_group (GTK_WIDGET (window), "view") ==
-            priv->view_action_group)
+        if (priv->active)
         {
             gtk_widget_insert_action_group (GTK_WIDGET (nautilus_files_view_get_window (view)),
                                             "view",


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