summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-06-21 15:08:40 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-06-24 22:40:29 +0000
commit70597de0a5b7f43b368364fd46564c0054314dda (patch)
tree7a195b874ec9a812922f7ef53d187d153d632f7a
parent75b19169cf2ed555f8fab8d5747e7e2ffc22bc49 (diff)
downloadgtk+-70597de0a5b7f43b368364fd46564c0054314dda.tar.gz
widget: Pass shortcuts to the action muxer
Send the shortcuts used by shortcut managers and the per-class shortcuts to the action muxer for associating accels with actions. The action muxer has existing machinery for propagating accels to the UI.
-rw-r--r--gtk/gtkwidget.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8dd7223ddf..3eb9f50c71 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -11738,6 +11738,19 @@ _gtk_widget_get_action_muxer (GtkWidget *widget,
if (create || priv->actions)
{
muxer = gtk_action_muxer_new (widget, priv->actions);
+
+ gtk_action_muxer_add_shortcuts (muxer, G_LIST_MODEL (GTK_WIDGET_GET_CLASS (widget)->priv->shortcuts));
+ if (GTK_IS_SHORTCUT_MANAGER (widget))
+ {
+ GListModel *shortcuts;
+
+ shortcuts = G_LIST_MODEL (g_object_get_data (G_OBJECT (widget), "gtk-shortcut-manager-bubble"));
+ gtk_action_muxer_add_shortcuts (muxer, shortcuts);
+
+ shortcuts = G_LIST_MODEL (g_object_get_data (G_OBJECT (widget), "gtk-shortcut-manager-capture"));
+ gtk_action_muxer_add_shortcuts (muxer, shortcuts);
+ }
+
g_object_set_qdata_full (G_OBJECT (widget),
quark_action_muxer,
muxer,