AppLaunchContext

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 ("http://www.gtk.org", context, &error))
  g_warning ("Launching failed: %s\n", error->message);

g_object_unref (context);

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this()

Creates a new #GdkAppLaunchContext.

Members

Functions

self
AppLaunchContext self()

Returns this, for use in with statements.

setDesktop
void setDesktop(int desktop)

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.

setDisplay
void setDisplay(gdk.display.Display display)

Sets the display on which applications will be launched when using this context. See also gdk.app_launch_context.AppLaunchContext.setScreen.

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. The icon_name will be interpreted in the same way as the Icon field in desktop files. See also gdk.app_launch_context.AppLaunchContext.setIcon.

setScreen
void setScreen(gdk.screen.Screen screen)

Sets the screen on which applications will be launched when using this context. See also gdk.app_launch_context.AppLaunchContext.setDisplay.

setTimestamp
void setTimestamp(uint timestamp)

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

Properties

_gType
GType _gType [@property getter]
display
gdk.display.Display display [@property getter]

Static functions

_getGType
GType _getGType()
builder
AppLaunchContextGidBuilder builder()

Get builder for gdk.app_launch_context.AppLaunchContext

Inherited Members

From AppLaunchContext

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
AppLaunchContext self()

Returns this, for use in with statements.

builder
AppLaunchContextGidBuilder builder()

Get builder for gio.app_launch_context.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
gulong connectLaunchFailed(T callback, Flag!"After" after)

Connect to LaunchFailed signal.

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

Connect to LaunchStarted signal.

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

Connect to Launched signal.