Monitor#

class Monitor(**properties: Any)#

Superclasses: Object

GdkMonitor objects represent the individual outputs that are associated with a GdkDisplay.

GdkDisplay keeps a GListModel to enumerate and monitor monitors with get_monitors. You can use get_monitor_at_surface to find a particular monitor.

Methods#

class Monitor
get_connector() str | None#

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() str | None#

Gets a string describing the monitor, if available.

This can be used to identify a monitor in the UI.

Added in version 4.10.

get_display() Display#

Gets the display that this monitor belongs to.

get_geometry() Rectangle#

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 get_scale).

get_height_mm() int#

Gets the height in millimeters of the monitor.

get_manufacturer() str | None#

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() str | None#

Gets the string identifying the monitor model, if available.

get_refresh_rate() int#

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() float#

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 get_scale instead.

Added in version 4.14.

get_scale_factor() int#

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 get_scale_factor instead.

get_subpixel_layout() SubpixelLayout#

Gets information about the layout of red, green and blue primaries for pixels.

get_width_mm() int#

Gets the width in millimeters of the monitor.

is_valid() bool#

Returns True if the monitor object corresponds to a physical monitor.

The monitor becomes invalid when the physical monitor is unplugged or removed.

Properties#

class Monitor
props.connector: str#

The type of the None singleton.

props.description: str#

The type of the None singleton.

Added in version 4.10.

props.display: Display#

The type of the None singleton.

props.geometry: Rectangle#

The type of the None singleton.

props.height_mm: int#

The type of the None singleton.

props.manufacturer: str#

The type of the None singleton.

props.model: str#

The type of the None singleton.

props.refresh_rate: int#

The type of the None singleton.

props.scale: float#

The type of the None singleton.

Added in version 4.14.

props.scale_factor: int#

The type of the None singleton.

props.subpixel_layout: SubpixelLayout#

The type of the None singleton.

props.valid: bool#

The type of the None singleton.

props.width_mm: int#

The type of the None singleton.

Signals#

class Monitor.signals
invalidate() None#

The type of the None singleton.