Description [src]

final class Gdk.AppLaunchContext : Gio.AppLaunchContext
  /* No available fields */

GdkAppLaunchContext is an implementation of GAppLaunchContext that handles launching an application in a graphical context. It provides startup notification and allows to launch applications on a specific screen or workspace.

Launching an application

GdkAppLaunchContext *context;

context = gdk_display_get_app_launch_context (display);

gdk_app_launch_context_set_screen (screen);
gdk_app_launch_context_set_timestamp (event->time);

if (!g_app_info_launch_default_for_uri ("", context, &error))
  g_warning ("Launching failed: %s\n", error->message);

g_object_unref (context);


hierarchy this GdkAppLaunchContext ancestor_0 GAppLaunchContext ancestor_0--this ancestor_1 GObject ancestor_1--ancestor_0



Creates a new GdkAppLaunchContext.

deprecated: 3.0 since: 2.14

Instance methods


Sets the workspace on which applications will be launched when using this context when running under a window manager that supports multiple workspaces, as described in the Extended Window Manager Hints.

since: 2.14


Sets the display on which applications will be launched when using this context. See also gdk_app_launch_context_set_screen().

deprecated: 3.0 since: 2.14


Sets the icon for applications that are launched with this context.

since: 2.14


Sets the icon for applications that are launched with this context. The icon_name will be interpreted in the same way as the Icon field in desktop files. See also gdk_app_launch_context_set_icon().

since: 2.14


Sets the screen on which applications will be launched when using this context. See also gdk_app_launch_context_set_display().

since: 2.14


Sets the timestamp of context. The timestamp should ideally be taken from the event that triggered the launch.

since: 2.14

Methods inherited from GAppLaunchContext (6)

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.


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

since: 2.32


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


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().


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

since: 2.32


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

since: 2.32

Methods inherited from GObject (43)

Please see GObject for a full list of methods.


No description available.


Signals inherited from GAppLaunchContext (3)

The GAppLaunchContext::launch-failed signal is emitted when a GAppInfo launch fails. The startup notification id is provided, so that the launcher can cancel the startup notification.

since: 2.36


The GAppLaunchContext::launch-started signal is emitted when a GAppInfo is about to be launched. If non-null the platform_data is an GVariant dictionary mapping strings to variants (ie a{sv}), which contains additional, platform-specific data about this launch. On UNIX, at least the startup-notification-id keys will be present.

since: 2.72


The GAppLaunchContext::launched signal is emitted when a GAppInfo is successfully launched.

since: 2.36

Signals inherited from GObject (1)

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.