KDE 4.5 PyKDE API Reference

- KDE's Python API

# NETWinInfo Class Reference

`from PyKDE4.kdeui import *`

Inherits: NET

## Detailed Description

Common API for application window properties/protocols.

The NETWinInfo class provides a common API for clients and window managers to set/read/change properties on an application window as defined by the NET Window Manager Specification.

Author:
  Bradley T. Hughes <bhughes@trolltech.com>

See also:
  NET

See also:
  NETRootInfo

See also:
  http://www.freedesktop.org/standards/wm-spec/

## Enumerations
<anonymous> | { PROTOCOLS, PROTOCOLS2, PROPERTIES_SIZE }
## Attributes
int | OnAllDesktops
## Methods
| __init__ (self, Display display, long window, long rootWindow, SIP_PYLIST properties, NET.Role role=NET.Client)
| __init__ (self, Display display, long window, long rootWindow, long properties, NET.Role role=NET.Client)
| __init__ (self, NETWinInfo wininfo)
long | allowedActions (self)
| changeDesktop (self, int desktop)
| changeState (self, long state, long mask)
QString | clientMachine (self)
int | desktop (self, bool ignore_viewport=0)
NETExtendedStrut | extendedStrut (self)
NETStrut | frameOverlap (self)
long | groupLeader (self)
bool | handledIcons (self)
bool | hasNETSupport (self)
bool | hasWindowType (self)
NETRect | iconGeometry (self)
QString | iconName (self)
| kdeGeometry (self, NETRect frame, NETRect window)
NET.MappingState | mappingState (self)
QString | name (self)
long | opacity (self)
int | pid (self)
| setAllowedActions (self, long actions)
| setDesktop (self, int desktop, bool ignore_viewport=0)
| setExtendedStrut (self, NETExtendedStrut extended_strut)
| setFrameExtents (self, NETStrut strut)
| setFrameOverlap (self, NETStrut strut)
| setHandledIcons (self, bool handled)
| setIconGeometry (self, NETRect geometry)
| setIconName (self, QString name)
| setName (self, QString name)
| setOpacity (self, long opacity)
| setPid (self, int pid)
| setStartupId (self, QString startup_id)
| setState (self, long state, long mask)
| setStrut (self, NETStrut strut)
| setUserTime (self, long time)
| setVisibleIconName (self, QString name)
| setVisibleName (self, QString visibleName)
| setWindowType (self, NET.WindowType type)
QString | startupId (self)
long | state (self)
NETStrut | strut (self)
long | transientFor (self)
long | userTime (self)
QString | visibleIconName (self)
QString | visibleName (self)
QString | windowClassClass (self)
QString | windowClassName (self)
QString | windowRole (self)
NET.WindowType | windowType (self, long supported_types)

## Method Documentation

__init__ | ( | self, |
|  | Display | display,
|  | long | window,
|  | long | rootWindow,
|  | SIP_PYLIST | properties,
|  | NET.Role | role=NET.Client
| ) |  |  |

This constructor differs from the above one only in the way it accepts the list of properties the client is interested in. The properties argument is equivalent to the first element of the properties array in the above constructor.

__init__ | ( | self, |
|  | Display | display,
|  | long | window,
|  | long | rootWindow,
|  | long | properties,
|  | NET.Role | role=NET.Client
| ) |  |  |

This constructor differs from the above one only in the way it accepts the list of properties the client is interested in. The properties argument is equivalent to the first element of the properties array in the above constructor.

__init__ | ( | self, |
|  | NETWinInfo | wininfo
| ) |  |  |

Creates a shared copy of the specified NETWinInfo object.

Parameters:

  | wininfo | the NETWinInfo to copy

long allowedActions | ( |  | self ) |

Returns actions that the window manager allows for the window.

changeDesktop | ( | self, |
|  | int | desktop
| ) |  |  |

A Window Manager should subclass NETWinInfo and reimplement this function when it wants to know when a Client made a request to change desktops (ie. move to another desktop).

Parameters:

  | desktop | the number of the desktop

changeState | ( | self, |
|  | long | state,
|  | long | mask
| ) |  |  |

A Window Manager should subclass NETWinInfo and reimplement this function when it wants to know when a Client made a request to change state (ie. to Shade / Unshade).

Parameters:

  | state | the new state
  | mask | the mask for the state

