[gtk/shortcuts-rebased-again: 121/139] widget: Pass shortcuts to the action muxer



commit 5e4b55d4dcf40e77ce11186e1f08308129eebb74
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jun 21 15:08:40 2019 +0000

    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.

 gtk/gtkwidget.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f030496de3..079f25d78c 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -11734,6 +11734,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,


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