Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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
- newtype AppLaunchContext = AppLaunchContext (ManagedPtr AppLaunchContext)
- class (GObject o, IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o
- toAppLaunchContext :: (MonadIO m, IsAppLaunchContext o) => o -> m AppLaunchContext
- appLaunchContextNew :: (HasCallStack, MonadIO m) => m AppLaunchContext
- appLaunchContextSetDesktop :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> Int32 -> m ()
- appLaunchContextSetDisplay :: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsDisplay b) => a -> b -> m ()
- appLaunchContextSetIcon :: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsIcon b) => a -> Maybe b -> m ()
- appLaunchContextSetIconName :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> Maybe Text -> m ()
- appLaunchContextSetScreen :: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsScreen b) => a -> b -> m ()
- appLaunchContextSetTimestamp :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> Word32 -> m ()
- constructAppLaunchContextDisplay :: (IsAppLaunchContext o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o)
- getAppLaunchContextDisplay :: (MonadIO m, IsAppLaunchContext o) => o -> m (Maybe Display)
Exported types
newtype AppLaunchContext Source #
Memory-managed wrapper type.
AppLaunchContext (ManagedPtr AppLaunchContext) |
Instances
Eq AppLaunchContext Source # | |
Defined in GI.Gdk.Objects.AppLaunchContext (==) :: AppLaunchContext -> AppLaunchContext -> Bool (/=) :: AppLaunchContext -> AppLaunchContext -> Bool | |
GObject AppLaunchContext Source # | |
Defined in GI.Gdk.Objects.AppLaunchContext | |
ManagedPtrNewtype AppLaunchContext Source # | |
Defined in GI.Gdk.Objects.AppLaunchContext toManagedPtr :: AppLaunchContext -> ManagedPtr AppLaunchContext | |
TypedObject AppLaunchContext Source # | |
Defined in GI.Gdk.Objects.AppLaunchContext glibType :: IO GType | |
IsGValue AppLaunchContext Source # | Convert |
Defined in GI.Gdk.Objects.AppLaunchContext toGValue :: AppLaunchContext -> IO GValue fromGValue :: GValue -> IO AppLaunchContext | |
HasParentTypes AppLaunchContext Source # | |
Defined in GI.Gdk.Objects.AppLaunchContext | |
type ParentTypes AppLaunchContext Source # | |
Defined in GI.Gdk.Objects.AppLaunchContext type ParentTypes AppLaunchContext = '[AppLaunchContext, Object] |
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
(GObject o, IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o Source # | |
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
:: (HasCallStack, MonadIO m) | |
=> m AppLaunchContext | Returns: a new |
Deprecated: (Since version 3.0)Use displayGetAppLaunchContext
instead
Creates a new AppLaunchContext
.
Since: 2.14
setDesktop
appLaunchContextSetDesktop Source #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a) | |
=> a |
|
-> Int32 |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsDisplay b) | |
=> a |
|
-> b |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsIcon b) | |
=> a |
|
-> Maybe b |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a) | |
=> a |
|
-> Maybe Text |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsScreen b) | |
=> a |
|
-> b |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a) | |
=> a |
|
-> Word32 |
|
-> 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, 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 (Maybe Display) Source #
Get the value of the “display
” property.
When overloading is enabled, this is equivalent to
get
appLaunchContext #display