gi-gdk-3.0.28: Gdk bindings

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

GI.Gdk.Objects.Display

Contents

- Exported types
- Methods
  - beep
  - close
  - deviceIsGrabbed
  - flush
  - getAppLaunchContext
  - getDefault
  - getDefaultCursorSize
  - getDefaultGroup
  - getDefaultScreen
  - getDefaultSeat
  - getDeviceManager
  - getEvent
  - getMaximalCursorSize
  - getMonitor
  - getMonitorAtPoint
  - getMonitorAtWindow
  - getNMonitors
  - getNScreens
  - getName
  - getPointer
  - getPrimaryMonitor
  - getScreen
  - getWindowAtPointer
  - hasPending
  - isClosed
  - keyboardUngrab
  - listDevices
  - listSeats
  - notifyStartupComplete
  - open
  - openDefaultLibgtkOnly
  - peekEvent
  - pointerIsGrabbed
  - pointerUngrab
  - putEvent
  - requestSelectionNotification
  - setDoubleClickDistance
  - setDoubleClickTime
  - storeClipboard
  - supportsClipboardPersistence
  - supportsComposite
  - supportsCursorAlpha
  - supportsCursorColor
  - supportsInputShapes
  - supportsSelectionNotification
  - supportsShapes
  - sync
  - warpPointer
- Signals
  - closed
  - monitorAdded
  - monitorRemoved
  - opened
  - seatAdded
  - seatRemoved

Description

`Display` objects purpose are two fold:

- To manage and provide information about input devices (pointers and keyboards)
- To manage and provide information about the available `GdkScreens`

GdkDisplay objects are the GDK representation of an X Display, which can be described as a workstation consisting of a keyboard, a pointing device (such as a mouse) and one or more screens. It is used to open and keep track of various GdkScreen objects currently instantiated by the application. It is also used to access the keyboard(s) and mouse pointer(s) of the display.

Most of the input device handling has been factored out into the separate `DeviceManager` object. Every display has a device manager, which you can obtain using `displayGetDeviceManager`.

Synopsis

