Class: Gio::AppLaunchContext

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initializeGio::AppLaunchContext

Creates a new application launch context. This is not normally used, instead you instantiate a subclass of this, such as Gdk::AppLaunchContext.

Instance Method Details

#environmentArray<Gio::filename>

Gets the complete environment variable list to be passed to the child process when context is used to launch an application. This is an array of strings, where each string has the form KEY=VALUE.

Returns:

  • (Array<Gio::filename>)

    the child's environment

#get_display(info, files) ⇒ String

Gets the display string for the context. This is used to ensure new applications are started on the same display as the launching application, by setting the DISPLAY environment variable.

Parameters:

Returns:

  • (String)

    a display string for the display.

#get_startup_notify_id(info, files) ⇒ String

Initiates startup notification for the application and returns the XDG_ACTIVATION_TOKEN or DESKTOP_STARTUP_ID for the launched operation, if supported.

The returned token may be referred to equivalently as an ‘activation token’ (using Wayland terminology) or a ‘startup sequence ID’ (using X11 terminology). The two are interoperable.

Activation tokens are defined in the XDG Activation Protocol, and startup notification IDs are defined in the freedesktop.org Startup Notification Protocol.

Support for the XDG Activation Protocol was added in GLib 2.76.

Parameters:

Returns:

  • (String)

    a startup notification ID for the application, or nil if not supported.

#launch_failed(startup_notify_id) ⇒ nil

Called when an application has failed to launch, so that it can cancel the application startup notification started in g_app_launch_context_get_startup_notify_id().

Parameters:

  • startup_notify_id (String)

    the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().

Returns:

  • (nil)

#setenv(variable, value) ⇒ nil

Arranges for variable to be set to value in the child's environment when context is used to launch an application.

Parameters:

  • variable (Gio::filename)

    the environment variable to set

  • value (Gio::filename)

    the value for to set the variable to.

Returns:

  • (nil)

#unsetenv(variable) ⇒ nil

Arranges for variable to be unset in the child's environment when context is used to launch an application.

Parameters:

  • variable (Gio::filename)

    the environment variable to remove

Returns:

  • (nil)