class KWin

Class for interaction with the window manager. More...

Definition#include <kwin.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Static Methods


Detailed Description

Convenience access to certain properties and features of the window manager.

This class is not supposed to be instantiated. It exists mostly as a namespace for the static member functions.

In KDE 2 and KDE 3, communication with the windowmanager is done with the NET-protocol, a common window manager specification designed by various authors of X11 window managers (including those of the KDE project). The full specification can be found in kdebase/kwin/wm-spec/

To access features of the NET-protocol, use the classes NETRootInfo and NETWinInfo.

The purpose of this class is to to provide easy access to the most-commonly used NET-features with a simpler, KDEish interface.

In addition, it encapsulates KDE functionality not yet provided by the NET hints. Currently that is invokeContextHelp() and setSystemTrayWindowFor() only.

See also: NET, NetWinInfo

void  setActiveWindow ( WId win)

setActiveWindow

[static]

Sets window win to be the active window.

This is a request to the window manager. It may or may not be obeyed.

Parameters:
winthe if of the window to make active

void  invokeContextHelp ()

invokeContextHelp

[static]

Invokes interactive context help.

void  setSystemTrayWindowFor ( WId trayWin, WId forWin )

setSystemTrayWindowFor

[static]

Makes trayWin a system tray window for forWin.

A system tray window serves as an icon replacement. It's displayed inside the panel's system tray.

Parameters:
trayWinthe id of the system tray window
trayWinthe id of the window represented by the system tray window

Info (struct)

Info

Information about a window.

Info  info ( WId win )

info

[static]

Returns information about window win.

Parameters:
winthe id of the windoe

Returns: the window information

QPixmap  icon ( WId win, int width = -1, int height = -1, bool scale = false )

icon

[static]

Returns an icon for window win.

If width and height are specified, the best icon for the requested size is returned.

If scale is true, the icon is smooth-scaled to have exactly the requested size.

Parameters:
winthe id of the window
thedesired width, or -1
thedesired height, or -1
iftrue the icon will be scaled to the desired size. Otherwise the icon will not be modified.

Returns: the icon of the window

void  setIcons ( WId win, const QPixmap& icon, const QPixmap& miniIcon )

setIcons

[static]

Sets an icon and a miniIcon on window win

Parameters:
winthe id of the window
iconthe new icon
miniIconthe new mini icon

void  setType ( WId win, NET::WindowType windowType )

setType

[static]

Sets the type of window win to windowType.

Possible values are NET::Normal, NET::Desktop, NET::Dock, NET::Tool, NET::Menu, NET::Dialog, NET::Override (== no decoration frame) or NET::TopMenu

Parameters:
winthe id of the window
windowTypethe type of the window

void  setState ( WId win, unsigned long state )

setState

[static]

Sets the state of window win to state.

Possible values are or'ed combinations of NET::Modal, NET::Sticky, NET::MaxVert, NET::MaxHoriz, NET::Shaded, NET::SkipTaskbar, NET::StaysOnTop, NET::SkipPager

Parameters:
winthe id of the window
statethe new flags that will be set

void  clearState ( WId win, unsigned long state )

clearState

[static]

Clears the state of window win from state.

Possible values are or'ed combinations of NET::Modal, NET::Sticky, NET::MaxVert, NET::MaxHoriz, NET::Shaded, NET::SkipTaskbar, NET::StaysOnTop, NET::SkipPager

Parameters:
winthe id of the window
statethe flags that will be cleared

void  setOnAllDesktops ( WId win, bool b )

setOnAllDesktops

[static]

Sets window win to be present on all virtual desktops if is true. Otherwise the window lives only on one single desktop.

Parameters:
winthe id of the window
btrue to show the window on all desktops, false otherwise

void  setOnDesktop ( WId win, int desktop)

setOnDesktop

[static]

Moves window win to desktop desktop.

Parameters:
winthe id of the window
desktopthe number of the new desktop

void  setStrut ( WId win, int left, int right, int top, int bottom )

setStrut

[static]

Sets the strut of window win to left, right, top, bottom.

Parameters:
winthe id of the window
leftthe left strut
rightthe right strut
topthe top strut
bottomthe bottom strut

int  currentDesktop ()

currentDesktop

[static]

Convenience function to access the current desktop. See NETRootInfo.

Returns: the number of the current desktop

int  numberOfDesktops ()

numberOfDesktops

[static]

Convenience function to access the number of desktops. See NETRootInfo.

Returns: the number of desktops

void  setCurrentDesktop ( int desktop )

setCurrentDesktop

[static]

Convenience function to set the current desktop to desktop. See NETRootInfo.

Parameters:
thenumber of the new desktop

void  iconifyWindow ( WId win, bool animation = true )

iconifyWindow

[static]

Iconifies a window. Compatible to XIconifyWindow but has an additional parameter animation.

Parameters:
winthe id of the window
animationtrue to show an animation

See also: deIconifyWindow()

void  deIconifyWindow ( WId win, bool animation = true )

deIconifyWindow

[static]

DeIconifies a window. Compatible to XMapWindow but has an additional parameter animation.

Parameters:
winthe id of the window
animationtrue to show an animation

See also: iconifyWindow()

void  appStarted ()

appStarted

[static]

Use KStartupInfo::appStarted