GWin32AppInfo: Actually report the GPid in the GAppLaunchContext::launched signal

We need to pass the G_SPAWN_DO_NOT_REAP_CHILD flag to g_spawn_async,
otherwise the returned child_pid will always be 0.
This commit is contained in:
Luca Bacci
2022-07-28 12:21:50 +02:00
parent 9bc9a9b62a
commit 45bdeeddff
3 changed files with 11 additions and 1 deletions

View File

@@ -1439,6 +1439,11 @@ g_app_launch_context_class_init (GAppLaunchContextClass *klass)
* example if the process was launched via D-Bus). The `pid` may not be
* set at all in subsequent releases.
*
* On Windows, `pid` is guaranteed to be valid only for the duration of the
* #GAppLaunchContext::launched signal emission; after the signal is emitted,
* GLib will call g_spawn_close_pid(). If you need to keep the #GPid after the
* signal has been emitted, then you can duplicate `pid` using `DuplicateHandle()`.
*
* Since: 2.36
*/
signals[LAUNCHED] = g_signal_new (I_("launched"),