Gdk::Display Class Reference

Gdk::Display object's purpose is two fold: To grab/ungrab keyboard focus and mouse pointer To manage and provide information about the Gdk::Screen(s) available for this Gdk::Display. More...

`#include <gdkmm/display.h>`

Inherits Object.

## Public Member Functions

| Display (Display&& src) noexcept
Display& | operator= (Display&& src) noexcept
| ~Display () noexcept override
GdkDisplay* | gobj ()
| Provides access to the underlying C GObject. More...
const GdkDisplay* | gobj () const
| Provides access to the underlying C GObject. More...
GdkDisplay* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
Glib::ustring | get_name () const
| Gets the name of the display. More...
int | get_n_screens () const
| Gets the number of screen managed by the display. More...
Glib::RefPtr< Screen > | get_screen (int screen_num=0)
| Returns a screen object for one of the screens of the display. More...
Glib::RefPtr< const Screen > | get_screen (int screen_num=0) const
| Returns a screen object for one of the screens of the display. More...
Glib::RefPtr< Screen > | get_default_screen ()
| Get the default Gdk::Screen for display. More...
Glib::RefPtr< const Screen > | get_default_screen () const
| Get the default Gdk::Screen for display. More...
bool | device_is_grabbed (const Glib::RefPtr< const Gdk::Device >& device) const
| Returns `true` if there is an ongoing grab on device for display. More...
void | beep ()
| Emits a short beep on display. More...
void | sync ()
| Flushes any requests queued for the windowing system and waits until all requests have been handled. More...
void | close ()
| Closes the connection to the windowing system for the given display, and cleans up associated resources. More...
bool | is_closed () const
| Finds out if the display has been closed. More...
GdkEvent* | get_event ()
| Gets the next Gdk::Event to be processed for display, fetching events from the windowing system if necessary. More...
const GdkEvent* | get_event () const
| Gets the next Gdk::Event to be processed for display, fetching events from the windowing system if necessary. More...
GdkEvent* | peek_event ()
| Gets a copy of the first Gdk::Event in the display’s event queue, without removing the event from the queue. More...
GdkEvent* | peek_event () const
| Gets a copy of the first Gdk::Event in the display’s event queue, without removing the event from the queue. More...
void | put_event (GdkEvent* event)
| Appends a copy of the given event onto the front of the event queue for display. More...
bool | has_pending () const
| Returns whether the display has events that are waiting to be processed. More...
void | set_double_click_time (guint msec)
| Sets the double click time (two clicks within this time interval count as a double click and result in a Gdk::2BUTTON_PRESS event). More...
void | set_double_click_distance (guint distance)
| Sets the double click distance (two clicks within this distance count as a double click and result in a Gdk::2BUTTON_PRESS event). More...
GdkKeymap* | get_keymap ()
| Returns the Gdk::Keymap attached to display. More...
const GdkKeymap* | get_keymap () const
| Returns the Gdk::Keymap attached to display. More...
bool | set_selection_owner (const Glib::RefPtr< Window >& owner, Glib::ustring& selection, guint32 time_, bool send_event)
Glib::RefPtr< Window > | get_selection_owner (const Glib::ustring& selection)
void | selection_send_notify (const Glib::RefPtr< Window >& requestor, Glib::ustring& selection, Glib::ustring& target, Glib::ustring& property, guint32 time_)
| Send a response to SelectionRequest event. More...
void | flush ()
| 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. More...
bool | supports_cursor_alpha () const
| Returns `true` if cursors can use an 8bit alpha channel on display. More...
bool | supports_cursor_color () const
| Returns `true` if multicolored cursors are supported on display. More...
guint | get_default_cursor_size () const
| Returns the default size to use for cursors on display. More...
void | get_maximal_cursor_size (guint& width, guint& height)
| Gets the maximal size to use for cursors on display. More...
Glib::RefPtr< Window > | get_default_group ()
| Returns the default group leader window for all toplevel windows on display. More...
Glib::RefPtr< const Window > | get_default_group () const
| Returns the default group leader window for all toplevel windows on display. More...
bool | supports_selection_notification () const
| Returns whether Gdk::EventOwnerChange events will be sent when the owner of a selection changes. More...
bool | request_selection_notification (const Glib::ustring& selection)
| Request Gdk::EventOwnerChange events for ownership changes of the selection named by the given atom. More...
bool | supports_clipboard_persistence () const
| Returns whether the speicifed display supports clipboard persistance; i.e. if it’s possible to store the clipboard data after an application has quit. More...
void | store_clipboard (const Glib::RefPtr< Gdk::Window >& clipboard_window, guint32 time_)
| Issues a request to the clipboard manager to store the clipboard data, saving all available targets. More...
void | store_clipboard (const Glib::RefPtr< Gdk::Window >& clipboard_window, guint32 time_, const std::vector< Glib::ustring >& targets)
bool | supports_shapes () const
| Returns `true` if gdk_window_shape_combine_mask() can be used to create shaped windows on display. More...
bool | supports_input_shapes () const
| Returns `true` if gdk_window_input_shape_combine_mask() can be used to modify the input shape of windows on display. More...
bool | supports_composite () const
| Returns `true` if Gdk::Window::set_composited() can be used to redirect drawing on the window using compositing. More...
void | notify_startup_complete (const Glib::ustring& startup_id)
| Indicates to the GUI environment that the application has finished loading, using a given identifier. More...
Glib::RefPtr< DeviceManager > | get_device_manager ()
| Returns the Gdk::DeviceManager associated to display. More...
Glib::RefPtr< const DeviceManager > | get_device_manager () const
| Returns the Gdk::DeviceManager associated to display. More...
Glib::RefPtr< AppLaunchContext > | get_app_launch_context ()
| Returns a Gdk::AppLaunchContext suitable for launching applications on the given display. More...
Glib::RefPtr< const AppLaunchContext > | get_app_launch_context () const
| Returns a Gdk::AppLaunchContext suitable for launching applications on the given display. More...
Glib::RefPtr< Seat > | get_default_seat ()
| Returns the default Gdk::Seat for this display. More...
Glib::RefPtr< const Seat > | get_default_seat () const
| Returns the default Gdk::Seat for this display. More...
std::vector< Glib::RefPtr< Seat > > | list_seats ()
| Returns the list of seats known to display. More...
std::vector< Glib::RefPtr< const Seat > > | list_seats () const
| Returns the list of seats known to display. More...
int | get_n_monitors () const
| Gets the number of monitors that belong to display. More...
Glib::RefPtr< Monitor > | get_monitor (int monitor_num)
| Gets a monitor associated with this display. More...
Glib::RefPtr< const Monitor > | get_monitor (int monitor_num) const
| Gets a monitor associated with this display. More...
Glib::RefPtr< Monitor > | get_primary_monitor ()
| Gets the primary monitor for the display. More...
Glib::RefPtr< const Monitor > | get_primary_monitor () const
| Gets the primary monitor for the display. More...
Glib::RefPtr< Monitor > | get_monitor_at_point (int x, int y)
| Gets the monitor in which the point ( x, y) is located, or a nearby monitor if the point is not in any monitor. More...
Glib::RefPtr< const Monitor > | get_monitor_at_point (int x, int y) const
| Gets the monitor in which the point ( x, y) is located, or a nearby monitor if the point is not in any monitor. More...
Glib::RefPtr< Monitor > | get_monitor_at_window (const Glib::RefPtr< Window >& 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. More...
Glib::RefPtr< const Monitor > | get_monitor_at_window (const Glib::RefPtr< Window >& window) const
| Gets the monitor in which the largest area of window resides, or a monitor close to window if it is outside of all monitors. More...
Glib::SignalProxy< void, bool > | signal_closed ()
Glib::SignalProxy< void > | signal_opened ()
Glib::SignalProxy< void, const Glib::RefPtr< Seat >& > | signal_seat_added ()
Glib::SignalProxy< void, const Glib::RefPtr< Seat >& > | signal_seat_removed ()
Glib::SignalProxy< void, const Glib::RefPtr< Monitor >& > | signal_monitor_added ()
Glib::SignalProxy< void, const Glib::RefPtr< Monitor >& > | signal_monitor_removed ()

## Static Public Member Functions

static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static Glib::RefPtr< Display > | open (const Glib::ustring& display_name)
| Opens a display. More...
static Glib::RefPtr< Display > | get_default ()
| Gets the default Gdk::Display. More...
static Glib::RefPtr< Display > | open_default_libgtk_only ()
| Opens the default display specified by command line arguments or environment variables, sets it as the default display, and returns it. More...

## Protected Member Functions

| Display ()

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gdk::Display > | wrap (GdkDisplay* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

Gdk::Display object's purpose is two fold: To grab/ungrab keyboard focus and mouse pointer To manage and provide information about the Gdk::Screen(s) available for this Gdk::Display.

Gdk::Display objects are the GDK representation of the 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 Gdk::Screen objects currently instantiated by the application. It is also used to grab and release the keyboard and the mouse pointer.

## Constructor & Destructor Documentation

## Display() [1/2]

Gdk::Display::Display | ( | Display&& | src | ) |

noexcept

## ~Display()

Gdk::Display::~Display | ( |  | ) |

override noexcept

## Display() [2/2]

Gdk::Display::Display | ( |  | ) |

protected

## Member Function Documentation

## beep()

void Gdk::Display::beep | ( |  | ) |

Emits a short beep on display.

Since gtkmm 2.2:

## close()

void Gdk::Display::close | ( |  | ) |

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

Since gtkmm 2.2:

## device_is_grabbed()

bool Gdk::Display::device_is_grabbed | ( | const Glib::RefPtr< const Gdk::Device >& | device | ) | const

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

Parameters

  device | A Gdk::Device.

Returns
  `true` if there is a grab in effect for device.

## flush()

void Gdk::Display::flush | ( |  | ) |

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 gtkmm 2.4:

## get_app_launch_context() [1/2]

Glib::RefPtr<AppLaunchContext> Gdk::Display::get_app_launch_context | ( |  | ) |

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

Since gtkmm 3.0:

Returns
  A new Gdk::AppLaunchContext for display. Free with Glib::object_unref() when done.

## get_app_launch_context() [2/2]

Glib::RefPtr<const AppLaunchContext> Gdk::Display::get_app_launch_context | ( |  | ) | const

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

Since gtkmm 3.0:

Returns
  A new Gdk::AppLaunchContext for display. Free with Glib::object_unref() when done.

## get_default()

static Glib::RefPtr<Display> Gdk::Display::get_default | ( |  | ) |

static

Gets the default Gdk::Display.

This is a convenience function for: `gdk_display_manager_get_default_display (Gdk::DisplayManager::get())`.

Since gtkmm 2.2:

Returns
  A Gdk::Display, or `nullptr` if there is no default display.

## get_default_cursor_size()

guint Gdk::Display::get_default_cursor_size | ( |  | ) | const

Returns the default size to use for cursors on display.

Since gtkmm 2.4:

Returns
  The default cursor size.

## get_default_group() [1/2]

Glib::RefPtr<Window> Gdk::Display::get_default_group | ( |  | ) |

Returns the default group leader window for all toplevel windows on display.

This window is implicitly created by GDK. See Gdk::Window::set_group().

Since gtkmm 2.4:

Returns
  The default group leader window for display.

## get_default_group() [2/2]

Glib::RefPtr<const Window> Gdk::Display::get_default_group | ( |  | ) | const

Returns the default group leader window for all toplevel windows on display.

This window is implicitly created by GDK. See Gdk::Window::set_group().

Since gtkmm 2.4:

Returns
  The default group leader window for display.

## get_default_screen() [1/2]

Glib::RefPtr<Screen> Gdk::Display::get_default_screen | ( |  | ) |

Get the default Gdk::Screen for display.

Since gtkmm 2.2:

Returns
  The default Gdk::Screen object for display.

## get_default_screen() [2/2]

Glib::RefPtr<const Screen> Gdk::Display::get_default_screen | ( |  | ) | const

Get the default Gdk::Screen for display.

Since gtkmm 2.2:

Returns
  The default Gdk::Screen object for display.

## get_default_seat() [1/2]

Glib::RefPtr<Seat> Gdk::Display::get_default_seat | ( |  | ) |

Returns the default Gdk::Seat for this display.

Since gtkmm 3.20:

Returns
  The default seat.

## get_default_seat() [2/2]

Glib::RefPtr<const Seat> Gdk::Display::get_default_seat | ( |  | ) | const

Returns the default Gdk::Seat for this display.

Since gtkmm 3.20:

Returns
  The default seat.

## get_device_manager() [1/2]

Glib::RefPtr<DeviceManager> Gdk::Display::get_device_manager | ( |  | ) |

Returns the Gdk::DeviceManager associated to display.

Since gtkmm 3.0:

Deprecated: 3.20. Use get_default_seat() and Gdk::Seat operations.

Deprecated:
  Use get_default_seat() and Gdk::Seat operations.

Returns
  A Gdk::DeviceManager, or `nullptr`. This memory is owned by GDK and must not be freed or unreferenced.

## get_device_manager() [2/2]

Glib::RefPtr<const DeviceManager> Gdk::Display::get_device_manager | ( |  | ) | const

Returns the Gdk::DeviceManager associated to display.

Since gtkmm 3.0:

Deprecated: 3.20. Use get_default_seat() and Gdk::Seat operations.

Deprecated:
  Use get_default_seat() and Gdk::Seat operations.

Returns
  A Gdk::DeviceManager, or `nullptr`. This memory is owned by GDK and must not be freed or unreferenced.

## get_event() [1/2]

GdkEvent* Gdk::Display::get_event | ( |  | ) |

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

Since gtkmm 2.2:

Returns
  The next Gdk::Event to be processed, or `nullptr` if no events are pending. The returned Gdk::Event should be freed with Gdk::Event::free().

## get_event() [2/2]

const GdkEvent* Gdk::Display::get_event | ( |  | ) | const

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

Since gtkmm 2.2:

Returns
  The next Gdk::Event to be processed, or `nullptr` if no events are pending. The returned Gdk::Event should be freed with Gdk::Event::free().

## get_keymap() [1/2]

GdkKeymap* Gdk::Display::get_keymap | ( |  | ) |

Returns the Gdk::Keymap attached to display.

Since gtkmm 2.2:

Returns
  The Gdk::Keymap attached to display.

## get_keymap() [2/2]

const GdkKeymap* Gdk::Display::get_keymap | ( |  | ) | const

Returns the Gdk::Keymap attached to display.

Since gtkmm 2.2:

Returns
  The Gdk::Keymap attached to display.

## get_maximal_cursor_size()

void Gdk::Display::get_maximal_cursor_size | ( | guint & | width,
|  | guint & | height
| ) |  |

Gets the maximal size to use for cursors on display.

Since gtkmm 2.4:

Parameters

  width | The return location for the maximal cursor width.
  height | The return location for the maximal cursor height.

## get_monitor() [1/2]

Glib::RefPtr<Monitor> Gdk::Display::get_monitor | ( | int | monitor_num | ) |

Gets a monitor associated with this display.

Since gtkmm 3.22:

Parameters

  monitor_num | Number of the monitor.

Returns
  The Gdk::Monitor, or `nullptr` if monitor_num is not a valid monitor number.

## get_monitor() [2/2]

Glib::RefPtr<const Monitor> Gdk::Display::get_monitor | ( | int | monitor_num | ) | const

Gets a monitor associated with this display.

Since gtkmm 3.22:

Parameters

  monitor_num | Number of the monitor.

Returns
  The Gdk::Monitor, or `nullptr` if monitor_num is not a valid monitor number.

## get_monitor_at_point() [1/2]

Glib::RefPtr<Monitor> Gdk::Display::get_monitor_at_point | ( | int | x,
|  | int | y
| ) |  |

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

Since gtkmm 3.22:

Parameters

  x | The x coordinate of the point.
  y | The y coordinate of the point.

Returns
  The monitor containing the point.

## get_monitor_at_point() [2/2]

Glib::RefPtr<const Monitor> Gdk::Display::get_monitor_at_point | ( | int | x,
|  | int | y
| ) |  | const

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

Since gtkmm 3.22:

Parameters

  x | The x coordinate of the point.
  y | The y coordinate of the point.

Returns
  The monitor containing the point.

## get_monitor_at_window() [1/2]

Glib::RefPtr<Monitor> Gdk::Display::get_monitor_at_window | ( | const Glib::RefPtr< Window >& | 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 gtkmm 3.22:

Parameters

  window | A Gdk::Window.

Returns
  The monitor with the largest overlap with window.

## get_monitor_at_window() [2/2]

Glib::RefPtr<const Monitor> Gdk::Display::get_monitor_at_window | ( | const Glib::RefPtr< Window >& | window | ) | const

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 gtkmm 3.22:

Parameters

  window | A Gdk::Window.

Returns
  The monitor with the largest overlap with window.

## get_n_monitors()

int Gdk::Display::get_n_monitors | ( |  | ) | const

Gets the number of monitors that belong to display.

The returned number is valid until the next emission of the Gdk::Display::signal_monitor_added() or Gdk::Display::signal_monitor_removed() signal.

Since gtkmm 3.22:

Returns
  The number of monitors.

## get_n_screens()

int Gdk::Display::get_n_screens | ( |  | ) | const

Gets the number of screen managed by the display.

Since gtkmm 2.2:

Deprecated: 3.10: The number of screens is always 1.

Deprecated:
  The number of screens is always 1.

Returns
  Number of screens.

## get_name()

Glib::ustring Gdk::Display::get_name | ( |  | ) | const

Gets the name of the display.

Since gtkmm 2.2:

Returns
  A string representing the display name. This string is owned by GDK and should not be modified or freed.

## get_primary_monitor() [1/2]

Glib::RefPtr<Monitor> Gdk::Display::get_primary_monitor | ( |  | ) |

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 gtkmm 3.22:

Returns
  The primary monitor, or `nullptr` if no primary monitor is configured by the user.

## get_primary_monitor() [2/2]

Glib::RefPtr<const Monitor> Gdk::Display::get_primary_monitor | ( |  | ) | const

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 gtkmm 3.22:

Returns
  The primary monitor, or `nullptr` if no primary monitor is configured by the user.

## get_screen() [1/2]

Glib::RefPtr<Screen> Gdk::Display::get_screen | ( | int | screen_num = `0` | ) |

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

Since gtkmm 2.2:
  Deprecated: 3.20: There is only one screen; use get_default_screen() to get it.

Deprecated:
  There is only one screen; use get_default_screen() to get it.

Parameters

  screen_num | The screen number.

Returns
  The Gdk::Screen object.

## get_screen() [2/2]

Glib::RefPtr<const Screen> Gdk::Display::get_screen | ( | int | screen_num = `0` | ) | const

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

Since gtkmm 2.2:
  Deprecated: 3.20: There is only one screen; use get_default_screen() to get it.

Deprecated:
  There is only one screen; use get_default_screen() to get it.

Parameters

  screen_num | The screen number.

Returns
  The Gdk::Screen object.

## get_selection_owner()

Glib::RefPtr<Window> Gdk::Display::get_selection_owner | ( | const Glib::ustring & | selection | ) |

## get_type()

static GType Gdk::Display::get_type | ( |  | ) |

static

Get the GType for this class, for use with the underlying GObject type system.

## gobj() [1/2]

GdkDisplay* Gdk::Display::gobj | ( |  | ) |

inline

Provides access to the underlying C GObject.

## gobj() [2/2]

const GdkDisplay* Gdk::Display::gobj | ( |  | ) | const

inline

Provides access to the underlying C GObject.

## gobj_copy()

GdkDisplay* Gdk::Display::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

## has_pending()

bool Gdk::Display::has_pending | ( |  | ) | const

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

Since gtkmm 3.0:

Returns
  `true` if there are events ready to be processed.

## is_closed()

bool Gdk::Display::is_closed | ( |  | ) | const

Finds out if the display has been closed.

Since gtkmm 2.22:

Returns
  `true` if the display is closed.

## list_seats() [1/2]

std::vector<Glib::RefPtr<Seat> > Gdk::Display::list_seats | ( |  | ) |

Returns the list of seats known to display.

Since gtkmm 3.20:

Returns
  The list of seats known to the Gdk::Display.

## list_seats() [2/2]

std::vector<Glib::RefPtr<const Seat> > Gdk::Display::list_seats | ( |  | ) | const

Returns the list of seats known to display.

Since gtkmm 3.20:

Returns
  The list of seats known to the Gdk::Display.

## notify_startup_complete()

void Gdk::Display::notify_startup_complete | ( | const Glib::ustring & | startup_id | ) |

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

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

Since gtkmm 3.0:

Parameters

  startup_id | A startup-notification identifier, for which notification process should be completed.

## open()

static Glib::RefPtr<Display> Gdk::Display::open | ( | const Glib::ustring & | display_name | ) |

static

Opens a display.

Since gtkmm 2.2:

Parameters

  display_name | The name of the display to open.

Returns
  A Gdk::Display, or `nullptr` if the display could not be opened.

## open_default_libgtk_only()

static Glib::RefPtr<Display> Gdk::Display::open_default_libgtk_only | ( |  | ) |

static

Opens the default display specified by command line arguments or environment variables, sets it as the default display, and returns it.

gdk_parse_args() 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.

Deprecated: 3.16: This symbol was never meant to be used outside of GTK+

Deprecated:
  This method was never meant to be used outside of GTK+.

Returns
  The default display, if it could be opened, otherwise `nullptr`.

## operator=()

Display& Gdk::Display::operator= | ( | Display&& | src | ) |

noexcept

## peek_event() [1/2]

GdkEvent* Gdk::Display::peek_event | ( |  | ) |

Gets a copy of the first Gdk::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 gtkmm 2.2:

Returns
  A copy of the first Gdk::Event on the event queue, or `nullptr` if no events are in the queue. The returned Gdk::Event should be freed with Gdk::Event::free().

## peek_event() [2/2]

GdkEvent* Gdk::Display::peek_event | ( |  | ) | const

Gets a copy of the first Gdk::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 gtkmm 2.2:

Returns
  A copy of the first Gdk::Event on the event queue, or `nullptr` if no events are in the queue. The returned Gdk::Event should be freed with Gdk::Event::free().

## put_event()

void Gdk::Display::put_event | ( | GdkEvent * | event | ) |

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

Since gtkmm 2.2:

Parameters

  event | A Gdk::Event.

## request_selection_notification()

bool Gdk::Display::request_selection_notification | ( | const Glib::ustring & | selection | ) |

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

Since gtkmm 2.6:

Parameters

  selection | The Gdk::Atom naming the selection for which ownership change notification is requested.

Returns
  Whether Gdk::EventOwnerChange events will be sent.

## selection_send_notify()

void Gdk::Display::selection_send_notify | ( | const Glib::RefPtr< Window >& | requestor,
|  | Glib::ustring & | selection,
|  | Glib::ustring & | target,
|  | Glib::ustring & | property,
|  | guint32 | time_
| ) |  |

Send a response to SelectionRequest event.

Since gtkmm 2.2:

Parameters

  requestor | Window to which to deliver response.
  selection | Selection that was requested.
  target | Target that was selected.
  property | Property in which the selection owner stored the data, or "None" to indicate that the request was rejected.
  time_ | Timestamp.

## set_double_click_distance()

void Gdk::Display::set_double_click_distance | ( | guint | distance | ) |

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 set_double_click_time(). Applications should not set this, it is a global user-configured setting.

Since gtkmm 2.4:

Deprecated:
  No replacement method. Applications should not set this.

Parameters

  distance | Distance in pixels.

## set_double_click_time()

void Gdk::Display::set_double_click_time | ( | guint | msec | ) |

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 gtkmm 2.2:

Deprecated:
  No replacement method. Applications should not set this.

Parameters

  msec | Double click time in milliseconds (thousandths of a second).

## set_selection_owner()

bool Gdk::Display::set_selection_owner | ( | const Glib::RefPtr< Window >& | owner,
|  | Glib::ustring & | selection,
|  | guint32 | time_,
|  | bool | send_event
| ) |  |

## signal_closed()

Glib::SignalProxy< void,bool > Gdk::Display::signal_closed | ( |  | ) |

Slot Prototype:
  `void on_my_closed(bool is_error)`

Flags: Run Last

The signal_closed() signal is emitted when the connection to the windowing system for display is closed.

Since gtkmm 2.2:

Parameters

  is_error | `true` if the display was closed due to an error.

## signal_monitor_added()

Glib::SignalProxy< void,const Glib::RefPtr<Monitor>& > Gdk::Display::signal_monitor_added | ( |  | ) |

Slot Prototype:
  `void on_my_monitor_added(const Glib::RefPtr<Monitor>& monitor)`

Flags: Run Last

The signal_monitor_added() signal is emitted whenever a monitor is added.

Since gtkmm 3.22:

Parameters

  monitor | The monitor that was just added.

## signal_monitor_removed()

Glib::SignalProxy< void,const Glib::RefPtr<Monitor>& > Gdk::Display::signal_monitor_removed | ( |  | ) |

Slot Prototype:
  `void on_my_monitor_removed(const Glib::RefPtr<Monitor>& monitor)`

Flags: Run Last

The signal_monitor_removed() signal is emitted whenever a monitor is removed.

Since gtkmm 3.22:

Parameters

  monitor | The monitor that was just removed.

## signal_opened()

Glib::SignalProxy< void > Gdk::Display::signal_opened | ( |  | ) |

Slot Prototype:
  `void on_my_opened()`

Flags: Run Last

The signal_opened() signal is emitted when the connection to the windowing system for display is opened.

## signal_seat_added()

Glib::SignalProxy< void,const Glib::RefPtr<Seat>& > Gdk::Display::signal_seat_added | ( |  | ) |

Slot Prototype:
  `void on_my_seat_added(const Glib::RefPtr<Seat>& seat)`

Flags: Run Last

The signal_seat_added() signal is emitted whenever a new seat is made known to the windowing system.

Since gtkmm 3.20:

Parameters

  seat | The seat that was just added.

## signal_seat_removed()

Glib::SignalProxy< void,const Glib::RefPtr<Seat>& > Gdk::Display::signal_seat_removed | ( |  | ) |

Slot Prototype:
  `void on_my_seat_removed(const Glib::RefPtr<Seat>& seat)`

Flags: Run Last

The signal_seat_removed() signal is emitted whenever a seat is removed by the windowing system.

Since gtkmm 3.20:

Parameters

  seat | The seat that was just removed.

## store_clipboard() [1/2]

void Gdk::Display::store_clipboard | ( | const Glib::RefPtr< Gdk::Window >& | clipboard_window,
|  | guint32 | time_
| ) |  |

Issues a request to the clipboard manager to store the clipboard data, saving all available targets.

On X11, this is a special program that works according to the freedesktop clipboard specification, available at http://www.freedesktop.org/Standards/clipboard-manager-spec.

Since gtkmm 2.6:

Parameters

  clipboard_window | A Gdk::Window belonging to the clipboard owner.
  time_ | A timestamp.

## store_clipboard() [2/2]

void Gdk::Display::store_clipboard | ( | const Glib::RefPtr< Gdk::Window >& | clipboard_window,
|  | guint32 | time_,
|  | const std::vector< Glib::ustring > & | targets
| ) |  |

## supports_clipboard_persistence()

bool Gdk::Display::supports_clipboard_persistence | ( |  | ) | const

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 gtkmm 2.6:

Returns
  `true` if the display supports clipboard persistance.

## supports_composite()

bool Gdk::Display::supports_composite | ( |  | ) | const

Returns `true` if Gdk::Window::set_composited() can be used to redirect drawing on the window using compositing.

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

Since gtkmm 2.12:

Deprecated: 3.16: Compositing is an outdated technology that only ever worked on X11.

Deprecated:
  Compositing is an outdated technology that only ever worked on X11.

Returns
  `true` if windows may be composited.

## supports_cursor_alpha()

bool Gdk::Display::supports_cursor_alpha | ( |  | ) | const

Returns `true` if cursors can use an 8bit alpha channel on display.

Otherwise, cursors are restricted to bilevel alpha (i.e. a mask).

Since gtkmm 2.4:

Returns
  Whether cursors can have alpha channels.

## supports_cursor_color()

bool Gdk::Display::supports_cursor_color | ( |  | ) | const

Returns `true` if multicolored cursors are supported on display.

Otherwise, cursors have only a forground and a background color.

Since gtkmm 2.4:

Returns
  Whether cursors can have multiple colors.

## supports_input_shapes()

bool Gdk::Display::supports_input_shapes | ( |  | ) | const

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

Since gtkmm 2.10:

Returns
  `true` if windows with modified input shape are supported.

## supports_selection_notification()

bool Gdk::Display::supports_selection_notification | ( |  | ) | const

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

Since gtkmm 2.6:

Returns
  Whether Gdk::EventOwnerChange events will be sent.

## supports_shapes()

bool Gdk::Display::supports_shapes | ( |  | ) | const

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

Since gtkmm 2.10:

Returns
  `true` if shaped windows are supported.

## sync()

void Gdk::Display::sync | ( |  | ) |

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 sync() before gdk_error_trap_pop() 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 gtkmm 2.2:

## Friends And Related Function Documentation

## wrap()

Glib::RefPtr< Gdk::Display > wrap | ( | GdkDisplay * | object,
|  | bool | take_copy = `false`
| ) |  |

related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.