QString clientMachine | ( |  | self ) |

Returns the client machine for the window (i.e. WM_CLIENT_MACHINE property).

int desktop | ( | self, |
|  | bool | ignore_viewport=0
| ) |  |  |

Returns the desktop where the window is residing.

NOTE: KDE uses virtual desktops and does not directly support viewport in any way. It is however mapped to virtual desktops if needed.

Parameters:

  | ignore_viewport | if false, viewport is mapped to virtual desktops

Returns:
  the number of the window's desktop

See also:
  OnAllDesktops()

NETExtendedStrut extendedStrut | ( |  | self ) |

Returns the extended (partial) strut specified by this client. See _NET_WM_STRUT_PARTIAL in the spec.

NETStrut frameOverlap | ( |  | self ) |

Returns the frame overlap strut, i.e. how far the window frame extends behind the client area on each side.

Since:
  4.4

long groupLeader | ( |  | self ) |

Returns the leader window for the group the window is in, if any.

bool handledIcons | ( |  | self ) |

Returns whether or not this client handles icons.

Returns:
  true if this client handles icons, false otherwise

bool hasNETSupport | ( |  | self ) |

Returns true if the window has any window type set, even if the type itself is not known to this implementation. Presence of a window type as specified by the NETWM spec is considered as the window supporting this specification.

Returns:
  true if the window has support for the NETWM spec

bool hasWindowType | ( |  | self ) |

This function returns false if the window has not window type specified at all. Used by KWindowInfo.windowType() to return either NET.Normal or NET.Dialog as appropriate as a fallback.

NETRect iconGeometry | ( |  | self ) |

Returns the icon geometry.

Returns:
  the geometry of the icon

QString iconName | ( |  | self ) |

Returns the iconic name of the window in UTF-8 format. Note that this has nothing to do with icons, but it's for "iconic" representations of the window (taskbars etc.), that should be shown when the window is in iconic state. See description of _NET_WM_ICON_NAME for details.

Returns:
  the iconic name

kdeGeometry | ( | self, |
|  | NETRect | frame,
|  | NETRect | window
| ) |  |  |

Places the window frame geometry in frame, and the application window geometry in window. Both geometries are relative to the root window.

Parameters:

  | frame | the geometry for the frame
  | window | the geometry for the window

NET.MappingState mappingState | ( |  | self ) |

Returns the mapping state for the window (see the NET base class documentation for a description of mapping state).

Returns:
  the mapping state

QString name | ( |  | self ) |

Returns the name of the window in UTF-8 format.

Returns:
  the name of the window

long opacity | ( |  | self ) |

Returns the opacity of the window.

int pid | ( |  | self ) |

Returns the process id for the client window.

Returns:
  the process id of the window

setAllowedActions | ( | self, |
|  | long | actions
| ) |  |  |

Sets actions that the window manager allows for the window.

setDesktop | ( | self, |
|  | int | desktop,
|  | bool | ignore_viewport=0
| ) |  |  |

Set which window the desktop is (should be) on.

NOTE: KDE uses virtual desktops and does not directly support viewport in any way. It is however mapped to virtual desktops if needed.

Parameters:

  | desktop | the number of the new desktop
  | ignore_viewport | if false, viewport is mapped to virtual desktops

See also:
  OnAllDesktops()

setExtendedStrut | ( | self, |
|  | NETExtendedStrut | extended_strut
| ) |  |  |

Set the extended (partial) strut for the application window.

Parameters:

  | extended_strut | the new strut

setFrameExtents | ( | self, |
|  | NETStrut | strut
| ) |  |  |

Set the frame decoration strut, i.e. the width of the decoration borders.

Parameters:

  | strut | the new strut

setFrameOverlap | ( | self, |
|  | NETStrut | strut
| ) |  |  |

Sets the window frame overlap strut, i.e. how far the window frame extends behind the client area on each side.

Set the strut values to -1 if you want the window frame to cover the whole client area.

The default values are 0.

Since:
  4.4

setHandledIcons | ( | self, |
|  | bool | handled
| ) |  |  |

Set whether this application window handles icons.

Parameters:

  | handled | true if the window handles icons, false otherwise

setIconGeometry | ( | self, |
|  | NETRect | geometry
| ) |  |  |

Set the icon geometry for the application window.

