1.32 <GdkMonitor>

Class: <GdkMonitor>

It derives from <GObject>.

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.

Properties

Property: monitor:connector self

The connector name.

Its value is a string, or #f.

It is read only.

Property: monitor:description self

A short description of the monitor, meant for display to the user.

Its value is a string, or #f.

It is read only.

Property: monitor:display self

The <GdkDisplay> of the monitor.

Its value is a <GdkDisplay>, or #f.

It can only be set when the object is made, with #:display.

Property: monitor:geometry self

The geometry of the monitor.

Its value is a <GdkRectangle>, or #f.

It is read only.

Property: monitor:height-mm self

The height of the monitor, in millimeters.

Its value is a 32-bit integer.

It is read only.

Property: monitor:manufacturer self

The manufacturer name.

Its value is a string, or #f.

It is read only.

Property: monitor:model self

The model name.

Its value is a string, or #f.

It is read only.

Property: monitor:refresh-rate self

The refresh rate, in milli-Hertz.

Its value is a 32-bit integer.

It is read only.

Property: monitor:scale self

The scale of the monitor.

Its value is a real number.

It is read only.

Property: monitor:scale-factor self

The scale factor.

The scale factor is the next larger integer, compared to surface:scale.

Its value is a 32-bit integer.

It is read only.

Property: monitor:subpixel-layout self

The subpixel layout.

Its value is a <GdkSubpixelLayout>.

It is read only.

Property: monitor:valid self

Whether the object is still valid.

Its value is a boolean.

It is read only.

Property: monitor:width-mm self

The width of the monitor, in millimeters.

Its value is a 32-bit integer.

It is read only.

Procedures

Method: monitor:get-connector self ⇒ %return
Method: get-connector self ⇒ %return

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.

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a string, or #f.

the name of the connector

Method: monitor:get-description self ⇒ %return
Method: get-description self ⇒ %return

Gets a string describing the monitor, if available.

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

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a string, or #f.

the monitor description

Method: monitor:get-display self ⇒ %return
Method: get-display self ⇒ %return

Gets the display that this monitor belongs to.

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a <GdkDisplay>.

the display

Method: monitor:get-geometry! self geometry ⇒ geometry
Method: get-geometry! self geometry ⇒ 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).

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

geometry

Passed, filled in, and returned: a <GdkRectangle>.

a <GdkRectangle> to be filled with the monitor geometry

Method: monitor:get-height-mm self ⇒ %return
Method: get-height-mm self ⇒ %return

Gets the height in millimeters of the monitor.

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a 32-bit integer.

the physical height of the monitor

Method: monitor:get-manufacturer self ⇒ %return
Method: get-manufacturer self ⇒ %return

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.

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a string, or #f.

the name of the manufacturer

Method: monitor:get-model self ⇒ %return
Method: get-model self ⇒ %return

Gets the string identifying the monitor model, if available.

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a string, or #f.

the monitor model

Method: monitor:get-refresh-rate self ⇒ %return
Method: get-refresh-rate self ⇒ %return

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.

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a 32-bit integer.

the refresh rate in milli-Hertz, or 0

Method: monitor:get-scale self ⇒ %return
Method: get-scale self ⇒ %return

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.

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a real number.

the scale

Method: monitor:get-scale-factor self ⇒ %return
Method: get-scale-factor self ⇒ %return

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.

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a 32-bit integer.

the scale factor

Method: monitor:get-subpixel-layout self ⇒ %return
Method: get-subpixel-layout self ⇒ %return

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

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a <GdkSubpixelLayout>.

the subpixel layout

Method: monitor:get-width-mm self ⇒ %return
Method: get-width-mm self ⇒ %return

Gets the width in millimeters of the monitor.

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a 32-bit integer.

the physical width of the monitor

Method: monitor:is-valid? self ⇒ %return
Method: is-valid? self ⇒ %return

Returns #t if the self object corresponds to a physical monitor.

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

self

Passed: a <GdkMonitor>.

a <GdkMonitor>

%return

Returned: a boolean.

#t if the object corresponds to a physical monitor

Signals

Signal: monitor:invalidate

Connect a handler with (connect object monitor:invalidate handler). It is called as (handler self).

Emitted when the output represented by monitor gets disconnected.

self

Passed: a <GdkMonitor>.