AppLaunchContext

GdkAppLaunchContext is an implementation of gio.AppLaunchContext 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

1 
2 GdkAppLaunchContext *context;
3 
4 context = gdk_display_get_app_launch_context (display);
5 
6 gdk_app_launch_context_set_screen (screen);
7 gdk_app_launch_context_set_timestamp (event->time);
8 
9 if (!g_app_info_launch_default_for_uri ("http://www.gtk.org", context, &error))
10 g_warning ("Launching failed: `s`\n", error->message);
11 
12 g_object_unref (context);

Constructors

this
this(GdkAppLaunchContext* gdkAppLaunchContext, bool ownedRef = false)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new gdk.AppLaunchContext

Members

Functions

getGdkAppLaunchContextStruct
GdkAppLaunchContext* getGdkAppLaunchContextStruct(bool transferOwnership = false)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

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(Display display)

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

setIcon
void setIcon(IconIF 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 AppLaunchContext.setIcon.

setScreen
void setScreen(Screen screen)

Sets the screen on which applications will be launched when using this context. See also 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.

Static functions

getType
GType getType()

Variables

gdkAppLaunchContext
GdkAppLaunchContext* gdkAppLaunchContext;

the main Gtk struct

Meta