GnomeDesktop.RRScreen

g GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object GnomeDesktop.RRScreen GnomeDesktop.RRScreen GObject.Object->GnomeDesktop.RRScreen Gio.AsyncInitable->GnomeDesktop.RRScreen Gio.Initable->GnomeDesktop.RRScreen

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

class

new (screen)

class

new_async (screen, callback, *user_data)

class

new_finish (result)

get_crtc_by_id (id)

get_dpms_mode ()

get_output_by_id (id)

get_output_by_name (name)

get_ranges ()

list_clone_modes ()

list_crtcs ()

list_modes ()

list_outputs ()

refresh ()

set_dpms_mode (mode)

Virtual Methods

Inherited:

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

do_changed ()

do_output_connected (output)

do_output_disconnected (output)

Properties

Name

Type

Flags

Short Description

dpms-mode

GnomeDesktop.RRDpmsModeType

r/w

The DPMS mode for this GnomeDesktop.RRScreen

gdk-screen

Gdk.Screen

r/w/co

The GDK xlib.Screen represented by this GnomeDesktop.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 GnomeDesktop.RRScreen(**kwargs)
Bases:

GObject.Object, Gio.AsyncInitable, Gio.Initable

Abstract:

No

Structure:

GnomeDesktop.RRScreenClass

classmethod new(screen)
Parameters:

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

Raises:

GLib.Error

Returns:

a unique GnomeDesktop.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 GnomeDesktop.RRScreen.

Return type:

GnomeDesktop.RRScreen

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

classmethod new_async(screen, callback, *user_data)
Parameters:
classmethod new_finish(result)
Parameters:

result (Gio.AsyncResult) –

Raises:

GLib.Error

Return type:

GnomeDesktop.RRScreen

get_crtc_by_id(id)
Parameters:

id (int) –

Returns:

the CRTC identified by id

Return type:

GnomeDesktop.RRCrtc

get_dpms_mode()
Raises:

GLib.Error

Returns:

mode:

The current GnomeDesktop.RRDpmsMode of this screen

Return type:

(bool, mode: GnomeDesktop.RRDpmsMode)

get_output_by_id(id)
Parameters:

id (int) –

Returns:

the output identified by id

Return type:

GnomeDesktop.RROutput

get_output_by_name(name)
Parameters:

name (str) –

Returns:

the output identified by name

Return type:

GnomeDesktop.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

list_clone_modes()
Return type:

[GnomeDesktop.RRMode]

List available XRandR clone modes

list_crtcs()
Return type:

[GnomeDesktop.RRCrtc]

List all CRTCs

list_modes()
Return type:

[GnomeDesktop.RRMode]

List available XRandR modes

list_outputs()
Return type:

[GnomeDesktop.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 (GnomeDesktop.RRDpmsMode) –

Raises:

GLib.Error

Return type:

bool

This method also disables the DPMS timeouts.

do_changed() virtual
do_output_connected(output) virtual
Parameters:

output (GnomeDesktop.RROutput) –

do_output_disconnected(output) virtual
Parameters:

output (GnomeDesktop.RROutput) –

Signal Details

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

changed

Flags:

RUN_FIRST, NO_RECURSE, NO_HOOKS

Parameters:

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

GnomeDesktop.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.

GnomeDesktop.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

GnomeDesktop.RRScreen.props.dpms_mode
Name:

dpms-mode

Type:

GnomeDesktop.RRDpmsModeType

Default Value:

GnomeDesktop.RRDpmsModeType.UNKNOWN

Flags:

READABLE, WRITABLE

The DPMS mode for this GnomeDesktop.RRScreen

GnomeDesktop.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 GnomeDesktop.RRScreen