:right-sidebar: True Monitor =================================================================== .. currentmodule:: gi.repository.Gdk .. class:: Monitor(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` :Constructors: :: Monitor(**properties) Methods ------- .. rst-class:: interim-class .. class:: Monitor :no-index: .. method:: 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. .. method:: get_description() -> str | None Gets a string describing the monitor, if available. This can be used to identify a monitor in the UI. .. versionadded:: 4.10 .. method:: get_display() -> ~gi.repository.Gdk.Display Gets the display that this monitor belongs to. .. method:: get_geometry() -> ~gi.repository.Gdk.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 :obj:`~gi.repository.Gdk.Monitor.get_scale`). .. method:: get_height_mm() -> int Gets the height in millimeters of the monitor. .. method:: 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 `_. .. method:: get_model() -> str | None Gets the string identifying the monitor model, if available. .. method:: 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. .. method:: 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 :obj:`~gi.repository.Gdk.Surface.get_scale` instead. .. versionadded:: 4.14 .. method:: 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 :obj:`~gi.repository.Gdk.Surface.get_scale_factor` instead. .. method:: get_subpixel_layout() -> ~gi.repository.Gdk.SubpixelLayout Gets information about the layout of red, green and blue primaries for pixels. .. method:: get_width_mm() -> int Gets the width in millimeters of the monitor. .. method:: is_valid() -> bool Returns :const:`True` if the ``monitor`` object corresponds to a physical monitor. The ``monitor`` becomes invalid when the physical monitor is unplugged or removed. Properties ---------- .. rst-class:: interim-class .. class:: Monitor :no-index: .. attribute:: props.connector :type: str The connector name. .. attribute:: props.description :type: str A short description of the monitor, meant for display to the user. .. versionadded:: 4.10 .. attribute:: props.display :type: ~gi.repository.Gdk.Display The ``GdkDisplay`` of the monitor. .. attribute:: props.geometry :type: ~gi.repository.Gdk.Rectangle The geometry of the monitor. .. attribute:: props.height_mm :type: int The height of the monitor, in millimeters. .. attribute:: props.manufacturer :type: str The manufacturer name. .. attribute:: props.model :type: str The model name. .. attribute:: props.refresh_rate :type: int The refresh rate, in milli-Hertz. .. attribute:: props.scale :type: float The scale of the monitor. .. versionadded:: 4.14 .. attribute:: props.scale_factor :type: int The scale factor. The scale factor is the next larger integer, compared to :obj:`~gi.repository.Gdk.Surface.props.scale`. .. attribute:: props.subpixel_layout :type: ~gi.repository.Gdk.SubpixelLayout The subpixel layout. .. attribute:: props.valid :type: bool Whether the object is still valid. .. attribute:: props.width_mm :type: int The width of the monitor, in millimeters. Signals ------- .. rst-class:: interim-class .. class:: Monitor.signals :no-index: .. method:: invalidate() -> None Emitted when the output represented by ``monitor`` gets disconnected.