Wnck.Window

g GObject.Object GObject.Object Wnck.Window Wnck.Window GObject.Object->Wnck.Window

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class get (xwindow)
  activate (timestamp)
  activate_transient (timestamp)
  close (timestamp)
  get_actions ()
  get_application ()
  get_class_group ()
  get_class_group_name ()
  get_class_instance_name ()
  get_client_window_geometry ()
  get_geometry ()
  get_group_leader ()
  get_icon ()
  get_icon_is_fallback ()
  get_icon_name ()
  get_mini_icon ()
  get_name ()
  get_pid ()
  get_role ()
  get_screen ()
  get_session_id ()
  get_session_id_utf8 ()
  get_sort_order ()
  get_state ()
  get_transient ()
  get_window_type ()
  get_workspace ()
  get_xid ()
  has_icon_name ()
  has_name ()
  is_above ()
  is_active ()
  is_below ()
  is_fullscreen ()
  is_in_viewport (workspace)
  is_maximized ()
  is_maximized_horizontally ()
  is_maximized_vertically ()
  is_minimized ()
  is_most_recently_activated ()
  is_on_workspace (workspace)
  is_pinned ()
  is_shaded ()
  is_skip_pager ()
  is_skip_tasklist ()
  is_sticky ()
  is_visible_on_workspace (workspace)
  keyboard_move ()
  keyboard_size ()
  make_above ()
  make_below ()
  maximize ()
  maximize_horizontally ()
  maximize_vertically ()
  minimize ()
  move_to_workspace (space)
  needs_attention ()
  or_transient_needs_attention ()
  pin ()
  set_fullscreen (fullscreen)
  set_geometry (gravity, geometry_mask, x, y, width, height)
  set_icon_geometry (x, y, width, height)
  set_skip_pager (skip)
  set_skip_tasklist (skip)
  set_sort_order (order)
  set_window_type (wintype)
  shade ()
  stick ()
  transient_is_most_recently_activated ()
  unmake_above ()
  unmake_below ()
  unmaximize ()
  unmaximize_horizontally ()
  unmaximize_vertically ()
  unminimize (timestamp)
  unpin ()
  unshade ()
  unstick ()

Virtual Methods

Inherited:GObject.Object (7)
  do_actions_changed (changed_mask, new_actions)
  do_class_changed ()
  do_geometry_changed ()
  do_icon_changed ()
  do_name_changed ()
  do_role_changed ()
  do_state_changed (changed_mask, new_state)
  do_type_changed ()
  do_workspace_changed ()

Properties

None

Signals

Inherited:GObject.Object (1)
Name Short Description
actions-changed Emitted when the actions availabilities for window change.
class-changed Emitted when the class name or instance name of window changes.
geometry-changed Emitted when the geometry of window changes.
icon-changed Emitted when the icon of window changes.
name-changed Emitted when the name of window changes.
role-changed Emitted when the role of window changes.
state-changed Emitted when the state of window changes.
type-changed Emitted when the EWMH type hint of the window changes.
workspace-changed Emitted when the current workspace of window changes, or if window has been pinned or unpinned.

Fields

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

Class Details