- newtype Display = Display (ManagedPtr Display)
- class (GObject o, IsDescendantOf Display o) => IsDisplay o
- toDisplay :: (MonadIO m, IsDisplay o) => o -> m Display
- displayBeep :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m ()
- displayClose :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m ()
- displayDeviceIsGrabbed :: (HasCallStack, MonadIO m, IsDisplay a, IsDevice b) => a -> b -> m Bool
- displayFlush :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m ()
- displayGetAppLaunchContext :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m AppLaunchContext
- displayGetDefault :: (HasCallStack, MonadIO m) => m (Maybe Display)
- displayGetDefaultCursorSize :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Word32
- displayGetDefaultGroup :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Window
- displayGetDefaultScreen :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Screen
- displayGetDefaultSeat :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Seat
- displayGetDeviceManager :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m (Maybe DeviceManager)
- displayGetEvent :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m (Maybe Event)
- displayGetMaximalCursorSize :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m (Word32, Word32)
- displayGetMonitor :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Int32 -> m (Maybe Monitor)
- displayGetMonitorAtPoint :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Int32 -> Int32 -> m Monitor
- displayGetMonitorAtWindow :: (HasCallStack, MonadIO m, IsDisplay a, IsWindow b) => a -> b -> m Monitor
- displayGetNMonitors :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Int32
- displayGetNScreens :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Int32
- displayGetName :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Text
- displayGetPointer :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m (Screen, Int32, Int32, [ModifierType])
- displayGetPrimaryMonitor :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m (Maybe Monitor)
- displayGetScreen :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Int32 -> m Screen
- displayGetWindowAtPointer :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m (Maybe Window, Int32, Int32)
- displayHasPending :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Bool
- displayIsClosed :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Bool
- displayKeyboardUngrab :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Word32 -> m ()
- displayListDevices :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m [Device]
- displayListSeats :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m [Seat]
- displayNotifyStartupComplete :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Text -> m ()
- displayOpen :: (HasCallStack, MonadIO m) => Text -> m (Maybe Display)
- displayOpenDefaultLibgtkOnly :: (HasCallStack, MonadIO m) => m (Maybe Display)
- displayPeekEvent :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m (Maybe Event)
- displayPointerIsGrabbed :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Bool
- displayPointerUngrab :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Word32 -> m ()
- displayPutEvent :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Event -> m ()
- displayRequestSelectionNotification :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Atom -> m Bool
- displaySetDoubleClickDistance :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Word32 -> m ()
- displaySetDoubleClickTime :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Word32 -> m ()
- displayStoreClipboard :: (HasCallStack, MonadIO m, IsDisplay a, IsWindow b) => a -> b -> Word32 -> Maybe [Atom] -> m ()
- displaySupportsClipboardPersistence :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Bool
- displaySupportsComposite :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Bool
- displaySupportsCursorAlpha :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Bool
- displaySupportsCursorColor :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Bool
- displaySupportsInputShapes :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Bool
- displaySupportsSelectionNotification :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Bool
- displaySupportsShapes :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Bool
- displaySync :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m ()
- displayWarpPointer :: (HasCallStack, MonadIO m, IsDisplay a, IsScreen b) => a -> b -> Int32 -> Int32 -> m ()
- type DisplayClosedCallback = Bool -> IO ()
- afterDisplayClosed :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayClosedCallback) -> m SignalHandlerId
- onDisplayClosed :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayClosedCallback) -> m SignalHandlerId
- type DisplayMonitorAddedCallback = Monitor -> IO ()
- afterDisplayMonitorAdded :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayMonitorAddedCallback) -> m SignalHandlerId
- onDisplayMonitorAdded :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayMonitorAddedCallback) -> m SignalHandlerId
- type DisplayMonitorRemovedCallback = Monitor -> IO ()
- afterDisplayMonitorRemoved :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayMonitorRemovedCallback) -> m SignalHandlerId
- onDisplayMonitorRemoved :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayMonitorRemovedCallback) -> m SignalHandlerId
- type DisplayOpenedCallback = IO ()
- afterDisplayOpened :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayOpenedCallback) -> m SignalHandlerId
- onDisplayOpened :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayOpenedCallback) -> m SignalHandlerId
- type DisplaySeatAddedCallback = Seat -> IO ()
- afterDisplaySeatAdded :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplaySeatAddedCallback) -> m SignalHandlerId
- onDisplaySeatAdded :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplaySeatAddedCallback) -> m SignalHandlerId
- type DisplaySeatRemovedCallback = Seat -> IO ()
- afterDisplaySeatRemoved :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplaySeatRemovedCallback) -> m SignalHandlerId
- onDisplaySeatRemoved :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplaySeatRemovedCallback) -> m SignalHandlerId

# Exported types

newtype Display Source #

Memory-managed wrapper type.

Constructors

Display (ManagedPtr Display) |

#### Instances

Instances details

Eq Display Source # |
Instance details Defined in GI.Gdk.Objects.Display Methods (==) :: Display -> Display -> Bool Source # (/=) :: Display -> Display -> Bool Source #
GObject Display Source # |
Instance details Defined in GI.Gdk.Objects.Display
ManagedPtrNewtype Display Source # |
Instance details Defined in GI.Gdk.Objects.Display Methods toManagedPtr :: Display -> ManagedPtr Display Source #
TypedObject Display Source # |
Instance details Defined in GI.Gdk.Objects.Display Methods glibType :: IO GType Source #
HasParentTypes Display Source # |
Instance details Defined in GI.Gdk.Objects.Display
IsGValue (Maybe Display) Source # | Convert `Display` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gdk.Objects.Display Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Display -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Display) Source #
type ParentTypes Display Source # |
Instance details Defined in GI.Gdk.Objects.Display type ParentTypes Display = '[Object]

class (GObject o, IsDescendantOf Display o) => IsDisplay o Source #

Type class for types which can be safely cast to `Display`, for instance with `toDisplay`.

#### Instances

Instances details

(GObject o, IsDescendantOf Display o) => IsDisplay o Source # |
Instance details Defined in GI.Gdk.Objects.Display

toDisplay :: (MonadIO m, IsDisplay o) => o -> m Display Source #

Cast to `Display`, 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

Expand

#### Methods