Parameters:

  | geometry | the new icon geometry

setIconName | ( | self, |
|  | QString | name
| ) |  |  |

Sets the iconic name for the application window.

Parameters:

  | name | the new iconic name

setName | ( | self, |
|  | QString | name
| ) |  |  |

Sets the name for the application window.

Parameters:

  | name | the new name of the window

setOpacity | ( | self, |
|  | long | opacity
| ) |  |  |

Sets opacity (0 = transparent, 0xffffffff = opaque ) on the window.

setPid | ( | self, |
|  | int | pid
| ) |  |  |

Set the application window's process id.

Parameters:

  | pid | the window's process id

setStartupId | ( | self, |
|  | QString | startup_id
| ) |  |  |

Sets the startup notification id id on the window.

setState | ( | self, |
|  | long | state,
|  | long | mask
| ) |  |  |

Set the state for the application window (see the NET base class documentation for a description of window state).

Parameters:

  | state | the name state
  | mask | the mask for the state

setStrut | ( | self, |
|  | NETStrut | strut
| ) |  |  |

Deprecated:
  use setExtendedStrut() Set the strut for the application window.

Parameters:

  | strut | the new strut

setUserTime | ( | self, |
|  | long | time
| ) |  |  |

Sets user timestamp time on the window (property _NET_WM_USER_TIME). The timestamp is expressed as XServer time. If a window is shown with user timestamp older than the time of the last user action, it won't be activated after being shown, with the special value 0 meaning not to activate the window after being shown.

setVisibleIconName | ( | self, |
|  | QString | name
| ) |  |  |

For Window Managers only: set the visible iconic name ( i.e. xterm, xterm <2>, xterm <3>, ... )

Parameters:

  | name | the new visible iconic name

setVisibleName | ( | self, |
|  | QString | visibleName
| ) |  |  |

For Window Managers only: set the visible name ( i.e. xterm, xterm <2>, xterm <3>, ... )

Parameters:

  | visibleName | the new visible name

setWindowType | ( | self, |
|  | NET.WindowType | type
| ) |  |  |

Sets the window type for this client (see the NET base class documentation for a description of the various window types).

Parameters:

  | type | the window type

QString startupId | ( |  | self ) |

Returns the startup notification id of the window.

long state | ( |  | self ) |

Returns the state of the window (see the NET base class documentation for a description of the various states).

Returns:
  the state of the window

NETStrut strut | ( |  | self ) |

Deprecated:
  use strutPartial() Returns the strut specified by this client.

Returns:
  the strut of the window

long transientFor | ( |  | self ) |

Returns the WM_TRANSIENT_FOR property for the window, i.e. the mainwindow for this window.

long userTime | ( |  | self ) |

Returns the time of last user action on the window, or -1 if not set.

QString visibleIconName | ( |  | self ) |

Returns the visible iconic name as set by the window manager in UTF-8 format. Note that this has nothing to do with icons, but it's for "iconic" representations of the window (taskbars etc.), that should be shown when the window is in iconic state. See description of _NET_WM_VISIBLE_ICON_NAME for details.

Returns:
  the visible iconic name

QString visibleName | ( |  | self ) |

Returns the visible name as set by the window manager in UTF-8 format.

Returns:
  the visible name of the window

QString windowClassClass | ( |  | self ) |

Returns the class component of the window class for the window (i.e. WM_CLASS property).

QString windowClassName | ( |  | self ) |

Returns the name component of the window class for the window (i.e. WM_CLASS property).

QString windowRole | ( |  | self ) |

Returns the window role for the window (i.e. WM_WINDOW_ROLE property).

NET.WindowType windowType | ( | self, |
|  | long | supported_types
| ) |  |  |

Returns the window type for this client (see the NET base class documentation for a description of the various window types). Since clients may specify several windows types for a window in order to support backwards compatibility and extensions not available in the NETWM spec, you should specify all window types you application supports (see the NET.WindowTypeMask mask values for various window types). This method will return the first window type that is listed in the supported types, or NET.Unknown if none of the window types is supported.

Returns:
  the type of the window

## Attribute Documentation

int OnAllDesktops

## Enumeration Documentation

anonymous

Indexes for the properties array.

Enumerator:

  PROTOCOLS |
  PROTOCOLS2 |
  PROPERTIES_SIZE |