[gnome-builder/wip/gtk4-port: 1632/1774] libide/foundry: add started signal




commit 003646c01f6cacb7b74ab1b3fec18a229726a5e6
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jun 23 23:36:57 2022 -0700

    libide/foundry: add started signal
    
    We might as well have symmetry with the stopped. Additionally, this will
    allow the debug manager to know when to sync breakpoints.

 src/libide/foundry/ide-run-manager.c | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/src/libide/foundry/ide-run-manager.c b/src/libide/foundry/ide-run-manager.c
index 1785df6b4..303c00695 100644
--- a/src/libide/foundry/ide-run-manager.c
+++ b/src/libide/foundry/ide-run-manager.c
@@ -121,6 +121,7 @@ enum {
 
 enum {
   RUN,
+  STARTED,
   STOPPED,
   N_SIGNALS
 };
@@ -426,22 +427,34 @@ ide_run_manager_class_init (IdeRunManagerClass *klass)
                                 1,
                                 IDE_TYPE_RUN_CONTEXT);
 
+  /**
+   * IdeRunManager::started:
+   *
+   * This signal is emitted when the run manager has spawned a new subprocess.
+   */
+  signals [STARTED] =
+    g_signal_new ("started",
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_LAST,
+                  0,
+                  NULL, NULL,
+                  NULL,
+                  G_TYPE_NONE, 0);
+
   /**
    * IdeRunManager::stopped:
    *
-   * This signal is emitted when the run manager has stopped the currently
-   * executing inferior.
+   * This signal is emitted when the run manager has detected the running
+   * subprocess has exited.
    */
   signals [STOPPED] =
     g_signal_new ("stopped",
                   G_TYPE_FROM_CLASS (klass),
                   G_SIGNAL_RUN_LAST,
                   0,
+                  NULL, NULL,
                   NULL,
-                  NULL,
-                  NULL,
-                  G_TYPE_NONE,
-                  0);
+                  G_TYPE_NONE, 0);
 }
 
 gboolean
@@ -924,6 +937,8 @@ ide_run_manager_run_deploy_cb (GObject      *object,
     ide_notification_attach (self->notif, IDE_OBJECT (self));
   }
 
+  g_signal_emit (self, signals[STARTED], 0);
+
   /* Wait for the application to finish running */
   ide_subprocess_wait_check_async (subprocess,
                                    ide_task_get_cancellable (task),


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