Wnck.Screen

g GObject.Object GObject.Object Wnck.Screen Wnck.Screen GObject.Object->Wnck.Screen

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class free_workspace_layout (layout)
class get (index)
class get_default ()
class get_for_root (root_window_id)
  calc_workspace_layout (num_workspaces, space_index, layout)
  change_workspace_count (count)
  force_update ()
  get_active_window ()
  get_active_workspace ()
  get_background_pixmap ()
  get_height ()
  get_number ()
  get_previously_active_window ()
  get_showing_desktop ()
  get_width ()
  get_window_manager_name ()
  get_windows ()
  get_windows_stacked ()
  get_workspace (workspace)
  get_workspace_count ()
  get_workspaces ()
  move_viewport (x, y)
  net_wm_supports (atom)
  release_workspace_layout (current_token)
  toggle_showing_desktop (show)
  try_set_workspace_layout (current_token, rows, columns)

Properties

None

Signals

Inherited:GObject.Object (1)
Name Short Description
active-window-changed Emitted when the active window on screen has changed.
active-workspace-changed Emitted when the active workspace on screen has changed.
application-closed Emitted when a Wnck.Application is closed on screen.
application-opened Emitted when a new Wnck.Application is opened on screen.
background-changed Emitted when the background on the root window of screen has changed.
class-group-closed Emitted when a Wnck.ClassGroup is closed on screen.
class-group-opened Emitted when a new Wnck.ClassGroup is opened on screen.
showing-desktop-changed Emitted when “showing the desktop” mode of screen is toggled.
viewports-changed Emitted when a viewport position has changed in a Wnck.Workspace of screen or when a Wnck.Workspace of screen gets or loses its viewport.
window-closed Emitted when a Wnck.Window is closed on screen.
window-manager-changed Emitted when the window manager on screen has changed.
window-opened Emitted when a new Wnck.Window is opened on screen.
window-stacking-changed Emitted when the stacking order of Wnck.Window on screen has changed.
workspace-created Emitted when a Wnck.Workspace is created on screen.
workspace-destroyed Emitted when a Wnck.Workspace is destroyed on screen.

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent_instance GObject.Object r  

Class Details

