Gdk.Monitor¶
class — extends GObject.Object
Represents the individual outputs that are associated with a GdkDisplay.
GdkDisplay keeps a GListModel to enumerate and monitor
monitors with Display.get_monitors. You can use
Display.get_monitor_at_surface to find a particular
monitor.
Methods¶
get_connector¶
Gets the name of the monitor's connector, if available.
These are strings such as "eDP-1", or "HDMI-2". They depend on software and hardware configuration, and should not be relied on as stable identifiers of a specific monitor.
get_description¶
Gets a string describing the monitor, if available.
This can be used to identify a monitor in the UI.
get_display¶
Gets the display that this monitor belongs to.
get_geometry¶
Retrieves the size and position of the monitor within the display coordinate space.
The returned geometry is in ”application pixels”, not in
”device pixels” (see Monitor.get_scale).
get_height_mm¶
Gets the height in millimeters of the monitor.
get_manufacturer¶
Gets the name or PNP ID of the monitor's manufacturer.
Note that this value might also vary depending on actual display backend.
The PNP ID registry is located at https://uefi.org/pnp_id_list.
get_model¶
Gets the string identifying the monitor model, if available.
get_refresh_rate¶
Gets the refresh rate of the monitor, if available.
The value is in milli-Hertz, so a refresh rate of 60Hz is returned as 60000.
get_scale¶
Gets the internal scale factor that maps from monitor coordinates to device pixels.
This can be used if you want to create pixel based data for a
particular monitor, but most of the time you’re drawing to a surface
where it is better to use Surface.get_scale instead.
get_scale_factor¶
Gets the internal scale factor that maps from monitor coordinates to device pixels.
On traditional systems this is 1, but on very high density outputs it can be a higher value (often 2).
This can be used if you want to create pixel based data for a
particular monitor, but most of the time you’re drawing to a surface
where it is better to use Surface.get_scale_factor instead.
get_subpixel_layout¶
Gets information about the layout of red, green and blue primaries for pixels.
get_width_mm¶
Gets the width in millimeters of the monitor.
is_valid¶
Returns True if the monitor object corresponds to a
physical monitor.
The monitor becomes invalid when the physical monitor
is unplugged or removed.
Properties¶
connector¶
The connector name.
description¶
A short description of the monitor, meant for display to the user.
display¶
The GdkDisplay of the monitor.
geometry¶
The geometry of the monitor.
height_mm¶
The height of the monitor, in millimeters.
manufacturer¶
The manufacturer name.
model¶
The model name.
refresh_rate¶
The refresh rate, in milli-Hertz.
scale¶
The scale of the monitor.
scale_factor¶
The scale factor.
The scale factor is the next larger integer,
compared to Surface.scale.
subpixel_layout¶
The subpixel layout.
valid¶
Whether the object is still valid.
width_mm¶
The width of the monitor, in millimeters.
Signals¶
invalidate¶
Emitted when the output represented by monitor gets disconnected.