beep, bindProperty, bindPropertyFull, close, deviceIsGrabbed, flush, forceFloating, freezeNotify, getv, hasPending, isClosed, isFloating, keyboardUngrab, listDevices, listSeats, notify, notifyByPspec, notifyStartupComplete, peekEvent, pointerIsGrabbed, pointerUngrab, putEvent, ref, refSink, requestSelectionNotification, runDispose, stealData, stealQdata, storeClipboard, supportsClipboardPersistence, supportsComposite, supportsCursorAlpha, supportsCursorColor, supportsInputShapes, supportsSelectionNotification, supportsShapes, sync, thawNotify, unref, warpPointer, watchClosure.

#### Getters

getAppLaunchContext, getData, getDefaultCursorSize, getDefaultGroup, getDefaultScreen, getDefaultSeat, getDeviceManager, getEvent, getMaximalCursorSize, getMonitor, getMonitorAtPoint, getMonitorAtWindow, getNMonitors, getNScreens, getName, getPointer, getPrimaryMonitor, getProperty, getQdata, getScreen, getWindowAtPointer.

#### Setters

setData, setDataFull, setDoubleClickDistance, setDoubleClickTime, setProperty.

## beep

displayBeep Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m () |

Emits a short beep on `display`

Since: 2.2

## close

displayClose Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m () |

Closes the connection to the windowing system for the given display, and cleans up associated resources.

Since: 2.2

## deviceIsGrabbed

displayDeviceIsGrabbed Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a, IsDevice b) |
=> a | `display`: a `Display`
-> b | `device`: a `Device`
-> m Bool | Returns: `True` if there is a grab in effect for `device`.

Returns `True` if there is an ongoing grab on `device` for `display`.

## flush

displayFlush Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m () |

Flushes any requests queued for the windowing system; this happens automatically when the main loop blocks waiting for new events, but if your application is drawing without returning control to the main loop, you may need to call this function explicitly. A common case where this function needs to be called is when an application is executing drawing commands from a thread other than the thread where the main loop is running.

This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.

Since: 2.4

## getAppLaunchContext

displayGetAppLaunchContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m AppLaunchContext | Returns: a new `AppLaunchContext` for `display`. Free with `objectUnref` when done

Returns a `AppLaunchContext` suitable for launching applications on the given display.

Since: 3.0

## getDefault

displayGetDefault Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m (Maybe Display) | Returns: a `Display`, or `Nothing` if there is no default display.

Gets the default `Display`. This is a convenience function for: `gdk_display_manager_get_default_display (gdk_display_manager_get ())`.

Since: 2.2

## getDefaultCursorSize

displayGetDefaultCursorSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Word32 | Returns: the default cursor size.

Returns the default size to use for cursors on `display`.

Since: 2.4

## getDefaultGroup

displayGetDefaultGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Window | Returns: The default group leader window for `display`

Returns the default group leader window for all toplevel windows on `display`. This window is implicitly created by GDK. See `windowSetGroup`.

Since: 2.4

## getDefaultScreen

displayGetDefaultScreen Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Screen | Returns: the default `Screen` object for `display`

Get the default `Screen` for `display`.

Since: 2.2

## getDefaultSeat

displayGetDefaultSeat Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Seat | Returns: the default seat.

Returns the default `Seat` for this display.

Since: 3.20

## getDeviceManager