class Wnck.Window(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:Wnck.WindowClass

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

classmethod get(xwindow)
Parameters:xwindow (int) – an X window ID.
Returns:the Wnck.Window for xwindow. The returned Wnck.Window is owned by libwnck and must not be referenced or unreferenced.
Return type:Wnck.Window

Gets a preexisting Wnck.Window for the X window xwindow. This will not create a Wnck.Window if none exists. The function is robust against bogus window IDs.

activate(timestamp)
Parameters:timestamp (int) – the X server timestamp of the user interaction event that caused this call to occur.

Asks the window manager to make self the active window. The window manager may choose to raise self along with focusing it, and may decide to refuse the request (to not steal the focus if there is a more recent user activity, for example).

This function existed before 2.10, but the timestamp argument was missing in earlier versions.

New in version 2.10.

activate_transient(timestamp)
Parameters:timestamp (int) – the X server timestamp of the user interaction event that caused this call to occur.

If self has transients, activates the most likely transient instead of the window itself. Otherwise activates self.

FIXME the ideal behavior of this function is probably to activate the most recently active window among self and its transients. This is probably best implemented on the window manager side.

This function existed before 2.10, but the timestamp argument was missing in earlier versions.

New in version 2.10.

close(timestamp)
Parameters:timestamp (int) – the X server timestamp of the user interaction event that caused this call to occur.

Closes self.

This function existed before 2.6, but the timestamp argument was missing in earlier versions.

New in version 2.6.

get_actions()
Returns:bitmask of actions that can be done for self.
Return type:Wnck.WindowActions

Gets the actions that can be done for self.

get_application()
Returns:the Wnck.Application to which self belongs. The returned Wnck.Application is owned by libwnck and must not be referenced or unreferenced.
Return type:Wnck.Application

Gets the Wnck.Application to which self belongs.

get_class_group()
Returns:the Wnck.ClassGroup to which self belongs. The returned Wnck.ClassGroup is owned by libwnck and must not be referenced or unreferenced.
Return type:Wnck.ClassGroup

Gets the Wnck.ClassGroup to which self belongs.

New in version 2.2.

get_class_group_name()
Returns:the class group name for self, or None if self belongs to no class group.
Return type:str

Gets the class group name from the <ulink url=”http://tronche.com/gui/x/icccm/sec-4.html&num;WM_CLASS”>WM_CLASS Property</ulink> for self.

The class group name is also the identifier name of the Wnck.ClassGroup to which self belongs.

get_class_instance_name()
Returns:the class instance name for self, or None if self has no class instance.
Return type:str

Gets the class instance name from the <ulink url=”http://tronche.com/gui/x/icccm/sec-4.html&num;WM_CLASS”>WM_CLASS Property</ulink> for self.

The class instance name allows to differentiate windows belonging to the same class group, so that they can use different resources.

get_client_window_geometry()
Returns:
xp:return location for X coordinate in pixels of self.
yp:return location for Y coordinate in pixels of self.
widthp:return location for width in pixels of self.
heightp:return location for height in pixels of self.
Return type:(xp: int, yp: int, widthp: int, heightp: int)

Gets the size and position of self, as last received in a ConfigureNotify event (i.e. this call does not round-trip to the server, just gets the last size we were notified of). The X and Y coordinates are relative to the root window.

The window manager usually adds a frame around windows. If you need to know the size of self with the frame, use Wnck.Window.get_geometry().

New in version 2.20.

get_geometry()
Returns:
xp:return location for X coordinate in pixels of self.
yp:return location for Y coordinate in pixels of self.
widthp:return location for width in pixels of self.
heightp:return location for height in pixels of self.
Return type:(xp: int, yp: int, widthp: int, heightp: int)

Gets the size and position of self, including decorations. This function uses the information last received in a ConfigureNotify event and adjusts it according to the size of the frame that is added by the window manager (this call does not round-trip to the server, it just gets the last sizes that were notified). The X and Y coordinates are relative to the root window.

If you need to know the actual size of self ignoring the frame added by the window manager, use Wnck.Window.get_client_window_geometry().

get_group_leader()
Returns:the group leader of the group of windows to which self belongs, or the X window ID of self if self does not belong to any group.
Return type:int

Gets the group leader of the group of windows to which self belongs.

get_icon()
Returns:the icon for self. The caller should reference the returned GdkPixbuf.Pixbuf if it needs to keep the icon around.
Return type:GdkPixbuf.Pixbuf

Gets the icon to be used for self. If no icon was found, a fallback icon is used. Wnck.Window.get_icon_is_fallback() can be used to tell if the icon is the fallback icon.

get_icon_is_fallback()
Returns:True if the icon for self is a fallback, False otherwise.
Return type:bool

Gets whether a default fallback icon is used for self (because none was set on self).

get_icon_name()
Returns:the icon name of self, or a fallback icon name if no icon name is available.
Return type:str

Gets the icon name of self, as it should be displayed for an icon (minimized state). Always returns some value, even if self has no icon name set; use Wnck.Window.has_icon_name() if you need to know whether the returned icon name is “real” or not.

Contrast with Wnck.Window.get_name(), which returns self ‘s title, not its icon title.

get_mini_icon()
Returns:the mini-icon for self. The caller should reference the returned GdkPixbuf.Pixbuf if it needs to keep the icon around.
Return type:GdkPixbuf.Pixbuf

Gets the mini-icon to be used for self. If no mini-icon was found, a fallback mini-icon is used. Wnck.Window.get_icon_is_fallback() can be used to tell if the mini-icon is the fallback mini-icon.

get_name()
Returns:the name of self, or a fallback name if no name is available.
Return type:str

Gets the name of self, as it should be displayed in a pager or tasklist. Always returns some value, even if self has no name set; use Wnck.Window.has_name() if you need to know whether the returned name is “real” or not.

For icons titles, use Wnck.Window.get_icon_name() instead.

get_pid()
Returns:the process ID of self, or 0 if none is available.
Return type:int

Gets the process ID of self.

get_role()
Returns:role for self, or None if self has no role.
Return type:str

Gets the role for self. The role uniquely identifies a window among all windows that have the same client leader window.

get_screen()
Returns:the Wnck.Screen self is on. The returned Wnck.Screen is owned by libwnck and must not be referenced or unreferenced.
Return type:Wnck.Screen

Gets the Wnck.Screen self is on.

get_session_id()
Returns:the session ID for self in Latin-1, or None if self has no session ID.
Return type:str

Gets the session ID for self in Latin-1 encoding. NOTE: this is invalid UTF-8. You can’t display this string in a GTK+ widget without converting to UTF-8. See Wnck.Window.get_session_id_utf8().

get_session_id_utf8()
Returns:the session ID for self in UTF-8, or None if self has no session ID.
Return type:str

Gets the session ID for self in UTF-8 encoding. The session ID should be in Latin-1 encoding, so the conversion should work, but a broken client could set a session ID that might not be convertable to UTF-8.

get_sort_order()
Returns:the sort order of self, or GObject.G_MAXINT if none is available.
Return type:int

Gets the sort order of self, used for ordering of self in Wnck.Selector and Wnck.Tasklist. The sort order is an internal state in libwnck. The initial value is defined when the window is created.

New in version 2.10.

get_state()
Returns:bitmask of active states for self.
Return type:Wnck.WindowState

Gets the state of self.

get_transient()
Returns:the Wnck.Window for which self is transient, or None if self is not transient for any Wnck.Window. The returned Wnck.Window is owned by libwnck and must not be referenced or unreferenced.
Return type:Wnck.Window

Gets the Wnck.Window for which self is transient.

New in version 2.12.

get_window_type()
Returns:the semantic type of self.
Return type:Wnck.WindowType

Gets the semantic type of self.

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

Gets the current workspace self is on. If the window is pinned (on all workspaces), or not on any workspaces, None may be returned.

get_xid()
Returns:the X window ID of self.
Return type:int

Gets the X window ID of self.

has_icon_name()
Returns:True if Wnck.Window.get_icon_name() returns self ‘s icon name, False if it returns a fallback name.
Return type:bool

Checks whether or not self has an icon name. Wnck.Window.get_icon_name() will always return some value, even if self has no icon name set; Wnck.Window.has_icon_name() can be used to tell if that icon name is real or not.

(Note that if Wnck.Window.has_icon_name() returns False, but Wnck.Window.has_name() returns True, then the name returned by Wnck.Window.get_icon_name() is self ‘s name. Only when both methods return False does Wnck.Window.get_icon_name() return a generic fallback name.)

New in version 2.16.

has_name()
Returns:True if Wnck.Window.get_name() returns self ‘s name, False if it returns a fallback name.
Return type:bool

Checks whether or not self has a name. Wnck.Window.get_name() will always return some value, even if self has no name set; Wnck.Window.has_name() can be used to tell if that name is real or not.

For icons titles, use Wnck.Window.has_icon_name() instead.

New in version 2.16.

is_above()
Returns:True if self is above other windows, False otherwise.
Return type:bool

Gets whether self is above other windows. This state may change anytime a Wnck.Window ::state-changed signal gets emitted.

See Wnck.Window.make_above() for more details on this state.

New in version 2.14.

is_active()
Returns:True if self is the active window on its Wnck.Screen, False otherwise.
Return type:bool

Gets whether self is the active window on its Wnck.Screen.

is_below()
Returns:True if self is below other windows, False otherwise.
Return type:bool

Gets whether self is below other windows. This state may change anytime a Wnck.Window ::state-changed signal gets emitted.

See Wnck.Window.make_below() for more details on this state.

New in version 2.20.

is_fullscreen()
Returns:True if self is fullscreen, False otherwise.
Return type:bool

Gets whether self is fullscreen. Fullscreen state may change anytime a Wnck.Window ::state-changed signal gets emitted.

New in version 2.8.

is_in_viewport(workspace)
Parameters:workspace (Wnck.Workspace) – a Wnck.Workspace.
Returns:True if self appears in current viewport of workspace, False otherwise.
Return type:bool

Gets True if self appears in the current viewport of workspace.

New in version 2.4.

is_maximized()
Returns:True if self is maximized in both directions, False otherwise.
Return type:bool

Gets whether self is maximized. Maximization state may change anytime a Wnck.Window ::state-changed signal gets emitted.

As for GDK, “maximized” means both vertically and horizontally. If self is maximized in only one direction, then self is not considered maximized.

is_maximized_horizontally()
Returns:True if self is maximized horizontally, False otherwise.
Return type:bool

Gets whether self is maximized horizontally. Horizontal maximization state may change anytime a Wnck.Window ::state-changed signal gets emitted.

is_maximized_vertically()
Returns:True if self is maximized vertically, False otherwise.
Return type:bool

Gets whether self is maximized vertically. vertiVal maximization state may change anytime a Wnck.Window ::state-changed signal gets emitted.

is_minimized()
Returns:True if self is minimized, False otherwise.
Return type:bool

Gets whether self is minimized. Minimization state may change anytime a Wnck.Window ::state-changed signal gets emitted.

is_most_recently_activated()
Returns:True if self was the most recently activated window on its Wnck.Screen, False otherwise.
Return type:bool

Gets whether self is the most recently activated window on its Wnck.Screen.

The most recently activated window is identical to the active window for click and sloppy focus methods (since a window is always active in those cases) but differs slightly for mouse focus since there often is no active window.

New in version 2.8.

is_on_workspace(workspace)
Parameters:workspace (Wnck.Workspace) – a Wnck.Workspace.
Returns:True if self appears on workspace, False otherwise.
Return type:bool

Gets whether self appears on workspace.

is_pinned()
Returns:True if self is on all workspaces, False otherwise.
Return type:bool

Gets whether self is on all workspace. Pinned state may change anytime a Wnck.Window ::workspace-changed signal gets emitted, but not when a Wnck.Window ::state-changed gets emitted.

is_shaded()
Returns:True if self is shaded, False otherwise.
Return type:bool

Gets whether self is shaded. Shade state may change anytime a Wnck.Window ::state-changed signal gets emitted.

is_skip_pager()
Returns:True if self is included on pagers, False otherwise.
Return type:bool

Gets whether self is included on pagers. This state may change anytime a Wnck.Window ::state-changed signal gets emitted.

is_skip_tasklist()
Returns:True if self is included on tasklists, False otherwise.
Return type:bool

Gets whether self is included on tasklists. This state may change anytime a Wnck.Window ::state-changed signal gets emitted.

is_sticky()
Returns:True if self is “stuck to the glass”, False otherwise.
Return type:bool

Gets whether self is sticky. Sticky state may change anytime a Wnck.Window ::state-changed signal gets emitted.

Sticky here means “stuck to the glass”, i.e. does not scroll with the viewport. In GDK/GTK+ (e.g. Gdk.Window.stick()/Gtk.Window.stick()), sticky means “stuck to the glass” and also that the window is on all workspaces. But here it only means the viewport aspect of it.

is_visible_on_workspace(workspace)
Parameters:workspace (Wnck.Workspace) – a Wnck.Workspace.
Returns:True if self appears on workspace in normal state, False otherwise.
Return type:bool

Like Wnck.Window.is_on_workspace(), but also checks that the window is in a visible state (i.e. not minimized or shaded).

keyboard_move()

Asks the window manager to start moving self via the keyboard.

keyboard_size()

Asks the window manager to start resizing self via the keyboard.

make_above()

Asks the window manager to put self on top of most windows (self will not be on top of focused fullscreen windows, of other windows with this setting and of dock windows).

New in version 2.14.

make_below()

Asks the window manager to put self below most windows.

New in version 2.20.

maximize()

Asks the window manager to maximize self.

maximize_horizontally()

Asks the window manager to maximize horizontally self.

maximize_vertically()

Asks the window manager to maximize vertically self.

minimize()

Minimizes self.

move_to_workspace(space)
Parameters:space (Wnck.Workspace) – a Wnck.Workspace.

Asks the window manager to move self to space. If self was pinned, it will also result in self being visible only on space.

needs_attention()
Returns:True if self needs attention, False otherwise.
Return type:bool

Gets whether self needs attention. This state may change anytime a Wnck.Window ::state-changed signal gets emitted.

This state depends on flags such as the demands_attention and is_urgent hints.

New in version 2.12.

or_transient_needs_attention()
Returns:True if self or one of its transients needs attention, False otherwise.
Return type:bool

Gets whether self or one of its transients needs attention. This state may change anytime a Wnck.Window ::state-changed signal gets emitted.

New in version 2.12.

pin()

Asks the window manager to put self on all workspaces.

set_fullscreen(fullscreen)
Parameters:fullscreen (bool) – whether to make self fullscreen.

Asks the window manager to set the fullscreen state of self according to fullscreen.

New in version 2.8.

set_geometry(gravity, geometry_mask, x, y, width, height)
Parameters:
  • gravity (Wnck.WindowGravity) – the gravity point to use as a reference for the new position.
  • geometry_mask (Wnck.WindowMoveResizeMask) – a bitmask containing flags for what should be set.
  • x (int) – new X coordinate in pixels of self.
  • y (int) – new Y coordinate in pixels of self.
  • width (int) – new width in pixels of self.
  • height (int) – new height in pixels of self.

Sets the size and position of self. The X and Y coordinates should be relative to the root window.

Note that the new size and position apply to self with its frame added by the window manager. Therefore, using Wnck.Window.set_geometry() with the values returned by Wnck.Window.get_geometry() should be a no-op, while using Wnck.Window.set_geometry() with the values returned by Wnck.Window.get_client_window_geometry() should reduce the size of self and move it.

New in version 2.16.

set_icon_geometry(x, y, width, height)
Parameters:
  • x (int) – X coordinate in pixels.
  • y (int) – Y coordinate in pixels.
  • width (int) – width in pixels.
  • height (int) – height in pixels.

Sets the icon geometry for self. A typical use case for this is the destination of the minimization animation of self.

set_skip_pager(skip)
Parameters:skip (bool) – whether self should be included on pagers.

Asks the window manager to make self included or not included on pagers.

set_skip_tasklist(skip)
Parameters:skip (bool) – whether self should be included on tasklists.

Asks the window manager to make self included or not included on tasklists.

set_sort_order(order)
Parameters:order (int) – new sort order for self.

Sets the sort order of self. The sort order is used for ordering of self in Wnck.Selector and Wnck.Tasklist.

New in version 2.20.

set_window_type(wintype)
Parameters:wintype (Wnck.WindowType) – a semantic type.

Sets the semantic type of self to wintype.

New in version 2.12.

shade()

Asks the window manager to shade self.

stick()

Asks the window manager to keep the self ‘s position fixed on the screen, even when the workspace or viewport scrolls.

transient_is_most_recently_activated()
Returns:True if one of the transients of self is the most recently activated window, False otherwise.
Return type:bool

Gets whether one of the transients of self is the most recently activated window. See Wnck.Window.is_most_recently_activated() for a more complete description of what is meant by most recently activated. This function is needed because clicking on a Wnck.Tasklist once will activate a transient instead of self itself (Wnck.Window.activate_transient), and clicking again should minimize self and its transients. (Not doing this can be especially annoying in the case of modal dialogs that don’t appear in the Wnck.Tasklist).

New in version 2.12.

unmake_above()

Asks the window manager to not put self on top of most windows, and to put it again in the stack with other windows.

New in version 2.14.

unmake_below()

Asks the window manager to not put self below most windows, and to put it again in the stack with other windows.

New in version 2.20.

unmaximize()

Asks the window manager to unmaximize self.

unmaximize_horizontally()

Asks the window manager to unmaximize horizontally self.

unmaximize_vertically()

Asks the window manager to unmaximize vertically self.

unminimize(timestamp)
Parameters:timestamp (int) – the X server timestamp of the user interaction event that caused this call to occur.

Unminimizes self by activating it or one of its transients. See Wnck.Window.activate_transient() for details on how the activation is done.

unpin()

Asks the window manager to put self only in the currently active workspace, if self was previously pinned. If self was not pinned, does not change self ‘s workspace. If the active workspace is not known for some reason (it should not happen much), sets self ‘s workspace to the first workspace.

unshade()

Asks the window manager to unshade self.

unstick()

Asks the window manager to not have self ‘s position fixed on the screen when the workspace or viewport scrolls.

do_actions_changed(changed_mask, new_actions) virtual
Parameters:
do_class_changed() virtual
do_geometry_changed() virtual
do_icon_changed() virtual
do_name_changed() virtual
do_role_changed() virtual
do_state_changed(changed_mask, new_state) virtual
Parameters:
do_type_changed() virtual
do_workspace_changed() virtual

Signal Details

Wnck.Window.signals.actions_changed(window, changed_mask, new_state)
Signal Name:

actions-changed

Flags:

RUN_LAST

Parameters:
  • window (Wnck.Window) – The object which received the signal
  • changed_mask (Wnck.WindowActions) – the bitmask containing bits set for all actions availabilities for window that have changed.
  • new_state (Wnck.WindowActions) – the new actions availabilities for window.

Emitted when the actions availabilities for window change.

Wnck.Window.signals.class_changed(window)
Signal Name:class-changed
Flags:RUN_LAST
Parameters:window (Wnck.Window) – The object which received the signal

Emitted when the class name or instance name of window changes.

Wnck.Window.signals.geometry_changed(window)
Signal Name:geometry-changed
Flags:RUN_LAST
Parameters:window (Wnck.Window) – The object which received the signal

Emitted when the geometry of window changes.

Wnck.Window.signals.icon_changed(window)
Signal Name:icon-changed
Flags:RUN_LAST
Parameters:window (Wnck.Window) – The object which received the signal

Emitted when the icon of window changes.

Wnck.Window.signals.name_changed(window)
Signal Name:name-changed
Flags:RUN_LAST
Parameters:window (Wnck.Window) – The object which received the signal

Emitted when the name of window changes.

Wnck.Window.signals.role_changed(window)
Signal Name:role-changed
Flags:RUN_LAST
Parameters:window (Wnck.Window) – The object which received the signal

Emitted when the role of window changes.

Wnck.Window.signals.state_changed(window, changed_mask, new_state)
Signal Name:

state-changed

Flags:

RUN_LAST

Parameters:
  • window (Wnck.Window) – The object which received the signal
  • changed_mask (Wnck.WindowState) – the bitmask containing bits set for all states of window that have changed.
  • new_state (Wnck.WindowState) – the new state of window.

Emitted when the state of window changes. This can happen when window is (un)minimized, (un)maximized, (un)sticked, (un)shaded, (un)made above, (un)made below, (un)set fullscreen, when it needs attention, etc. See Wnck.WindowState for the complete list of states that might have changed.

Wnck.Window.signals.type_changed(window)
Signal Name:type-changed
Flags:RUN_LAST
Parameters:window (Wnck.Window) – The object which received the signal

Emitted when the EWMH type hint of the window changes.

New in version 3.20.

Wnck.Window.signals.workspace_changed(window)
Signal Name:workspace-changed
Flags:RUN_LAST
Parameters:window (Wnck.Window) – The object which received the signal

Emitted when the current workspace of window changes, or if window has been pinned or unpinned.