:right-sidebar: True Monitor =================================================================== .. currentmodule:: gi.repository.Gdk .. class:: Monitor(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` ``GdkMonitor`` objects represent the individual outputs that are associated with a ``GdkDisplay``\. ``GdkDisplay`` keeps a ``GListModel`` to enumerate and monitor monitors with :obj:`~gi.repository.Gdk.Display.get_monitors`\. You can use :obj:`~gi.repository.Gdk.Display.get_monitor_at_surface` to find a particular monitor. 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 type of the None singleton. .. attribute:: props.description :type: str The type of the None singleton. .. versionadded:: 4.10 .. attribute:: props.display :type: ~gi.repository.Gdk.Display The type of the None singleton. .. attribute:: props.geometry :type: ~gi.repository.Gdk.Rectangle The type of the None singleton. .. attribute:: props.height_mm :type: int The type of the None singleton. .. attribute:: props.manufacturer :type: str The type of the None singleton. .. attribute:: props.model :type: str The type of the None singleton. .. attribute:: props.refresh_rate :type: int The type of the None singleton. .. attribute:: props.scale :type: float The type of the None singleton. .. versionadded:: 4.14 .. attribute:: props.scale_factor :type: int The type of the None singleton. .. attribute:: props.subpixel_layout :type: ~gi.repository.Gdk.SubpixelLayout The type of the None singleton. .. attribute:: props.valid :type: bool The type of the None singleton. .. attribute:: props.width_mm :type: int The type of the None singleton. Signals ------- .. rst-class:: interim-class .. class:: Monitor.signals :no-index: .. method:: invalidate() -> None The type of the None singleton.