Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- newtype AppLaunchContext = AppLaunchContext (ManagedPtr AppLaunchContext)
- class (GObject o, IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o
- toAppLaunchContext :: (MonadIO m, IsAppLaunchContext o) => o -> m AppLaunchContext
- appLaunchContextGetDisplay :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> m Display
- appLaunchContextSetDesktop :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> Int32 -> m ()
- appLaunchContextSetIcon :: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsIcon b) => a -> Maybe b -> m ()
- appLaunchContextSetIconName :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> Maybe Text -> 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 Display
Exported types
newtype AppLaunchContext Source #
Memory-managed wrapper type.
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 | |
TypedObject AppLaunchContext Source # | |
Defined in GI.Gdk.Objects.AppLaunchContext | |
HasParentTypes AppLaunchContext Source # | |
Defined in GI.Gdk.Objects.AppLaunchContext | |
IsGValue (Maybe AppLaunchContext) Source # | Convert |
Defined in GI.Gdk.Objects.AppLaunchContext gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe AppLaunchContext -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe AppLaunchContext) # | |
type ParentTypes AppLaunchContext Source # | |
Defined in GI.Gdk.Objects.AppLaunchContext |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, launchFailed, notify, notifyByPspec, ref, refSink, runDispose, setenv, stealData, stealQdata, thawNotify, unref, unsetenv, watchClosure.
Getters
getData, getDisplay, getEnvironment, getProperty, getQdata, getStartupNotifyId.
Setters
setData, setDataFull, setDesktop, setIcon, setIconName, setProperty, setTimestamp.
getDisplay
appLaunchContextGetDisplay Source #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a) | |
=> a |
|
-> m Display | Returns: the display of |
Gets the GdkDisplay
that context
is for.
setDesktop
appLaunchContextSetDesktop Source #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a) | |
=> a |
|
-> Int32 |
|
-> 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 #
:: (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
.
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 GAppInfo
for the launched application itself.
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'.
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