CinnamonDesktop.RRScreen

g CinnamonDesktop.RRScreen CinnamonDesktop.RRScreen GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object GObject.Object->CinnamonDesktop.RRScreen Gio.Initable->CinnamonDesktop.RRScreen

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

class

new (screen)

calculate_best_global_scale (index)

calculate_supported_scales (width, height, n_supported_scales)

create_clone_modes ()

get_crtc_by_id (id)

get_dpms_mode (mode)

get_global_scale ()

get_global_scale_setting ()

get_output_by_id (id)

get_output_by_name (name)

get_ranges ()

get_timestamps ()

get_use_upscaling ()

list_clone_modes ()

list_crtcs ()

list_modes ()

list_outputs ()

refresh ()

set_dpms_mode (mode)

set_global_scale_setting (scale_factor)

set_primary_output (output)

set_size (width, height, mm_width, mm_height)

Virtual Methods

Inherited:

GObject.Object (7), Gio.Initable (1)

Properties

Name

Type

Flags

Short Description

gdk-screen

Gdk.Screen

r/w/co

The GDK xlib.Screen represented by this CinnamonDesktop.RRScreen

Signals

Inherited:

GObject.Object (1)

Name

Short Description

changed

output-connected

This signal is emitted when a display device is connected to a port, or a port is hotplugged with an active output.

output-disconnected

This signal is emitted when a display device is disconnected from a port, or a port output is hot-unplugged.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class CinnamonDesktop.RRScreen(**kwargs)
Bases:

GObject.Object, Gio.Initable

Abstract:

No

Structure:

CinnamonDesktop.RRScreenClass

classmethod new(screen)
Parameters:

screen (Gdk.Screen) – the Gdk.Screen on which to operate

Raises:

GLib.Error

Returns:

a unique CinnamonDesktop.RRScreen instance, specific to the screen, or None if this could not be created, for instance if the driver does not support Xrandr 1.2. Each Gdk.Screen thus has a single instance of CinnamonDesktop.RRScreen.

Return type:

CinnamonDesktop.RRScreen

Creates a unique CinnamonDesktop.RRScreen instance for the specified screen.

calculate_best_global_scale(index)
Parameters:

index (int) –

Return type:

int

calculate_supported_scales(width, height, n_supported_scales)
Parameters:
  • width (int) –

  • height (int) –

  • n_supported_scales (int) –

Return type:

float

create_clone_modes()
Return type:

CinnamonDesktop.RRMode

get_crtc_by_id(id)
Parameters:

id (int) –

Returns:

the CRTC identified by id

Return type:

CinnamonDesktop.RRCrtc

get_dpms_mode(mode)
Parameters:

mode (CinnamonDesktop.RRDpmsMode) –

Raises:

GLib.Error

Return type:

bool

get_global_scale()
Return type:

int

get_global_scale_setting()
Return type:

int

get_output_by_id(id)
Parameters:

id (int) –

Returns:

the output identified by id

Return type:

CinnamonDesktop.RROutput

get_output_by_name(name)
Parameters:

name (str) –

Returns:

the output identified by name

Return type:

CinnamonDesktop.RROutput

get_ranges()
Returns:

min_width:

the minimum width

max_width:

the maximum width

min_height:

the minimum height

max_height:

the maximum height

Return type:

(min_width: int, max_width: int, min_height: int, max_height: int)

Get the ranges of the screen

get_timestamps()
Returns:

change_timestamp_ret:

Location in which to store the timestamp at which the RANDR configuration was last changed

config_timestamp_ret:

Location in which to store the timestamp at which the RANDR configuration was last obtained

Return type:

(change_timestamp_ret: int, config_timestamp_ret: int)

Queries the two timestamps that the X RANDR extension maintains. The X server will prevent change requests for stale configurations, those whose timestamp is not equal to that of the latest request for configuration. The X server will also prevent change requests that have an older timestamp to the latest change request.

get_use_upscaling()
Return type:

bool

list_clone_modes()
Return type:

[CinnamonDesktop.RRMode]

List available XRandR clone modes

list_crtcs()
Return type:

[CinnamonDesktop.RRCrtc]

List all CRTCs

list_modes()
Return type:

[CinnamonDesktop.RRMode]

List available XRandR modes

list_outputs()
Return type:

[CinnamonDesktop.RROutput]

List all outputs

refresh()
Raises:

GLib.Error

Returns:

True if the screen’s configuration changed; otherwise, the function returns False and a None error if the configuration didn’t change, or False and a non-None error if there was an error while refreshing the configuration.

Return type:

bool

Refreshes the screen configuration, and calls the screen’s callback if it exists and if the screen’s configuration changed.

set_dpms_mode(mode)
Parameters:

mode (CinnamonDesktop.RRDpmsMode) –

Raises:

GLib.Error

Return type:

bool

This method also disables the DPMS timeouts.

set_global_scale_setting(scale_factor)
Parameters:

scale_factor (int) –

set_primary_output(output)
Parameters:

output (CinnamonDesktop.RROutput) –

set_size(width, height, mm_width, mm_height)
Parameters:
  • width (int) –

  • height (int) –

  • mm_width (int) –

  • mm_height (int) –

Signal Details

CinnamonDesktop.RRScreen.signals.changed(r_r_screen)
Signal Name:

changed

Flags:

RUN_FIRST, NO_RECURSE, NO_HOOKS

Parameters:

r_r_screen (CinnamonDesktop.RRScreen) – The object which received the signal

CinnamonDesktop.RRScreen.signals.output_connected(r_r_screen, output)
Signal Name:

output-connected

Flags:

RUN_FIRST, NO_RECURSE, NO_HOOKS

Parameters:

This signal is emitted when a display device is connected to a port, or a port is hotplugged with an active output. The latter can happen if a laptop is docked, and the dock provides a new active output.

The output value is not a GObject.Object. The returned output value can only assume to be valid during the emission of the signal (i.e. within your signal handler only), as it may change later when the screen is modified due to an event from the X server, or due to another place in the application modifying the screen and the output. Therefore, deal with changes to the output right in your signal handler, instead of keeping the output reference for an async or idle function.

CinnamonDesktop.RRScreen.signals.output_disconnected(r_r_screen, output)
Signal Name:

output-disconnected

Flags:

RUN_FIRST, NO_RECURSE, NO_HOOKS

Parameters:

This signal is emitted when a display device is disconnected from a port, or a port output is hot-unplugged. The latter can happen if a laptop is undocked, and the dock provided the output.

The output value is not a GObject.Object. The returned output value can only assume to be valid during the emission of the signal (i.e. within your signal handler only), as it may change later when the screen is modified due to an event from the X server, or due to another place in the application modifying the screen and the output. Therefore, deal with changes to the output right in your signal handler, instead of keeping the output reference for an async or idle function.

Property Details

CinnamonDesktop.RRScreen.props.gdk_screen
Name:

gdk-screen

Type:

Gdk.Screen

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The GDK xlib.Screen represented by this CinnamonDesktop.RRScreen