gtkwindow: Use actions from focused widget to activate accel

Currently we only take into account the window GActionGroup for
activating the accels.

However, the application could have some custom GActionGroup in the
chain of focused widgets that could want to activate some action if
some accel is activated while that widget is focused.

To allow applications to set accels on widgets that use custom
GActionGroups, simply use the muxer of the focused widget, which
already contains the actions of the parents.

https://bugzilla.gnome.org/show_bug.cgi?id=740682
This commit is contained in:
Carlos Soriano
2014-12-03 15:53:59 +01:00
committed by Christian Hergert
parent 17fec70022
commit 235837ad49
6 changed files with 46 additions and 31 deletions

View File

@ -2194,7 +2194,7 @@ gtk_menu_shell_bind_model (GtkMenuShell *menu_shell,
g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
g_return_if_fail (model == NULL || G_IS_MENU_MODEL (model));
muxer = _gtk_widget_get_action_muxer (GTK_WIDGET (menu_shell));
muxer = _gtk_widget_get_action_muxer (GTK_WIDGET (menu_shell), TRUE);
g_clear_pointer (&menu_shell->priv->tracker, gtk_menu_tracker_free);