AppLaunchContext

gdk.app_launch_context.AppLaunchContext handles launching an application in a graphical context.

It is an implementation of gio.app_launch_context.AppLaunchContext that provides startup notification and allows to launch applications on a specific workspace.

Launching an application

GdkAppLaunchContext *context;

context = gdk_display_get_app_launch_context (display);

gdk_app_launch_context_set_timestamp (gdk_event_get_time (event));

if (!g_app_info_launch_default_for_uri ("http://www.gtk.org", context, &error))
  g_warning ("Launching failed: %s\n", error->message);

g_object_unref (context);

Members

Functions

getDisplay
gdk.display.Display getDisplay()

Gets the gdk.display.Display that context is for.

setDesktop
void setDesktop(int desktop)

Sets the workspace on which applications will be launched.

setIcon
void setIcon(gio.icon.Icon icon)

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

setIconName
void setIconName(string iconName)

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

setTimestamp
void setTimestamp(uint timestamp)

Sets the timestamp of context.

Inherited Members

From AppLaunchContext

getDisplay
string getDisplay(gio.app_info.AppInfo info, gio.file.File[] files)

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.

getEnvironment
string[] getEnvironment()

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.

getStartupNotifyId
string getStartupNotifyId(gio.app_info.AppInfo info, gio.file.File[] files)

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

launchFailed
void launchFailed(string startupNotifyId)

Called when an application has failed to launch, so that it can cancel the application startup notification started in gio.app_launch_context.AppLaunchContext.getStartupNotifyId.

setenv
void setenv(string variable, string value)

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

unsetenv
void unsetenv(string variable)

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

connectLaunchFailed
ulong connectLaunchFailed(T callback, Flag!"After" after)

Connect to LaunchFailed signal.

connectLaunchStarted
ulong connectLaunchStarted(T callback, Flag!"After" after)

Connect to LaunchStarted signal.

connectLaunched
ulong connectLaunched(T callback, Flag!"After" after)

Connect to Launched signal.