spawn_on_screen_with_child_watch


Description:


public bool spawn_on_screen_with_child_watch (Screen? screen, string? working_directory, string argv, string? envp, SpawnFlags flags, bool startup_notify, uint32 startup_timestamp, string? startup_icon_name, Closure? child_watch_closure) throws Error

Like spawn_on_screen, but allows to attach a closure to watch the child's exit status.

This because only one g_child_watch_add is allowed on Unix (per PID) and this is already internally needed for a proper startup notification implementation.

<example> <title>Spawning with a child watch</title> <programlisting> static void child_watch_callback (GObject *object, gint status) { g_message ("Child exit status is d", status); }

static void spawn_something (void) { GClosure *child_watch;

child_watch = g_cclosure_new_swap (G_CALLBACK (child_watch_callback), object, NULL); xfce_spawn_on_screen_with_child_watch (..., child_watch, ...); } </programlisting> </example>

Parameters:

screen

a Screen or null to use the active screen, see gdk_screen_get_active.

working_directory

child's current working directory or null to inherit parent's.

argv

child's argument vector.

envp

child's environment vector or null to inherit parent's.

flags

flags from SpawnFlags. DO_NOT_REAP_CHILD is not allowed, you should use the child_watch_closure for this.

startup_notify

whether to use startup notification.

startup_timestamp

the timestamp to pass to startup notification, use the event time here if possible to make focus stealing prevention work property. If you don't have direct access to the event time you could use get_current_event_time or if nothing is available 0 is valid too.

startup_icon_name

application icon or null.

child_watch_closure

closure that is triggered when the child exists or null.

Returns:

true on success, false if throws is set.


Namespace: Xfce
Package: libxfce4ui-2