Wnck.Screen¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the active window on screen has changed. |
|
Emitted when the active workspace on screen has changed. |
|
Emitted when a |
|
Emitted when a new |
|
Emitted when the background on the root window of screen has changed. |
|
Emitted when a |
|
Emitted when a new |
|
Emitted when “showing the desktop” mode of screen is toggled. |
|
Emitted when a viewport position has changed in a |
|
Emitted when a |
|
Emitted when the window manager on screen has changed. |
|
Emitted when a new |
|
Emitted when the stacking order of |
|
Emitted when a |
|
Emitted when a |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Wnck.Screen(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Wnck.Screen
struct contains only private fields and should not be directly accessed.- classmethod free_workspace_layout(layout)¶
- Parameters:
layout (
Wnck.WorkspaceLayout
) – aWnck.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, orNone
if no such screen exists. The returnedWnck.Screen
is owned by libwnck and must not be referenced or unreferenced.- Return type:
Gets the
Wnck.Screen
for a given screen on the default display.
- classmethod get_default()¶
- Returns:
the default
Wnck.Screen
. The returnedWnck.Screen
is owned by libwnck and must not be referenced or unreferenced. This can returnNone
if not on X11.- Return type:
Wnck.Screen
orNone
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, orNone
. The returnedWnck.Screen
is owned by libwnck and must not be referenced or unreferenced.- Return type:
Gets the
Wnck.Screen
for the root window at root_window_id, orNone
if noWnck.Screen
exists for this root window.This function does not work if
Wnck.Screen.get
() was not called for the soughtWnck.Screen
before, and returnsNone
.
- calc_workspace_layout(num_workspaces, space_index, layout)¶
- Parameters:
num_workspaces (
int
) – the number ofWnck.Workspace
on self, or -1 to letWnck.Screen.calc_workspace_layout
() find this number.space_index (
int
) – the index of aWnck.Workspace
.layout (
Wnck.WorkspaceLayout
) – return location for the layout ofWnck.Workspace
with additional information.
Calculates the layout of
Wnck.Workspace
, with additional information like the row and column of theWnck.Workspace
with index space_index.New in version 2.12.
Deprecated since version 2.20.
- change_workspace_count(count)¶
- Parameters:
count (
int
) – the number ofWnck.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 ofWnck.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, orNone
. The returnedWnck.Window
is owned by libwnck and must not be referenced or unreferenced.- Return type:
Gets the active
Wnck.Window
on self. May returnNone
sometimes, since not all window managers guarantee that a window is always active.
- get_active_workspace()¶
- Returns:
the active
Wnck.Workspace
on self, orNone
. The returnedWnck.Workspace
is owned by libwnck and must not be referenced or unreferenced.- Return type:
Gets the active
Wnck.Workspace
on self. May returnNone
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:
Gets the X window ID of the background pixmap of self.
- get_handle()¶
- Returns:
a
Wnck.Handle
, orNone
.- Return type:
Gets the handle.
- get_number()¶
- Returns:
the index of space on self, or -1 on errors.
- Return type:
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, orNone
. The returnedWnck.Window
is owned by libwnck and must not be referenced or unreferenced.- Return type:
Gets the previously active
Wnck.Window
on self. May returnNone
sometimes, since not all window managers guarantee that a window is always active.New in version 2.8.
- get_showing_desktop()¶
-
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_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:
Gets the name of the window manager.
New in version 2.20.
- get_windows()¶
- Returns:
the list of
Wnck.Window
on self, orNone
if there is no window on self. The list should not be modified nor freed, as it is owned by self.- Return type:
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, orNone
if there is no window on self. The list should not be modified nor freed, as it is owned by self.- Return type:
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, orNone
if no such workspace exists. The returnedWnck.Workspace
is owned by libwnck and must not be referenced or unreferenced.- Return type:
Gets the
Wnck.Workspace
numbered workspace on self.
- get_workspace_count()¶
- Returns:
the number of
Wnck.Workspace
on self.- Return type:
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:
Gets the list of
Wnck.Workspace
on self. The list is ordered: the first element in the list is the firstWnck.Workspace
, etc..New in version 2.20.
- move_viewport(x, y)¶
-
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:
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 returnFalse
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 throughWnck.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:
current_token (
int
) – a token. Use 0 if you do not calledWnck.Screen.try_set_workspace_layout
() before, or if you did not keep the old token.rows (
int
) – the number of rows to use for theWnck.Workspace
layout.columns (
int
) – the number of columns to use for theWnck.Workspace
layout.
- Returns:
a token to use for future calls to
Wnck.Screen.try_set_workspace_layout
() and toWnck.Screen.release_workspace_layout
(), or 0 if the layout could not be set.- Return type:
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 ofWnck.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:
- Parameters:
screen (
Wnck.Screen
) – The object which received the signalpreviously_active_window (
Wnck.Window
) – the previously activeWnck.Window
before this change.
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:
- Parameters:
screen (
Wnck.Screen
) – The object which received the signalpreviously_active_space (
Wnck.Workspace
) – the previously activeWnck.Workspace
before this change.
Emitted when the active workspace on screen has changed.
- Wnck.Screen.signals.application_closed(screen, app)¶
- Signal Name:
application-closed
- Flags:
- Parameters:
screen (
Wnck.Screen
) – The object which received the signalapp (
Wnck.Application
) – the closedWnck.Application
.
Emitted when a
Wnck.Application
is closed on screen.
- Wnck.Screen.signals.application_opened(screen, app)¶
- Signal Name:
application-opened
- Flags:
- Parameters:
screen (
Wnck.Screen
) – The object which received the signalapp (
Wnck.Application
) – the openedWnck.Application
.
Emitted when a new
Wnck.Application
is opened on screen.
- Wnck.Screen.signals.background_changed(screen)¶
- Signal Name:
background-changed
- Flags:
- 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:
- Parameters:
screen (
Wnck.Screen
) – The object which received the signalclass_group (
Wnck.ClassGroup
) – the closedWnck.ClassGroup
.
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:
- Parameters:
screen (
Wnck.Screen
) – The object which received the signalclass_group (
Wnck.ClassGroup
) – the openedWnck.ClassGroup
.
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:
- 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:
- 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 aWnck.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:
- Parameters:
screen (
Wnck.Screen
) – The object which received the signalwindow (
Wnck.Window
) – the closedWnck.Window
.
Emitted when a
Wnck.Window
is closed on screen.
- Wnck.Screen.signals.window_manager_changed(screen)¶
- Signal Name:
window-manager-changed
- Flags:
- 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:
- Parameters:
screen (
Wnck.Screen
) – The object which received the signalwindow (
Wnck.Window
) – the openedWnck.Window
.
Emitted when a new
Wnck.Window
is opened on screen.
- Wnck.Screen.signals.window_stacking_changed(screen)¶
- Signal Name:
window-stacking-changed
- Flags:
- 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:
- Parameters:
screen (
Wnck.Screen
) – The object which received the signalspace (
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:
- Parameters:
screen (
Wnck.Screen
) – The object which received the signalspace (
Wnck.Workspace
) – the workspace that has been destroyed.
Emitted when a
Wnck.Workspace
is destroyed on screen.