# class NETRootInfo

###

Module | kdeui
Namespace |
Class | NETRootInfo
Inherits | NET

Common API for root window properties/protocols.

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

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

See also NET

See also NETWinInfo

### enums

- anonymous { PROTOCOLS, WINDOW_TYPES, STATES, PROTOCOLS2, ACTIONS, PROPERTIES_SIZE }

enum details

### methods

- NETRootInfo (a0, a1, a2, a3, a4, a5)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  a0 | Display |
  a1 | Window |
  a2 | char |
  a3 | SIP_PYLIST |
  a4 | int | -1
  a5 | bool | 1

  Window Managers should use this constructor to create a NETRootInfo object, which will be used to set/update information stored on the rootWindow. The application role is automatically set to WindowManager when using this constructor.

  display - An X11 Display struct.

  supportWindow - The Window id of the supportWindow. The supportWindow must be created by the window manager as a child of the rootWindow. The supportWindow must not be destroyed until the Window Manager exits.

  wmName - A string which should be the window manager's name (ie. "KWin" or "Blackbox").

  properties - An array of elements listing all properties and protocols the window manager supports. The elements contain OR'ed values of constants from the NET base class, in the following order: [0]= NET.Property, [1]= NET.WindowTypeMask (not NET.WindowType!), [2]= NET.State, [3]= NET.Property2, [4]= NET.Action. In future versions, the list may be extended. In case you pass less elements, the missing ones will be replaced with default values.

  properties_size - The number of elements in the properties array.

  screen - For Window Managers that support multiple screen (ie. "multiheaded") displays, the screen number may be explicitly defined. If this argument is omitted, the default screen will be used.

  doActivate - true to activate the window

- NETRootInfo (a0, a1, a2, a3)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  a0 | Display |
  a1 | SIP_PYLIST |
  a2 | int | -1
  a3 | bool | 1

  Clients should use this constructor to create a NETRootInfo object, which will be used to query information set on the root window. The application role is automatically set to Client when using this constructor.

  display - An X11 Display struct.

  properties - An array of elements listing all protocols the client is interested in. The elements contain OR'ed values of constants from the NET base class, in the following order: [0]= NET.Property, [1]= NET.Property2.

  properties_size - The number of elements in the properties array.

  screen - For Clients that support multiple screen (ie. "multiheaded") displays, the screen number may be explicitly defined. If this argument is omitted, the default screen will be used.

  doActivate - true to activate the window

- NETRootInfo (display, properties, screen, doActivate)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  display | Display |
  properties | unsigned long |
  screen | int | -1
  doActivate | bool | 1

  This constructor differs from the above one only in the way it accepts the list of supported properties. The properties argument is equivalent to the first element of the properties array in the above constructor, and therefore you cannot read all root window properties using it.

- NETRootInfo (rootinfo)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  rootinfo | NETRootInfo |

  Creates a shared copy of the specified NETRootInfo object.

  rootinfo - the NETRootInfo object to copy

- activate ( )

  returns Nothing

  Window Managers must call this after creating the NETRootInfo object, and before using any other method in the class. This method sets initial data on the root window and does other post-construction duties.

  Clients must also call this after creating the object to do an initial data read/update.

- activeWindow ( )

  returns Window

  Returns the active (focused) window.

  Returns the id of the active window

- addClient (window)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |

  A Client should subclass NETRootInfo and reimplement this function when it wants to know when a window has been added.

  window - the id of the window to add

- changeActiveWindow (window, src, timestamp, active_window)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  src | NET.RequestSource |
  timestamp | Time |
  active_window | Window |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when a Client made a request to change the active (focused) window.

  window - the id of the window to activate

  src - the source from which the request came

  timestamp - the timestamp of the user action causing this request

  active_window - active window of the requesting application, if any

- changeCurrentDesktop (desktop)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  desktop | int |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when a Client made a request to change the current desktop.

  desktop - the number of the desktop

- changeDesktopGeometry (desktop, geom)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  desktop | int |
  geom | NETSize |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when a Client made a request to change the specified desktop geometry.

  desktop - the number of the desktop

  geom - the new size

- changeDesktopViewport (desktop, viewport)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  desktop | int |
  viewport | NETPoint |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when a Client made a request to change the specified desktop viewport.

  desktop - the number of the desktop

  viewport - the new position of the viewport

- changeNumberOfDesktops (numberOfDesktops)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  numberOfDesktops | int |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when a Client made a request to change the number of desktops.

  numberOfDesktops - the new number of desktops

- changeShowingDesktop (showing)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  showing | bool |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when a pager made a request to change showing the desktop. See _NET_SHOWING_DESKTOP for details.

  showing - whether to activate the showing desktop mode

