[gtk/shortcuts-rebased-again: 115/117] widget: Pass shortcuts to the action muxer



commit 21abb06360f6b14d6b8dfba79785533d2522ba9c
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 b0bc184569..51005a56b6 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]