gi-gdk-4.0.4: Gdk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gdk.Objects.AppLaunchContext

Description

GdkAppLaunchContext handles launching an application in a graphical context.

It is an implementation of GAppLaunchContext that provides startup notification and allows to launch applications on a specific screen or workspace.

Launching an application

c code

GdkAppLaunchContext *context;

context = gdk_display_get_app_launch_context (display);

gdk_app_launch_context_set_display (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);
Synopsis

Exported types

class (GObject o, IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o Source #

Type class for types which can be safely cast to AppLaunchContext, for instance with toAppLaunchContext.

Instances

Instances details
(GObject o, IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o Source # 
Instance details

Defined in GI.Gdk.Objects.AppLaunchContext

toAppLaunchContext :: (MonadIO m, IsAppLaunchContext o) => o -> m AppLaunchContext Source #

Cast to AppLaunchContext, for types for which this is known to be safe. For general casts, use castTo.

Methods

getDisplay

appLaunchContextGetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a) 
=> a

context: a GdkAppLaunchContext

-> m Display

Returns: the display of context

Gets the GdkDisplay that context is for.

setDesktop

appLaunchContextSetDesktop Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a) 
=> a

context: a GdkAppLaunchContext

-> Int32

desktop: the number of a workspace, or -1

-> m () 

Sets the workspace on which applications will be launched.

This only works when running under a window manager that supports multiple workspaces, as described in the Extended Window Manager Hints.

When the workspace is not specified or desktop is set to -1, it is up to the window manager to pick one, typically it will be the current workspace.

setIcon

appLaunchContextSetIcon Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsIcon b) 
=> a

context: a GdkAppLaunchContext

-> Maybe b

icon: a GIcon

-> m () 

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

Window Managers can use this information when displaying startup notification.

See also appLaunchContextSetIconName.

setIconName

appLaunchContextSetIconName Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a) 
=> a

context: a GdkAppLaunchContext

-> Maybe Text

iconName: an icon name

-> m () 

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

The iconName will be interpreted in the same way as the Icon field in desktop files. See also appLaunchContextSetIcon.

If both icon and iconName are set, the iconName takes priority. If neither icon or iconName is set, the icon is taken from either the file that is passed to launched application or from the GAppInfo for the launched application itself.

setTimestamp

appLaunchContextSetTimestamp Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a) 
=> a

context: a GdkAppLaunchContext

-> Word32

timestamp: a timestamp

-> m () 

Sets the timestamp of context.

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

Window managers can use this information to avoid moving the focus to the newly launched application when the user is busy typing in another window. This is also known as 'focus stealing prevention'.

Properties

display

The display that the GdkAppLaunchContext is on.

constructAppLaunchContextDisplay :: (IsAppLaunchContext o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “display” property. This is rarely needed directly, but it is used by new.

getAppLaunchContextDisplay :: (MonadIO m, IsAppLaunchContext o) => o -> m Display Source #

Get the value of the “display” property. When overloading is enabled, this is equivalent to

get appLaunchContext #display