AppInfoT.launch

Launches the application. Passes files to the launched application as arguments, using the optional launch_context to get information about the details of the launcher (like what screen it is on). On error, error will be set accordingly. To launch the application without arguments pass a NULL files list. Note that even if the launch is successful the application launched can fail to start if it runs into problems during startup. There is no way to detect this. Some URIs can be changed when passed through a GFile (for instance unsupported uris with strange formats like mailto:), so if you have a textual uri you want to pass in as argument, consider using g_app_info_launch_uris() instead. On UNIX, this function sets the GIO_LAUNCHED_DESKTOP_FILE environment variable with the path of the launched desktop file and GIO_LAUNCHED_DESKTOP_FILE_PID to the process id of the launched process. This can be used to ignore GIO_LAUNCHED_DESKTOP_FILE, should it be inherited by further processes. The DISPLAY and DESKTOP_STARTUP_ID environment variables are also set, based on information provided in launch_context.

template AppInfoT(TStruct)
int
launch

Parameters

files ListG

a GList of GFile objects. [element-type GFile]

launchContext AppLaunchContext

a GAppLaunchContext or NULL. [allow-none]

Return Value

Type: int

TRUE on successful launch, FALSE otherwise.

Throws

GException on failure.

Meta