KWin Class Reference
Convenience access to certain properties and features of the window manager.Class for interaction with the window manager. More...
#include <kwin.h>
Public Types | |
enum | IconSource { NETWM = 1, WMHints = 2, ClassHint = 4, XApp = 8 } |
Public Member Functions | |
WindowInfo (WId window, unsigned long properties, unsigned long properties2) | |
WindowInfo () | |
bool | valid (bool withdrawn_is_valid=false) const |
WId | win () const |
unsigned long | state () const |
bool | hasState (unsigned long s) const |
bool | isMinimized () const |
NET::MappingState | mappingState () const |
NETExtendedStrut | extendedStrut () const |
NETStrut | strut () const |
NET::WindowType | windowType (int supported_types) const |
QString | visibleName () const |
QString | visibleNameWithState () const |
QString | name () const |
QString | visibleIconName () const |
QString | visibleIconNameWithState () const |
QString | iconName () const |
bool | isOnCurrentDesktop () const |
bool | isOnDesktop (int desktop) const |
bool | onAllDesktops () const |
int | desktop () const |
QRect | geometry () const |
QRect | frameGeometry () const |
WId | transientFor () const |
WId | groupLeader () const |
QCString | windowClassClass () const |
QCString | windowClassName () const |
QCString | windowRole () const |
QCString | clientMachine () const |
bool | actionSupported (NET::Action action) const |
WindowInfo (const WindowInfo &) | |
WindowInfo & | operator= (const WindowInfo &) |
Static Public Member Functions | |
static void | activateWindow (WId win, long time=0) |
static void | forceActiveWindow (WId win, long time=0) |
static void | setActiveWindow (WId win) KDE_DEPRECATED |
static void | demandAttention (WId win, bool set=true) |
static void | setUserTime (WId win, long time) |
static void | invokeContextHelp () |
static void | setMainWindow (QWidget *subwindow, WId mainwindow) |
static void | setSystemTrayWindowFor (WId trayWin, WId forWin) |
static WindowInfo | windowInfo (WId win, unsigned long properties=0, unsigned long properties2=0) |
static WId | transientFor (WId window) |
static WId | groupLeader (WId window) |
static QPixmap | icon (WId win, int width=-1, int height=-1, bool scale=false) |
static QPixmap | icon (WId win, int width, int height, bool scale, int flags) |
static void | setIcons (WId win, const QPixmap &icon, const QPixmap &miniIcon) |
static void | setType (WId win, NET::WindowType windowType) |
static void | setState (WId win, unsigned long state) |
static void | clearState (WId win, unsigned long state) |
static void | setOpacity (WId win, uint percent) |
static void | setShadowSize (WId win, uint percent) |
static void | setOnAllDesktops (WId win, bool b) |
static void | setOnDesktop (WId win, int desktop) |
static void | setExtendedStrut (WId win, int left_width, int left_start, int left_end, int right_width, int right_start, int right_end, int top_width, int top_start, int top_end, int bottom_width, int bottom_start, int bottom_end) |
static void | setStrut (WId win, int left, int right, int top, int bottom) |
static int | currentDesktop () |
static int | numberOfDesktops () |
static void | setCurrentDesktop (int desktop) |
static void | iconifyWindow (WId win, bool animation=true) |
static void | deIconifyWindow (WId win, bool animation=true) |
static void | raiseWindow (WId win) |
static void | lowerWindow (WId win) |
static bool | icccmCompliantMappingState () |
static bool | allowedActionsSupported () |
static QString | readNameProperty (WId window, unsigned long atom) |
static Info | info (WId win) KDE_DEPRECATED |
Classes | |
struct | Info |
Detailed Description
Convenience access to certain properties and features of the window manager.Class for interaction with 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 at www.freedesktop.org/standards/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
- Author:
- Matthias Ettrich (ettrich@kde.org)
Definition at line 61 of file kwin.h.
Member Enumeration Documentation
|
Masks specifying from which sources to read an icon. They are tried from the best until an icon is found.
|
Member Function Documentation
|
Requests that window There are two ways how to activate a window, by calling activateWindow() and forceActiveWindow(). Generally, applications shouldn't make attempts to explicitly activate their windows, and instead let the user to activate them. In the special cases where this may be needed, applications should use activateWindow(). Window manager may consider whether this request wouldn't result in focus stealing, which would be obtrusive, and may refuse the request. The usage of forceActiveWindow() is meant only for pagers and similar tools, which represent direct user actions related to window manipulation. Except for rare cases, this request will be always honored, and normal applications are forbidden to use it. In case of problems, consult the KWin README in the kdebase package (kdebase/kwin/README), or ask on the kwin@kde.org mailing list.
Definition at line 221 of file kwin.cpp. References info(), NETRootInfo::setActiveWindow(), and KUniqueApplication::setHandleAutoStarted(). |
|
Sets window Note that this should be called only in special cases, applications shouldn't force themselves or other windows to be the active window. Generally, this call should used only by pagers and similar tools. See the explanation in description of activateWindow().
Definition at line 233 of file kwin.cpp. References info(), NETRootInfo::setActiveWindow(), and KUniqueApplication::setHandleAutoStarted(). Referenced by KStartupInfo::setNewStartupId(). |
|
Definition at line 244 of file kwin.cpp. References info(), NETRootInfo::setActiveWindow(), and KUniqueApplication::setHandleAutoStarted(). |
|
When application finishes some operation and wants to notify the user about it, it can call demandAttention(). Instead of activating the window, which could be obtrusive, the window will be marked specially as demanding user's attention. See also explanation in description of activateWindow(). Note that it's usually better to use KNotifyClient.
Definition at line 253 of file kwin.cpp. References NET::DemandsAttention, info(), and NETWinInfo::setState(). |
|
Sets user timestamp 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. The most common case is the special value 0 which means not to activate the window after being shown.
Definition at line 261 of file kwin.cpp. References info(), and NETWinInfo::setUserTime(). |
|
Invokes interactive context help.
|
|
Sets the parent window of This overrides the parent set the usual way as the QWidget parent, but only for the window manager - e.g. stacking order and window grouping will be affected, but features like automatic deletion of children when the parent is deleted are unaffected and normally use the QWidget parent. This function should be used before a dialog is shown for a window that belongs to another application.
Definition at line 289 of file kwin.cpp. References endl(), kdWarning(), QWidget::parentWidget(), and QWidget::winId(). |
|
Makes A system tray window serves as an icon replacement. It's displayed inside the panel's system tray.
Definition at line 205 of file kwin.cpp. References endl(), info(), NETRootInfo::isSupported(), kdWarning(), DCOPRef::send(), and NETWinInfo::setKDESystemTrayWinFor(). |
|
Returns information about window It is recommended to check whether the returned info is valid by calling the valid() method.
Definition at line 269 of file kwin.cpp. References WindowInfo(). |
|
Returns the WM_TRANSIENT_FOR property for the given window, i.e. the mainwindow for this window.
|
|
Returns the leader window for the group the given window is in, if any.
|
|
Returns an icon for window
If
If
|
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Overloaded variant that allows specifying from which sources the icon should be read. You should usually prefer the simpler variant which tries all possibilities to get an icon.
Definition at line 383 of file kwin.cpp. References ClassHint, QPixmap::convertFromImage(), QPixmap::convertToImage(), NETIcon::data, KIcon::DefaultState, QPixmap::detach(), NETSize::height, NETWinInfo::icon(), KInstance::iconLoader(), info(), KGlobal::instance(), QPixmap::isNull(), QImage::isNull(), KIconLoader::loadIcon(), QString::lower(), NETWM, QImage::setAlphaBuffer(), QPixmap::setMask(), QImage::size(), NETIcon::size, KIcon::Small, QImage::smoothScale(), NETSize::width, WMHints, and XApp. |
|
Sets an
Definition at line 499 of file kwin.cpp. References QImage::bits(), QPixmap::convertToImage(), NETIcon::data, NETSize::height, info(), QPixmap::isNull(), NETWinInfo::setIcon(), QImage::size(), NETIcon::size, and NETSize::width. Referenced by KApplication::notify(), and KApplication::setTopWidget(). |
|
Sets the type of window Possible values are NET::Normal, NET::Desktop, NET::Dock, NET::Tool, NET::Menu, NET::Dialog, NET::Override (== no decoration frame), NET::TopMenu, NET::Utility or NET::Splash
Definition at line 521 of file kwin.cpp. References info(), and NETWinInfo::setWindowType(). |
|
Sets the state of window Possible values are or'ed combinations of NET::Modal, NET::Sticky, NET::MaxVert, NET::MaxHoriz, NET::Shaded, NET::SkipTaskbar, NET::SkipPager, NET::Hidden, NET::FullScreen, NET::KeepAbove, NET::KeepBelow, NET::StaysOnTop
Definition at line 529 of file kwin.cpp. References info(), and NETWinInfo::setState(). |
|
Clears the state of window Possible values are or'ed combinations of NET::Modal, NET::Sticky, NET::MaxVert, NET::MaxHoriz, NET::Shaded, NET::SkipTaskbar, NET::SkipPager, NET::Hidden, NET::FullScreen, NET::KeepAbove, NET::KeepBelow, NET::StaysOnTop
Definition at line 537 of file kwin.cpp. References info(), and NETWinInfo::setState(). |
|
Sets the opacity of window Convenience function that just sets an X property needs a running composite manager for any visible effect
|
|
Sets the shadowsize of window Convenience function that just sets an X property needs the running KDE kompmgr manager for any visible effect
|
|
Sets window Otherwise the window lives only on one single desktop.
Definition at line 568 of file kwin.cpp. References NETRootInfo::currentDesktop(), NETWinInfo::desktop(), info(), NETWinInfo::OnAllDesktops, and NETWinInfo::setDesktop(). |
|
Moves window
Definition at line 581 of file kwin.cpp. References info(), and NETWinInfo::setDesktop(). |
|
Sets the strut of window For not reserving a strut, pass 0 as the width. E.g. to reserve 10x10 square in the topleft corner, use e.g. setExtendedStrut( w, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0 ).
Definition at line 589 of file kwin.cpp. References NETExtendedStrut::bottom_end, NETExtendedStrut::bottom_start, NETExtendedStrut::bottom_width, info(), NETExtendedStrut::left_end, NETExtendedStrut::left_start, NETExtendedStrut::left_width, NETExtendedStrut::right_end, NETExtendedStrut::right_start, NETExtendedStrut::right_width, NETWinInfo::setExtendedStrut(), strut(), NETExtendedStrut::top_end, NETExtendedStrut::top_start, and NETExtendedStrut::top_width. |
|
Definition at line 612 of file kwin.cpp. References NETStrut::bottom, info(), NETStrut::left, NETStrut::right, NETWinInfo::setStrut(), strut(), and NETStrut::top. |
|
Convenience function to access the current desktop. See NETRootInfo.
Definition at line 625 of file kwin.cpp. References NETRootInfo::currentDesktop(), and info(). |
|
Convenience function to access the number of desktops. See NETRootInfo.
Definition at line 637 of file kwin.cpp. References info(), and NETRootInfo::numberOfDesktops(). |
|
Convenience function to set the current desktop to See NETRootInfo.
Definition at line 649 of file kwin.cpp. References info(), and NETRootInfo::setCurrentDesktop(). |
|
Iconifies a window.
Compatible to XIconifyWindow but has an additional parameter
|
|
DeIconifies a window.
Compatible to XMapWindow but has an additional parameter
|
|
Raises the given window. This call is only for pagers and similar tools that represent direct user actions. Applications should not use it, they should keep using QWidget::raise() or XRaiseWindow() if necessary.
Definition at line 683 of file kwin.cpp. References info(), NETRootInfo::isSupported(), and NETRootInfo::restackRequest(). |
|
Lowers the given window. This call is only for pagers and similar tools that represent direct user actions. Applications should not use it, they should keep using QWidget::lower() or XLowerWindow() if necessary.
Definition at line 694 of file kwin.cpp. References info(), NETRootInfo::isSupported(), and NETRootInfo::restackRequest(). |
|
Returns true if the WM announces which actions it allows for windows.
Definition at line 1197 of file kwin.cpp. References info(), and NETRootInfo::isSupported(). |
|
Function that reads and returns the contents of the given text property (WM_NAME, WM_ICON_NAME,. ..).
Definition at line 1211 of file kwin.cpp. References QString::fromLocal8Bit(). |
|
|
Reads all the info about the given window.
Referenced by windowInfo(). |
|
Returns false if this window info is not valid (most probably the given window doesn't exist).
|
|
Returns the window identifier.
|
|
Returns the window's state flags (see the NET::State enum for details). Requires NET::WMState passed to KWin::windowInfo(). |
|
Returns true if the window has the given state flag set (see the NET::State enum for details). Requires NET::WMState passed to KWin::windowInfo().
|
|
Returns true if the window is minimized. Note that it is true only if the window is truly minimized, not shaded or on another virtual desktops, which makes it different from mappingState() == NET::Iconic or QWidget::isMinimized(). Requires NET::WMState and NET::XAWMState passed to KWin::windowInfo(). |
|
Returns the mapping state of the window (see NET::MappingState). Note that it's very likely that you don't want to use this function, and use isOnDesktop(), isMinimized() etc. instead. Requires NET::XAWMState passed to KWin::windowInfo(). |
|
Returns the window extended (partial) strut. Requires NET::WM2ExtendedStrut passed to KWin::windowInfo(). |
|
Referenced by setExtendedStrut(), and setStrut(). |
|
Returns the window type of this window (see NET::WindowType). The argument should be all window types your application supports (see NET::WindowTypeMask). Requires NET::WMWindowType passed to KWin::windowInfo(). |
|
Returns the visible name of the window (i.e. including possible <2> appended when there are two or more windows with the same name). Requires NET::WMVisibleName passed to KWin::windowInfo(). |
|
Returns a visible name with state. This is a simple convenience function that returns the visible name but with parentheses around minimized windows. Requires NET::WMVisibleName, NET::WMState and NET::XAWMState passed to KWin::windowInfo().
|
|
Returns the name of the window, as specified by the application, without any modifications. You should often use visibleName() instead. Requires NET::WMName passed to KWin::windowInfo(). |
|
Returns the visible name of the window that should be shown in taskbar and all other "iconic" representations of the window. Note that this has nothing to do with normal icons. Requires NET::WMVisibleIconName passed to KWin::windowInfo(). |
|
Returns a visible name with state. This is a simple convenience function that returns the visible iconic name but with parentheses around minimized windows. Note that this has nothing to do with normal icons. Requires NET::WMVisibleIconName, NET::WMState and NET::XAWMState passed to KWin::windowInfo().
|
|
Returns the name of the window that should be shown in taskbar and all other "iconic" representations of the window. Note that this has nothing to do with normal icons. Requires NET::WMIconName passed to KWin::windowInfo(). |
|
Returns true if the window is on the currently active virtual desktop. Requires NET::WMDesktop passed to KWin::windowInfo(). |
|
Returns true if the window is on the given virtual desktop. Requires NET::WMDesktop passed to KWin::windowInfo(). |
|
Returns true if the window is on all desktops (equal to desktop()==NETOnAllDesktops). Requires NET::WMDesktop passed to KWin::windowInfo(). |
|
Returns the virtual desktop this window is on (NET::OnAllDesktops if the window is on all desktops). You should prefer using isOnDesktop(). Requires NET::WMDesktop passed to KWin::windowInfo(). |
|
Returns the position and size of the window contents. Requires NET::WMGeometry passed to KWin::windowInfo(). |
|
Returns the frame geometry of the window, i.e. including the window decoration. Requires NET::WMKDEFrameStrut passed to KWin::windowInfo(). |
|
Returns the WM_TRANSIENT_FOR property for the window, i.e. the mainwindow for this window. Requires NET::WM2TransientFor passed to KWin::windowInfo(). |
|
Returns the leader window for the group the window is in, if any. Requires NET::WM2GroupLeader passed to KWin::windowInfo(). |
|
Returns the class component of the window class for the window (i.e. WM_CLASS property). Requires NET::WM2WindowClass passed to KWin::windowInfo().
|
|
Returns the name component of the window class for the window (i.e. WM_CLASS property). Requires NET::WM2WindowClass passed to KWin::windowInfo().
|
|
Returns the window role for the window (i.e. WM_WINDOW_ROLE property). Requires NET::WM2WindowRole passed to KWin::windowInfo().
|
|
Returns the client machine for the window (i.e. WM_CLIENT_MACHINE property). Requires NET::WMClientMachine passed to KWin::windowInfo().
|
|
Returns true if the given action is currently supported for the window by the window manager. Requires NET::WM2AllowedActions passed to KWin::windowInfo(). |
The documentation for this class was generated from the following files: