GdkX11.X11Screen

g GObject.Object GObject.Object Gdk.Screen Gdk.Screen GObject.Object->Gdk.Screen GdkX11.X11Screen GdkX11.X11Screen Gdk.Screen->GdkX11.X11Screen

Subclasses:

None

Methods

Inherited:

Gdk.Screen (35), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_current_desktop ()

get_monitor_output (monitor_num)

get_number_of_desktops ()

get_screen_number ()

get_window_manager_name ()

get_xscreen ()

lookup_visual (xvisualid)

supports_net_wm_hint (property)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Gdk.Screen (2)

Signals

Inherited:

Gdk.Screen (3), GObject.Object (1)

Name

Short Description

window-manager-changed

Fields

Inherited:

Gdk.Screen (3), GObject.Object (1)

Class Details

class GdkX11.X11Screen(**kwargs)
Bases:

Gdk.Screen

Abstract:

No

Structure:

GdkX11.X11ScreenClass

get_current_desktop()[source]
Returns:

the current workspace, or 0 if workspaces are not supported

Return type:

int

Returns the current workspace for self when running under a window manager that supports multiple workspaces, as described in the Extended Window Manager Hints specification.

New in version 3.10.

get_monitor_output(monitor_num)[source]
Parameters:

monitor_num (int) – number of the monitor, between 0 and Gdk.Screen.get_n_monitors (screen)

Returns:

the XID of the monitor

Return type:

int

Gets the XID of the specified output/monitor. If the X server does not support version 1.2 of the RANDR extension, 0 is returned.

New in version 2.14.

get_number_of_desktops()[source]
Returns:

the number of workspaces, or 0 if workspaces are not supported

Return type:

int

Returns the number of workspaces for self when running under a window manager that supports multiple workspaces, as described in the Extended Window Manager Hints specification.

New in version 3.10.

get_screen_number()[source]
Returns:

the position of self among the screens of its display

Return type:

int

Returns the index of a Gdk.Screen.

New in version 2.2.

get_window_manager_name()[source]
Returns:

the name of the window manager screen self, or “unknown” if the window manager is unknown. The string is owned by GDK and should not be freed.

Return type:

str

Returns the name of the window manager for self.

New in version 2.2.

get_xscreen()[source]
Returns:

an Xlib xlib.Screen

Return type:

xlib.Screen

Returns the screen of a Gdk.Screen.

New in version 2.2.

lookup_visual(xvisualid)[source]
Parameters:

xvisualid (int) – an X xlib.Visual ID.

Returns:

the Gdk.Visual (owned by the screen object), or None if the visual ID wasn’t found.

Return type:

GdkX11.X11Visual

Looks up the Gdk.Visual for a particular screen and X xlib.Visual ID.

New in version 2.2.

supports_net_wm_hint(property)[source]
Parameters:

property (Gdk.Atom) – a property atom.

Returns:

True if the window manager supports property

Return type:

bool

This function is specific to the X11 backend of GDK, and indicates whether the window manager supports a certain hint from the Extended Window Manager Hints specification.

When using this function, keep in mind that the window manager can change over time; so you shouldn’t use this function in a way that impacts persistent application state. A common bug is that your application can start up before the window manager does when the user logs in, and before the window manager starts GdkX11.X11Screen.supports_net_wm_hint() will return False for every property. You can monitor the window_manager_changed signal on Gdk.Screen to detect a window manager change.

New in version 2.2.

Signal Details

GdkX11.X11Screen.signals.window_manager_changed(x11_screen)
Signal Name:

window-manager-changed

Flags:

RUN_LAST

Parameters:

x11_screen (GdkX11.X11Screen) – The object which received the signal