spawn_async


Description:

public bool spawn_async (string? working_directory, string[] argv, string[]? envp, SpawnFlags flags, SpawnChildSetupFunc? child_setup, out Pid child_pid) throws Error

Executes a child program asynchronously with the right environment to automatically connect to this compositor.

See [func@GLib.spawn_async_with_pipes_and_fds] for a full description; this function simply calls [ func@GLib.spawn_async_with_pipes_and_fds] without any pipes and with WAYLAND_DISPLAY set to `CasildaCompositor: socket` or a fd already connected to the compositor and set to WAYLAND_SOCKET if its NULL.

Please note GDK_BACKEND, WAYLAND_DISPLAY and WAYLAND_SOCKET are set by this function they are ignored from envp and DISPLAY is removed to avoid clients try to connect using X11

Parameters:

this

a `CasildaCompositor`

working_directory

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

argv

child's argument vector

envp

child's environment, or null to inherit parent's

flags

flags from SpawnFlags

child_setup

function to run in the child just before `exec()`

child_pid

return location for child process reference, or null

user_data

user data for child_setup

Returns:

TRUE on success, FALSE if error is set.