- clientList ( )

  returns Window
  Not implemented

  Returns an array of Window id's, which contain all managed windows.

  Returns the array of Window id's

  See also clientListCount()

- clientListCount ( )

  returns int

  Returns the number of managed windows in clientList array.

  Returns the number of managed windows in the clientList array

  See also clientList()

- clientListStacking ( )

  returns Window
  Not implemented

  Returns an array of Window id's, which contain all managed windows in stacking order.

  Returns the array of Window id's in stacking order

  See also clientListStackingCount()

- clientListStackingCount ( )

  returns int

  Returns the number of managed windows in the clientListStacking array.

  Returns the number of Window id's in the client list

  See also clientListStacking()

- closeWindow (window)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when a Client made a request to close a window.

  window - the id of the window to close

- closeWindowRequest (window)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |

  Clients (such as pagers/taskbars) that wish to close a window should call this function. This will send a request to the Window Manager, which usually can usually decide how to react to such requests.

  window - the id of the window to close

- currentDesktop (ignore_viewport)

  returns int

  Argument | Type | Default
  --- | --- | ---
  ignore_viewport | bool | 0

  Returns the current desktop.

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

  ignore_viewport - if false, viewport is mapped to virtual desktops

  Returns the number of the current desktop

- desktopGeometry (desktop)

  returns NETSize

  Argument | Type | Default
  --- | --- | ---
  desktop | int |

  Returns the desktop geometry size.

  The desktop argument is ignored. Early drafts of the NET WM Specification were unclear about the semantics of this property.

  NOTE: KDE uses virtual desktops and does not directly support viewport in any way. You should use calls for virtual desktops, viewport is mapped to them if needed.

  desktop - the number of the desktop

  Returns the size of the desktop

- desktopLayoutColumnsRows ( )

  returns QSize

  Returns the desktop layout number of columns and rows. Note that either may be 0 (see _NET_DESKTOP_LAYOUT).

- desktopLayoutCorner ( )

  returns NET.DesktopLayoutCorner

  Returns the desktop layout starting corner.

- desktopLayoutOrientation ( )

  returns NET.Orientation

  Returns the desktop layout orientation.

- desktopName (desktop)

  returns char

  Argument | Type | Default
  --- | --- | ---
  desktop | int |

  Returns the name for the specified desktop.

  desktop - the number of the desktop

  Returns the name of the desktop

- desktopViewport (desktop)

  returns NETPoint

  Argument | Type | Default
  --- | --- | ---
  desktop | int |

  Returns the viewport of the specified desktop.

  NOTE: KDE uses virtual desktops and does not directly support viewport in any way. You should use calls for virtual desktops, viewport is mapped to them if needed.

  desktop - the number of the desktop

  Returns the position of the desktop's viewport

- event (event, properties, properties_size)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  event | XEvent |
  properties | unsigned long |
  properties_size | int |

  This function takes the passed XEvent and returns an OR'ed list of NETRootInfo properties that have changed in the properties argument. The new information will be read immediately by the class. The elements of the properties argument are as they would be passed to the constructor, if the array is not large enough, changed properties that don't fit in it won't be listed there (they'll be updated in the class though).

  event - the event

  properties - properties that changed

  properties_size - size of the passed properties array

- event (event)

  returns unsigned long
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  event | XEvent |

  This function takes the passed XEvent and returns an OR'ed list of NETRootInfo properties that have changed. The new information will be read immediately by the class. This overloaded version returns only a single mask, and therefore cannot check state of all properties like the other variant.

  event - the event

  Returns the properties

- gotPing (window, timestamp)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  timestamp | Time |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to receive replies to the _NET_WM_PING protocol.

  window - the window from which the reply came

  timestamp - timestamp of the ping

