[gnome-builder] libide/gui: insert context action group into workspaces



commit 0f064610663e60570ff3129baf917d39d9e76d2c
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 26 17:13:58 2022 -0700

    libide/gui: insert context action group into workspaces
    
    The idea here is that we can put a lot of things into a single muxer
    as part of the context and insert that into workspaces rather than all
    of the individual action groups managed here and there.

 src/libide/gui/ide-workbench.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/libide/gui/ide-workbench.c b/src/libide/gui/ide-workbench.c
index f19d6f878..66903b141 100644
--- a/src/libide/gui/ide-workbench.c
+++ b/src/libide/gui/ide-workbench.c
@@ -804,6 +804,7 @@ void
 ide_workbench_add_workspace (IdeWorkbench *self,
                              IdeWorkspace *workspace)
 {
+  g_autoptr(IdeActionMuxer) muxer = NULL;
   g_autoptr(GPtrArray) addins = NULL;
   IdeShortcutManager *shortcuts;
   GList *mru_link;
@@ -834,6 +835,12 @@ ide_workbench_add_workspace (IdeWorkbench *self,
    */
   _ide_workspace_set_context (workspace, self->context);
 
+  /* Connect context actions to the workspace */
+  muxer = ide_context_ref_action_muxer (self->context);
+  gtk_widget_insert_action_group (GTK_WIDGET (workspace),
+                                  "context",
+                                  G_ACTION_GROUP (muxer));
+
   /* This causes the workspace to get an additional reference to the group
    * (which already happens from GtkWindow:group), but IdeWorkspace will
    * remove itself in IdeWorkspace.destroy.


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