[nautilus/wip/antoniof/gtk4-preparation-discontinued-api: 28/32] files-view: Stop using gtk_widget_get_action_group()




commit 25a3218f1381b4ffd44a39cdac5a0249b2e8b489
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 eb2616a15..05c1bc090 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -9317,13 +9317,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]