class Wnck.Screen(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:Wnck.ScreenClass

The Wnck.Screen struct contains only private fields and should not be directly accessed.

classmethod free_workspace_layout(layout)
Parameters:layout (Wnck.WorkspaceLayout) – a Wnck.WorkspaceLayout.

Frees the content of layout. This does not free layout itself, so you might want to free layout yourself after calling this.

New in version 2.12.

Deprecated since version 2.20.

classmethod get(index)
Parameters:index (int) – screen number, starting from 0.
Returns:the Wnck.Screen for screen index, or None if no such screen exists. The returned Wnck.Screen is owned by libwnck and must not be referenced or unreferenced.
Return type:Wnck.Screen

Gets the Wnck.Screen for a given screen on the default display.

classmethod get_default()
Returns:the default Wnck.Screen. The returned Wnck.Screen is owned by libwnck and must not be referenced or unreferenced. This can return None if not on X11.
Return type:Wnck.Screen or None

Gets the default Wnck.Screen on the default display.

classmethod get_for_root(root_window_id)
Parameters:root_window_id (int) – an X window ID.
Returns:the Wnck.Screen for the root window at root_window_id, or None. The returned Wnck.Screen is owned by libwnck and must not be referenced or unreferenced.
Return type:Wnck.Screen

Gets the Wnck.Screen for the root window at root_window_id, or None if no Wnck.Screen exists for this root window.

This function does not work if Wnck.Screen.get() was not called for the sought Wnck.Screen before, and returns None.

calc_workspace_layout(num_workspaces, space_index, layout)
Parameters:

Calculates the layout of Wnck.Workspace, with additional information like the row and column of the Wnck.Workspace with index space_index.

New in version 2.12.

Deprecated since version 2.20.

change_workspace_count(count)
Parameters:count (int) – the number of Wnck.Workspace to request.

Asks the window manager to change the number of Wnck.Workspace on self.

New in version 2.2.

force_update()

Synchronously and immediately updates the list of Wnck.Window on self. This bypasses the standard update mechanism, where the list of Wnck.Window is updated in the idle loop.

This is usually a bad idea for both performance and correctness reasons (to get things right, you need to write model-view code that tracks changes, not get a static list of open windows). However, this function can be useful for small applications that just do something and then exit.

get_active_window()
Returns:the active Wnck.Window on self, or None. The returned Wnck.Window is owned by libwnck and must not be referenced or unreferenced.
Return type:Wnck.Window

Gets the active Wnck.Window on self. May return None sometimes, since not all window managers guarantee that a window is always active.

get_active_workspace()
Returns:the active Wnck.Workspace on self, or None. The returned Wnck.Workspace is owned by libwnck and must not be referenced or unreferenced.
Return type:Wnck.Workspace

Gets the active Wnck.Workspace on self. May return None sometimes, if libwnck is in a weird state due to the asynchronous nature of the interaction with the window manager.

get_background_pixmap()
Returns:the X window ID of the background pixmap of self.
Return type:int

Gets the X window ID of the background pixmap of self.

get_height()
Returns:the height of self.
Return type:int

Gets the height of self.

get_number()
Returns:the index of space on self, or -1 on errors.
Return type:int

Gets the index of self on the display to which it belongs. The first Wnck.Screen has an index of 0.

New in version 2.20.

get_previously_active_window()
Returns:the previously active Wnck.Window on self, or None. The returned Wnck.Window is owned by libwnck and must not be referenced or unreferenced.
Return type:Wnck.Window

Gets the previously active Wnck.Window on self. May return None sometimes, since not all window managers guarantee that a window is always active.

New in version 2.8.

get_showing_desktop()
Returns:True if window is fullscreen, False otherwise.
Return type:bool

Gets whether self is in the “showing the desktop” mode. This mode is changed when a Wnck.Screen ::showing-desktop-changed signal gets emitted.

New in version 2.2.

get_width()
Returns:the width of self.
Return type:int

Gets the width of self.

get_window_manager_name()
Returns:the name of the window manager, or None if the window manager does not comply with the EWMH specification.
Return type:str

Gets the name of the window manager.

New in version 2.20.

get_windows()
Returns:the list of Wnck.Window on self, or None if there is no window on self. The list should not be modified nor freed, as it is owned by self.
Return type:[Wnck.Window]

Gets the list of Wnck.Window on self. The list is not in a defined order, but should be “stable” (windows should not be reordered in it). However, the stability of the list is established by the window manager, so don’t blame libwnck if it breaks down.

get_windows_stacked()
Returns:the list of Wnck.Window in stacking order on self, or None if there is no window on self. The list should not be modified nor freed, as it is owned by self.
Return type:[Wnck.Window]

Gets the list of Wnck.Window on self in bottom-to-top order.

get_workspace(workspace)
Parameters:workspace (int) – a workspace index, starting from 0.
Returns:the Wnck.Workspace numbered workspace on self, or None if no such workspace exists. The returned Wnck.Workspace is owned by libwnck and must not be referenced or unreferenced.
Return type:Wnck.Workspace

Gets the Wnck.Workspace numbered workspace on self.

get_workspace_count()
Returns:the number of Wnck.Workspace on self.
Return type:int

Gets the number of Wnck.Workspace on self.

get_workspaces()
Returns:the list of Wnck.Workspace on self. The list should not be modified nor freed, as it is owned by self.
Return type:[Wnck.Workspace]

Gets the list of Wnck.Workspace on self. The list is ordered: the first element in the list is the first Wnck.Workspace, etc..

New in version 2.20.

move_viewport(x, y)
Parameters:
  • x (int) – X offset in pixels of viewport.
  • y (int) – Y offset in pixels of viewport.

Asks the window manager to move the viewport of the current Wnck.Workspace on self.

New in version 2.4.

net_wm_supports(atom)
Parameters:atom (str) – a property atom.
Returns:True if the window manager for self supports the atom hint, False otherwise.
Return type:bool

Gets whether the window manager for self supports a certain hint from the Extended Window Manager Hints specification (EWMH).

When using this function, keep in mind that the window manager can change over time; so you should not 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 Wnck.Screen.net_wm_supports() will return False for every property.

See also gdk_x11_screen_supports_net_wm_hint() in GDK.

release_workspace_layout(current_token)
Parameters:current_token (int) – the token obtained through Wnck.Screen.try_set_workspace_layout().

Releases the ownership of the layout of Wnck.Workspace on self. current_token is used to verify that the caller is the owner of the layout. If the verification fails, nothing happens.

toggle_showing_desktop(show)
Parameters:show (bool) – whether to activate the “showing the desktop” mode on self.

Asks the window manager to set the “showing the desktop” mode on self according to show.

New in version 2.2.

try_set_workspace_layout(current_token, rows, columns)
Parameters:
Returns:

a token to use for future calls to Wnck.Screen.try_set_workspace_layout() and to Wnck.Screen.release_workspace_layout(), or 0 if the layout could not be set.

Return type:

int

Tries to modify the layout of Wnck.Workspace on self. To do this, tries to acquire ownership of the layout. If the current process is the owner of the layout, current_token is used to determine if the caller is the owner (there might be more than one part of the same process trying to set the layout). Since no more than one application should set this property of self at a time, setting the layout is not guaranteed to work.

If rows is 0, the actual number of rows will be determined based on columns and the number of Wnck.Workspace. If columns is 0, the actual number of columns will be determined based on rows and the number of Wnck.Workspace. rows and columns must not be 0 at the same time.

You have to release the ownership of the layout with Wnck.Screen.release_workspace_layout() when you do not need it anymore.

do_active_window_changed(previous_window) virtual
Parameters:previous_window (Wnck.Window) –
do_active_workspace_changed(previous_workspace) virtual
Parameters:previous_workspace (Wnck.Workspace) –
do_application_closed(app) virtual
Parameters:app (Wnck.Application) –
do_application_opened(app) virtual
Parameters:app (Wnck.Application) –
do_background_changed() virtual
do_class_group_closed(class_group) virtual
Parameters:class_group (Wnck.ClassGroup) –
do_class_group_opened(class_group) virtual
Parameters:class_group (Wnck.ClassGroup) –
do_showing_desktop_changed() virtual
do_viewports_changed() virtual
do_window_closed(window) virtual
Parameters:window (Wnck.Window) –
do_window_manager_changed() virtual
do_window_opened(window) virtual
Parameters:window (Wnck.Window) –
do_window_stacking_changed() virtual
do_workspace_created(space) virtual
Parameters:space (Wnck.Workspace) –
do_workspace_destroyed(space) virtual
Parameters:space (Wnck.Workspace) –

Signal Details

Wnck.Screen.signals.active_window_changed(screen, previously_active_window)
Signal Name:

active-window-changed

Flags:

RUN_LAST

Parameters:

Emitted when the active window on screen has changed.

Wnck.Screen.signals.active_workspace_changed(screen, previously_active_space)
Signal Name:

active-workspace-changed

Flags:

RUN_LAST

Parameters:

Emitted when the active workspace on screen has changed.

Wnck.Screen.signals.application_closed(screen, app)
Signal Name:

application-closed

Flags:

RUN_LAST

Parameters:

Emitted when a Wnck.Application is closed on screen.

Wnck.Screen.signals.application_opened(screen, app)
Signal Name:

application-opened

Flags:

RUN_LAST

Parameters:

Emitted when a new Wnck.Application is opened on screen.

Wnck.Screen.signals.background_changed(screen)
Signal Name:background-changed
Flags:RUN_LAST
Parameters:screen (Wnck.Screen) – The object which received the signal

Emitted when the background on the root window of screen has changed.

Wnck.Screen.signals.class_group_closed(screen, class_group)
Signal Name:

class-group-closed

Flags:

RUN_LAST

Parameters:

Emitted when a Wnck.ClassGroup is closed on screen.

New in version 2.20.

Wnck.Screen.signals.class_group_opened(screen, class_group)
Signal Name:

class-group-opened

Flags:

RUN_LAST

Parameters:

Emitted when a new Wnck.ClassGroup is opened on screen.

New in version 2.20.

Wnck.Screen.signals.showing_desktop_changed(screen)
Signal Name:showing-desktop-changed
Flags:RUN_LAST
Parameters:screen (Wnck.Screen) – The object which received the signal

Emitted when “showing the desktop” mode of screen is toggled.

New in version 2.20.

Wnck.Screen.signals.viewports_changed(screen)
Signal Name:viewports-changed
Flags:RUN_LAST
Parameters:screen (Wnck.Screen) – The object which received the signal

Emitted when a viewport position has changed in a Wnck.Workspace of screen or when a Wnck.Workspace of screen gets or loses its viewport.

New in version 2.20.

Wnck.Screen.signals.window_closed(screen, window)
Signal Name:

window-closed

Flags:

RUN_LAST

Parameters:

Emitted when a Wnck.Window is closed on screen.

Wnck.Screen.signals.window_manager_changed(screen)
Signal Name:window-manager-changed
Flags:RUN_LAST
Parameters:screen (Wnck.Screen) – The object which received the signal

Emitted when the window manager on screen has changed.

New in version 2.20.

Wnck.Screen.signals.window_opened(screen, window)
Signal Name:

window-opened

Flags:

RUN_LAST

Parameters:

Emitted when a new Wnck.Window is opened on screen.

Wnck.Screen.signals.window_stacking_changed(screen)
Signal Name:window-stacking-changed
Flags:RUN_LAST
Parameters:screen (Wnck.Screen) – The object which received the signal

Emitted when the stacking order of Wnck.Window on screen has changed.

Wnck.Screen.signals.workspace_created(screen, space)
Signal Name:

workspace-created

Flags:

RUN_LAST

Parameters:
  • screen (Wnck.Screen) – The object which received the signal
  • space (Wnck.Workspace) – the workspace that has been created.

Emitted when a Wnck.Workspace is created on screen.

Wnck.Screen.signals.workspace_destroyed(screen, space)
Signal Name:

workspace-destroyed

Flags:

RUN_LAST

Parameters:
  • screen (Wnck.Screen) – The object which received the signal
  • space (Wnck.Workspace) – the workspace that has been destroyed.

Emitted when a Wnck.Workspace is destroyed on screen.