displayGetDeviceManager Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`.
-> m (Maybe DeviceManager) | Returns: A `DeviceManager`, or `Nothing`. This memory is owned by GDK and must not be freed or unreferenced.

Deprecated: (Since version 3.20.)Use `displayGetDefaultSeat` and `Seat` operations.

Returns the `DeviceManager` associated to `display`.

Since: 3.0

## getEvent

displayGetEvent Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m (Maybe Event) | Returns: the next `Event` to be processed, or `Nothing` if no events are pending. The returned `Event` should be freed with `eventFree`.

Gets the next `Event` to be processed for `display`, fetching events from the windowing system if necessary.

Since: 2.2

## getMaximalCursorSize

displayGetMaximalCursorSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m (Word32, Word32) |

Gets the maximal size to use for cursors on `display`.

Since: 2.4

## getMonitor

displayGetMonitor Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> Int32 | `monitorNum`: number of the monitor
-> m (Maybe Monitor) | Returns: the `Monitor`, or `Nothing` if `monitorNum` is not a valid monitor number

Gets a monitor associated with this display.

Since: 3.22

## getMonitorAtPoint

displayGetMonitorAtPoint Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> Int32 | `x`: the x coordinate of the point
-> Int32 | `y`: the y coordinate of the point
-> m Monitor | Returns: the monitor containing the point

Gets the monitor in which the point (`x`, `y`) is located, or a nearby monitor if the point is not in any monitor.

Since: 3.22

## getMonitorAtWindow

displayGetMonitorAtWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a, IsWindow b) |
=> a | `display`: a `Display`
-> b | `window`: a `Window`
-> m Monitor | Returns: the monitor with the largest overlap with `window`

Gets the monitor in which the largest area of `window` resides, or a monitor close to `window` if it is outside of all monitors.

Since: 3.22

## getNMonitors

displayGetNMonitors Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Int32 | Returns: the number of monitors

Gets the number of monitors that belong to `display`.

The returned number is valid until the next emission of the Display::monitorAdded or Display::monitorRemoved signal.

Since: 3.22

## getNScreens

displayGetNScreens Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Int32 | Returns: number of screens.

Deprecated: (Since version 3.10)The number of screens is always 1.

Gets the number of screen managed by the `display`.

Since: 2.2

## getName

displayGetName Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Text | Returns: a string representing the display name. This string is owned by GDK and should not be modified or freed.

Gets the name of the display.

Since: 2.2

## getPointer

displayGetPointer Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m (Screen, Int32, Int32, [ModifierType]) |

Deprecated: (Since version 3.0)Use `deviceGetPosition` instead.

Gets the current location of the pointer and the current modifier mask for a given display.

Since: 2.2

## getPrimaryMonitor

displayGetPrimaryMonitor Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m (Maybe Monitor) | Returns: the primary monitor, or `Nothing` if no primary monitor is configured by the user

Gets the primary monitor for the display.

The primary monitor is considered the monitor where the “main desktop” lives. While normal application windows typically allow the window manager to place the windows, specialized desktop applications such as panels should place themselves on the primary monitor.

Since: 3.22

## getScreen

displayGetScreen Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> Int32 | `screenNum`: the screen number
-> m Screen | Returns: the `Screen` object

Deprecated: (Since version 3.20)There is only one screen; use `displayGetDefaultScreen` to get it.

Returns a screen object for one of the screens of the display.

Since: 2.2

## getWindowAtPointer

displayGetWindowAtPointer Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m (Maybe Window, Int32, Int32) | Returns: the window under the mouse pointer, or `Nothing`

Deprecated: (Since version 3.0)Use `deviceGetWindowAtPosition` instead.

Obtains the window underneath the mouse pointer, returning the location of the pointer in that window in `winX`, `winY` for `screen`. Returns `Nothing` if the window under the mouse pointer is not known to GDK (for example, belongs to another application).

Since: 2.2

## hasPending

displayHasPending Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Bool | Returns: `True` if there are events ready to be processed.

Returns whether the display has events that are waiting to be processed.

Since: 3.0

## isClosed

displayIsClosed Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Bool | Returns: `True` if the display is closed.

Finds out if the display has been closed.

Since: 2.22

## keyboardUngrab

displayKeyboardUngrab Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`.
-> Word32 | `time_`: a timestap (e.g `CURRENT_TIME`).
-> m () |

Deprecated: (Since version 3.0)Use `deviceUngrab`, together with `deviceGrab` instead.

Release any keyboard grab

Since: 2.2

## listDevices

displayListDevices Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m [Device] | Returns: a list of `Device`

Deprecated: (Since version 3.0)Use `deviceManagerListDevices` instead.

Returns the list of available input devices attached to `display`. The list is statically allocated and should not be freed.

Since: 2.2

## listSeats

displayListSeats Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m [Seat] | Returns: the list of seats known to the `Display`

Returns the list of seats known to `display`.

Since: 3.20

## notifyStartupComplete

displayNotifyStartupComplete Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> Text | `startupId`: a startup-notification identifier, for which notification process should be completed
-> m () |

Indicates to the GUI environment that the application has finished loading, using a given identifier.

GTK+ will call this function automatically for `GtkWindow` with custom startup-notification identifier unless `gtk_window_set_auto_startup_notification()` is called to disable that feature.

Since: 3.0

## open

displayOpen Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `displayName`: the name of the display to open
-> m (Maybe Display) | Returns: a `Display`, or `Nothing` if the display could not be opened

Opens a display.

Since: 2.2

## openDefaultLibgtkOnly

