[nautilus/gnome-3-20] files-view: remove action group only matches view group



commit 2ae11252ac13609e6e3278bfc64d7aca06b26733
Author: Carlos Soriano <csoriano gnome org>
Date:   Mon Apr 25 17:04:46 2016 +0200

    files-view: remove action group only matches view group
    
    We were removing the action group when the parent is unset.
    However, this removes the action group from the window unconditionally,
    meaning that if the view that the parent is unset for is not the current
    view it will remove the action group of the actual current view, making
    the actions unreachable outside of the view.
    
    This was causing the action menu in the toolbar to have non activatable
    actions.
    
    To fix it, make sure we remove the action group only if it matches the
    current one attached to the window.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765489

 src/nautilus-files-view.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index b6fd475..caf39cb 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -7794,9 +7794,18 @@ nautilus_files_view_parent_set (GtkWidget *widget,
                                                   view);
         } else {
                 remove_update_context_menus_timeout_callback (view);
-                gtk_widget_insert_action_group (GTK_WIDGET (nautilus_files_view_get_window (view)),
-                                                "view",
-                                                NULL);
+                /* 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
+                 */
+                if (gtk_widget_get_action_group (GTK_WIDGET (window), "view") ==
+                    view->details->view_action_group) {
+                        gtk_widget_insert_action_group (GTK_WIDGET (nautilus_files_view_get_window (view)),
+                                                        "view",
+                                                        NULL);
+
+                    }
         }
 }
 


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