Method

CasildaCompositorspawn_async

Declaration [src]

gboolean
casilda_compositor_spawn_async (
  CasildaCompositor* compositor,
  const gchar* working_directory,
  gchar** argv,
  gchar** envp,
  GSpawnFlags flags,
  GSpawnChildSetupFunc child_setup,
  gpointer user_data,
  GPid* child_pid,
  GError** error
)

Description [src]

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

See g_spawn_async_with_pipes_and_fds() for a full description; this function simply calls g_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

working_directory

Type: const gchar*

Child’s current working directory, or NULL to inherit parent’s.

The argument can be NULL.
The data is owned by the caller of the method.
The value is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows.
argv

Type: An array of filename

Child’s argument vector.

The array must be NULL-terminated.
The data is owned by the caller of the method.
Each element is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows.
envp

Type: An array of filename

Child’s environment, or NULL to inherit parent’s.

The argument can be NULL.
The array must be NULL-terminated.
The data is owned by the caller of the method.
Each element is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows.
flags

Type: GSpawnFlags

Flags from GSpawnFlags.

child_setup

Type: GSpawnChildSetupFunc

Function to run in the child just before exec().

The argument can be NULL.
user_data

Type: gpointer

User data for child_setup.

The argument can be NULL.
The data is owned by the caller of the method.
child_pid

Type: GPid

Return location for child process reference, or NULL.

The argument will be set by the function.
The argument can be NULL.
The caller of the method takes ownership of the returned data, and is responsible for freeing it.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the method if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE on success, FALSE if error is set.