displayOpenDefaultLibgtkOnly Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m (Maybe Display) | Returns: the default display, if it could be opened, otherwise `Nothing`.

Deprecated: (Since version 3.16)This symbol was never meant to be used outside of GTK+

Opens the default display specified by command line arguments or environment variables, sets it as the default display, and returns it. `parseArgs` must have been called first. If the default display has previously been set, simply returns that. An internal function that should not be used by applications.

## peekEvent

displayPeekEvent Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m (Maybe Event) | Returns: a copy of the first `Event` on the event queue, or `Nothing` if no events are in the queue. The returned `Event` should be freed with `eventFree`.

Gets a copy of the first `Event` in the `display`’s event queue, without removing the event from the queue. (Note that this function will not get more events from the windowing system. It only checks the events that have already been moved to the GDK event queue.)

Since: 2.2

## pointerIsGrabbed

displayPointerIsGrabbed Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Bool | Returns: `True` if an active X pointer grab is in effect

Deprecated: (Since version 3.0)Use `displayDeviceIsGrabbed` instead.

Test if the pointer is grabbed.

Since: 2.2

## pointerUngrab

displayPointerUngrab Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`.
-> Word32 | `time_`: a timestap (e.g. `CURRENT_TIME`).
-> m () |

Deprecated: (Since version 3.0)Use `deviceUngrab`, together with `deviceGrab` instead.

Release any pointer grab.

Since: 2.2

## putEvent

displayPutEvent Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> Event | `event`: a `Event`.
-> m () |

Appends a copy of the given event onto the front of the event queue for `display`.

Since: 2.2

## requestSelectionNotification

displayRequestSelectionNotification Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> Atom | `selection`: the `Atom` naming the selection for which ownership change notification is requested
-> m Bool | Returns: whether `EventOwnerChange` events will be sent.

Request `EventOwnerChange` events for ownership changes of the selection named by the given atom.

Since: 2.6

## setDoubleClickDistance

displaySetDoubleClickDistance Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> Word32 | `distance`: distance in pixels
-> m () |

Sets the double click distance (two clicks within this distance count as a double click and result in a `GDK_2BUTTON_PRESS` event). See also `displaySetDoubleClickTime`. Applications should not set this, it is a global user-configured setting.

Since: 2.4

## setDoubleClickTime

displaySetDoubleClickTime Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> Word32 | `msec`: double click time in milliseconds (thousandths of a second)
-> m () |

Sets the double click time (two clicks within this time interval count as a double click and result in a `GDK_2BUTTON_PRESS` event). Applications should not set this, it is a global user-configured setting.

Since: 2.2

## storeClipboard

displayStoreClipboard Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a, IsWindow b) |
=> a | `display`: a `Display`
-> b | `clipboardWindow`: a `Window` belonging to the clipboard owner
-> Word32 | `time_`: a timestamp
-> Maybe [Atom] | `targets`: an array of targets that should be saved, or `Nothing` if all available targets should be saved.
-> m () |

Issues a request to the clipboard manager to store the clipboard data. On X11, this is a special program that works according to the FreeDesktop Clipboard Specification.

Since: 2.6

## supportsClipboardPersistence

displaySupportsClipboardPersistence Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Bool | Returns: `True` if the display supports clipboard persistance.

Returns whether the speicifed display supports clipboard persistance; i.e. if it’s possible to store the clipboard data after an application has quit. On X11 this checks if a clipboard daemon is running.

Since: 2.6

## supportsComposite

displaySupportsComposite Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Bool | Returns: `True` if windows may be composited.

Deprecated: (Since version 3.16)Compositing is an outdated technology that only ever worked on X11.

Returns `True` if `windowSetComposited` can be used to redirect drawing on the window using compositing.

Currently this only works on X11 with XComposite and XDamage extensions available.

Since: 2.12

## supportsCursorAlpha

displaySupportsCursorAlpha Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Bool | Returns: whether cursors can have alpha channels.

Returns `True` if cursors can use an 8bit alpha channel on `display`. Otherwise, cursors are restricted to bilevel alpha (i.e. a mask).

Since: 2.4

## supportsCursorColor

displaySupportsCursorColor Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Bool | Returns: whether cursors can have multiple colors.

Returns `True` if multicolored cursors are supported on `display`. Otherwise, cursors have only a forground and a background color.

Since: 2.4

## supportsInputShapes

displaySupportsInputShapes Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Bool | Returns: `True` if windows with modified input shape are supported

Returns `True` if `gdk_window_input_shape_combine_mask()` can be used to modify the input shape of windows on `display`.

Since: 2.10

## supportsSelectionNotification

displaySupportsSelectionNotification Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Bool | Returns: whether `EventOwnerChange` events will be sent.

Returns whether `EventOwnerChange` events will be sent when the owner of a selection changes.

Since: 2.6

## supportsShapes

displaySupportsShapes Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m Bool | Returns: `True` if shaped windows are supported

Returns `True` if `gdk_window_shape_combine_mask()` can be used to create shaped windows on `display`.

Since: 2.10

## sync

displaySync Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) |
=> a | `display`: a `Display`
-> m () |

Flushes any requests queued for the windowing system and waits until all requests have been handled. This is often used for making sure that the display is synchronized with the current state of the program. Calling `displaySync` before `errorTrapPop` makes sure that any errors generated from earlier requests are handled before the error trap is removed.

This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.

Since: 2.2

## warpPointer

displayWarpPointer Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a, IsScreen b) |
=> a | `display`: a `Display`
-> b | `screen`: the screen of `display` to warp the pointer to
-> Int32 | `x`: the x coordinate of the destination
-> Int32 | `y`: the y coordinate of the destination
-> m () |

Deprecated: (Since version 3.0)Use `deviceWarp` instead.

Warps the pointer of `display` to the point `x`,`y` on the screen `screen`, unless the pointer is confined to a window by a grab, in which case it will be moved as far as allowed by the grab. Warping the pointer creates events as if the user had moved the mouse instantaneously to the destination.

Note that the pointer should normally be under the control of the user. This function was added to cover some rare use cases like keyboard navigation support for the color picker in the `GtkColorSelectionDialog`.

Since: 2.8

# Signals

## closed

type DisplayClosedCallback Source #

Arguments

= Bool | `isError`: `True` if the display was closed due to an error
-> IO () |

The closed signal is emitted when the connection to the windowing system for `display` is closed.

Since: 2.2

afterDisplayClosed :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayClosedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the closed signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after display #closed callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onDisplayClosed :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayClosedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the closed signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on display #closed callback

## monitorAdded

type DisplayMonitorAddedCallback Source #

Arguments

= Monitor | `monitor`: the monitor that was just added
-> IO () |

The monitorAdded signal is emitted whenever a monitor is added.

Since: 3.22

afterDisplayMonitorAdded :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayMonitorAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the monitorAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after display #monitorAdded callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onDisplayMonitorAdded :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayMonitorAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the monitorAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on display #monitorAdded callback

## monitorRemoved

type DisplayMonitorRemovedCallback Source #

Arguments

= Monitor | `monitor`: the monitor that was just removed
-> IO () |

The monitorRemoved signal is emitted whenever a monitor is removed.

Since: 3.22

afterDisplayMonitorRemoved :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayMonitorRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the monitorRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after display #monitorRemoved callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onDisplayMonitorRemoved :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayMonitorRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the monitorRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on display #monitorRemoved callback

## opened

type DisplayOpenedCallback = IO () Source #

The opened signal is emitted when the connection to the windowing system for `display` is opened.

afterDisplayOpened :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayOpenedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the opened signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after display #opened callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onDisplayOpened :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplayOpenedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the opened signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on display #opened callback

## seatAdded

type DisplaySeatAddedCallback Source #

Arguments

= Seat | `seat`: the seat that was just added
-> IO () |

The seatAdded signal is emitted whenever a new seat is made known to the windowing system.

Since: 3.20

afterDisplaySeatAdded :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplaySeatAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the seatAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after display #seatAdded callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onDisplaySeatAdded :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplaySeatAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the seatAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on display #seatAdded callback

## seatRemoved

type DisplaySeatRemovedCallback Source #

Arguments

= Seat | `seat`: the seat that was just removed
-> IO () |

The seatRemoved signal is emitted whenever a seat is removed by the windowing system.

Since: 3.20

afterDisplaySeatRemoved :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplaySeatRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the seatRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after display #seatRemoved callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onDisplaySeatRemoved :: (IsDisplay a, MonadIO m) => a -> ((?self :: a) => DisplaySeatRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the seatRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on display #seatRemoved callback