[Xfce4-commits] [xfce/thunar] 01/01: Fix updating custom actions (bug #11749)

noreply at xfce.org noreply at xfce.org
Mon Apr 13 15:21:51 CEST 2015


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository xfce/thunar.

commit d19eccf82cf56e0470c4c0f55a86b4c3d1bb9276
Author: Harald Judt <h.judt at gmx.at>
Date:   Sat Apr 11 17:49:53 2015 +0200

    Fix updating custom actions (bug #11749)
    
    https://developer.gnome.org/gtk3/stable/GtkUIManager.html#gtk-ui-manager-insert-action-group
    
    "Inserts an action group into the list of action groups associated with manager.
     Actions in earlier groups hide actions with the same name in later groups.
     If pos is larger than the number of action groups in manager, or negative,
     action_group will be inserted at the end of the internal list."
    
    Always keep the window actions (group "ThunarActions") at the top of the
    internal list of the GTK UI manager, so that they appear earlier. This
    way, the shortcuts will not be lost, and the custom actions for the
    context menu created by ThunarStandardView will work properly nonetheless.
    
    Also update the UI manager immediately after inserting the action group,
    otherwise GClosure warnings will spawn on stdout:
    "g_closure_add_invalidate_notifier: assertion 'closure->n_inotifiers <
     CLOSURE_MAX_N_INOTIFIERS' failed
     unable to remove uninstalled invalidation notifier"
---
 thunar/thunar-window.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 0825b58..3ca7ff0 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -3435,7 +3435,10 @@ thunar_window_update_custom_actions (ThunarView   *view,
       /* allocate the action group and the merge id for the custom actions */
       window->custom_actions = gtk_action_group_new ("ThunarActions");
       window->custom_merge_id = gtk_ui_manager_new_merge_id (window->ui_manager);
-      gtk_ui_manager_insert_action_group (window->ui_manager, window->custom_actions, -1);
+
+      /* insert the new action group and make sure the UI manager gets updated */
+      gtk_ui_manager_insert_action_group (window->ui_manager, window->custom_actions, 0);
+      gtk_ui_manager_ensure_update (window->ui_manager);
 
       /* add the actions to the UI manager */
       for (lp = actions; lp != NULL; lp = lp->next)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list