gi-gdk-3.0.22: Gdk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gdk.Objects.AppLaunchContext

Description

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

C code

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);
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

Overloaded methods

new

appLaunchContextNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m AppLaunchContext

Returns: a new AppLaunchContext

Deprecated: (Since version 3.0)Use displayGetAppLaunchContext instead

Creates a new AppLaunchContext.

Since: 2.14

setDesktop

appLaunchContextSetDesktop Source #

Arguments

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

context: a AppLaunchContext

-> Int32

desktop: the number of a workspace, or -1

-> m () 

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.

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.

Since: 2.14

setDisplay

appLaunchContextSetDisplay Source #

Arguments

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

context: a AppLaunchContext

-> b

display: a Display

-> m () 

Deprecated: (Since version 3.0)Use displayGetAppLaunchContext instead

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

Since: 2.14

setIcon

appLaunchContextSetIcon Source #

Arguments

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

context: a AppLaunchContext

-> Maybe b

icon: a Icon, or Nothing

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

Since: 2.14

setIconName

appLaunchContextSetIconName Source #

Arguments

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

context: a AppLaunchContext

-> Maybe Text

iconName: an icon name, or Nothing

-> 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 AppInfo for the launched application itself.

Since: 2.14

setScreen

appLaunchContextSetScreen Source #

Arguments

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

context: a AppLaunchContext

-> b

screen: a Screen

-> m () 

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

If both screen and display are set, the screen takes priority. If neither screen or display are set, the default screen and display are used.

Since: 2.14

setTimestamp

appLaunchContextSetTimestamp Source #

Arguments

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

context: a AppLaunchContext

-> 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'.

Since: 2.14

Properties

display

No description available in the introspection data.

constructAppLaunchContextDisplay :: (IsAppLaunchContext o, IsDisplay a) => a -> IO (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 (Maybe Display) Source #

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

get appLaunchContext #display