- gotTakeActivity (window, timestamp, flags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  timestamp | Time |
  flags | long |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to receive replies to the _NET_WM_TAKE_ACTIVITY protocol.

  window - the window from which the reply came

  timestamp - timestamp of the ping

  flags - flags passed in the original message

- isSupported (property)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  property | NET.Property |

  Returns true if the given property is supported by the window manager. Note that for Client mode, NET.Supported needs to be passed in the properties argument for this to work.

- isSupported (property)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  property | NET.Property2 |

- isSupported (type)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  type | NET.WindowType |

- isSupported (state)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  state | NET.State |

- isSupported (action)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  action | NET.Action |

- moveResize (window, x_root, y_root, direction)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  x_root | int |
  y_root | int |
  direction | unsigned long |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when a Client made a request to start a move/resize.

  window - The window that wants to move/resize

  x_root - X position of the cursor relative to the root window.

  y_root - Y position of the cursor relative to the root window.

  direction - One of NET.Direction (see base class documentation for a description of the different directions).

- moveResizeRequest (window, x_root, y_root, direction)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  x_root | int |
  y_root | int |
  direction | NET.Direction |

  Clients (such as pagers/taskbars) that wish to start a WMMoveResize (where the window manager controls the resize/movement, i.e. _NET_WM_MOVERESIZE) should call this function. This will send a request to the Window Manager.

  window - The client window that would be resized/moved.

  x_root - X position of the cursor relative to the root window.

  y_root - Y position of the cursor relative to the root window.

  direction - One of NET.Direction (see base class documentation for a description of the different directions).

- moveResizeWindow (window, flags, x, y, width, height)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  flags | int |
  x | int |
  y | int |
  width | int |
  height | int |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when a pager made a request to move/resize a window. See _NET_MOVERESIZE_WINDOW for details.

  window - the id of the window to more/resize

  flags - Flags specifying the operation (see _NET_MOVERESIZE_WINDOW description)

  x - Requested X position for the window

  y - Requested Y position for the window

  width - Requested width for the window

  height - Requested height for the window

- moveResizeWindowRequest (window, flags, x, y, width, height)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  flags | int |
  x | int |
  y | int |
  width | int |
  height | int |

  Clients (such as pagers/taskbars) that wish to move/resize a window using WM2MoveResizeWindow (_NET_MOVERESIZE_WINDOW) should call this function. This will send a request to the Window Manager. See _NET_MOVERESIZE_WINDOW description for details.

  window - The client window that would be resized/moved.

  flags - Flags specifying the operation (see _NET_MOVERESIZE_WINDOW description)

  x - Requested X position for the window

  y - Requested Y position for the window

  width - Requested width for the window

  height - Requested height for the window

- numberOfDesktops (ignore_viewport)

  returns int

  Argument | Type | Default
  --- | --- | ---
  ignore_viewport | bool | 0

  Returns the number of desktops.

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

  ignore_viewport - if false, viewport is mapped to virtual desktops

  Returns the number of desktops

- passedProperties ( )

  returns unsigned long
  KDE 4.1.0 and later only

  Returns the properties argument passed to the constructor. The size is the maximum array size the constructor accepts.

- passedProperties ( )

  returns SIP_PYLIST
  before KDE 4.1.0 only

- passedProperties ( )

  returns SIP_PYLIST
  before KDE 4.1.0 only

- removeClient (window)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |

  A Client should subclass NETRootInfo and reimplement this function when it wants to know when a window has been removed.

  window - the id of the window to remove

- restackRequest (window, source, above, detail, timestamp)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  source | NET.RequestSource |
  above | Window |
  detail | int |
  timestamp | Time |

  Sends the _NET_RESTACK_WINDOW request.

- restackWindow (window, source, above, detail, timestamp)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  source | NET.RequestSource |
  above | Window |
  detail | int |
  timestamp | Time |

  A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when a Client made a request to restack a window. See _NET_RESTACK_WINDOW for details.

  window - the id of the window to restack

  source - the source of the request

  above - other window in the restack request

  detail - restack detail

  timestamp - the timestamp of the request

- rootWindow ( )

  returns Window

  Returns the Window id of the rootWindow.

  Returns the id of the root window

- screenNumber ( )

  returns int

  Returns the screenNumber.

  Returns the screen number

- sendPing (window, timestamp)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  timestamp | Time |

  Sends a ping with the given timestamp to the window, using the _NET_WM_PING protocol.

- setActiveWindow (window, src, timestamp, active_window)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  src | NET.RequestSource |
  timestamp | Time |
  active_window | Window |

  Requests that the specified window becomes the active (focused) one.

  window - the id of the new active window

  src - whether the request comes from normal application or from a pager or similar tool

  timestamp - X server timestamp of the user action that caused the request

  active_window - active window of the requesting application, if any

- setActiveWindow (window)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |

  Sets the active (focused) window the specified window. This should be used only in the window manager mode.

  window - the if of the new active window

- setClientList (windows, count)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  windows | Window |
  count | unsigned int |

  Sets the list of managed windows on the Root/Desktop window.

  windows - The array of Window id's

  count - The number of windows in the array

- setClientListStacking (windows, count)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  windows | Window |
  count | unsigned int |

  Sets the list of managed windows in stacking order on the Root/Desktop window.

  windows - The array of Window id's

  count - The number of windows in the array.

- setCurrentDesktop (desktop, ignore_viewport)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  desktop | int |
  ignore_viewport | bool | 0

  Sets the current desktop to the specified desktop.

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

  desktop - the number of the desktop

  ignore_viewport - if false, viewport is mapped to virtual desktops

- setDesktopGeometry (desktop, geometry)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  desktop | int |
  geometry | NETSize |

  Sets the desktop geometry to the specified geometry.

  The desktop argument is ignored. Early drafts of the NET WM Specification were unclear about the semantics of this property.

  NOTE: KDE uses virtual desktops and does not directly support viewport in any way. You should use calls for virtual desktops, viewport is mapped to them if needed.

  desktop - the number of the desktop

  geometry - the new size of the desktop

- setDesktopLayout (orientation, columns, rows, corner)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  orientation | NET.Orientation |
  columns | int |
  rows | int |
  corner | NET.DesktopLayoutCorner |

  Sets the desktop layout. This is set by the pager. When setting, the pager must own the _NET_DESKTOP_LAYOUT_Sn manager selection. See _NET_DESKTOP_LAYOUT for details.

- setDesktopName (desktop, desktopName)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  desktop | int |
  desktopName | char |

  Sets the name of the specified desktop.

  NOTE: KDE uses virtual desktops and does not directly support viewport in any way. Viewport is mapped to virtual desktops if needed, but not for this call.

  desktop - the number of the desktop

  desktopName - the new name of the desktop

- setDesktopViewport (desktop, viewport)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  desktop | int |
  viewport | NETPoint |

  Sets the viewport for the current desktop to the specified point.

  NOTE: KDE uses virtual desktops and does not directly support viewport in any way. You should use calls for virtual desktops, viewport is mapped to them if needed.

  desktop - the number of the desktop

  viewport - the new position of the desktop's viewport

- setNumberOfDesktops (numberOfDesktops)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  numberOfDesktops | int |

  Sets the number of desktops the the specified number.

  NOTE: KDE uses virtual desktops and does not directly support viewport in any way. Viewport is mapped to virtual desktops if needed, but not for this call.

  numberOfDesktops - the number of desktops

- setShowingDesktop (showing)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  showing | bool |

  Sets the _NET_SHOWING_DESKTOP status (whether desktop is being shown).

- setVirtualRoots (windows, count)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  windows | Window |
  count | unsigned int |

  Sets the list of virtual root windows on the root window.

  windows - The array of Window id's

  count - The number of windows in the array.

- setWorkArea (desktop, workArea)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  desktop | int |
  workArea | NETRect |

  Sets the workarea for the specified desktop

  desktop - the number of the desktop

  workArea - the new work area of the desktop

- showingDesktop ( )

  returns bool

  Returns the status of _NET_SHOWING_DESKTOP.

- supportWindow ( )

  returns Window

  Returns the Window id of the supportWindow.

  Returns the id of the support window

- supportedProperties ( )

  returns unsigned long
  KDE 4.1.0 and later only

  In the Window Manager mode, this is equivalent to the properties argument passed to the constructor. In the Client mode, if NET.Supported was passed in the properties argument, the returned value is array of all protocols and properties supported by the Window Manager. The elements of the array are the same as they would be passed to the Window Manager mode constructor, the size is the maximum array size the constructor accepts.

- supportedProperties ( )

  returns SIP_PYLIST
  before KDE 4.1.0 only

- supportedProperties ( )

  returns SIP_PYLIST
  before KDE 4.1.0 only

- takeActivity (window, timestamp, flags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  window | Window |
  timestamp | Time |
  flags | long |

  Sends a take activity message with the given timestamp to the window, using the _NET_WM_TAKE_ACTIVITY protocol (see the WM spec for details).

  window - the window to which the message should be sent

  timestamp - timestamp of the message

  flags - arbitrary flags

- virtualRoots ( )

  returns Window
  Not implemented

  Returns an array of Window id's, which contain the virtual root windows.

  Returns the array of Window id's

  See also virtualRootsCount()

- virtualRootsCount ( )

  returns int

  Returns the number of window in the virtualRoots array.

  Returns the number of Window id's in the virtual root array

  See also virtualRoots()

- virtual_hook (id, data)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  id | int |
  data | void |

  Virtual hook, used to add new "virtual" functions while maintaining binary compatibility. Unused in this class.

- wmName ( )

  returns char

  Returns the name of the Window Manager.

  Returns the name of the window manager

- workArea (desktop)

  returns NETRect

  Argument | Type | Default
  --- | --- | ---
  desktop | int |

  Returns the workArea for the specified desktop.

  desktop - the number of the desktop

  Returns the size of the work area

- x11Display ( )

  returns Display

  Returns the X11 Display struct used.

  Returns the X11 Display

### enums - detail

- anonymous { PROTOCOLS, WINDOW_TYPES, STATES, PROTOCOLS2, ACTIONS, PROPERTIES_SIZE }

  Indexes for the properties array.

  | PROTOCOLS | - | - |
  | WINDOW_TYPES | - | - |
  | STATES | - | - |
  | PROTOCOLS2 | - | - |
  | ACTIONS | - | - |
  | PROPERTIES_SIZE | - | - |