• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

Classes | Public Types | Static Public Member Functions | List of all members
KWin Class Reference

#include <twin.h>

Classes

struct  Info
 
class  WindowInfo
 

Public Types

enum  IconSource { NETWM = 1 , WMHints = 2 , ClassHint = 4 , XApp = 8 }
 

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) TDE_DEPRECATED
 
static void demandAttention (WId win, bool set=true)
 
static void setUserTime (WId win, long time)
 
static void invokeContextHelp ()
 
static void setMainWindow (TQWidget *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 TQPixmap icon (WId win, int width=-1, int height=-1, bool scale=false)
 
static TQPixmap icon (WId win, int width, int height, bool scale, int flags)
 
static void setIcons (WId win, const TQPixmap &icon, const TQPixmap &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 setCurrentDesktopViewport (int desktop, TQPoint viewport)
 
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 TQString readNameProperty (WId window, unsigned long atom)
 
static bool compositingActive ()
 
static Info info (WId win) TDE_DEPRECATED
 
static void appStarted () TDE_DEPRECATED
 

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 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.

Class for interaction with the window manager.

See also
NET
NetWinInfo
Author
Matthias Ettrich (ettri.nosp@m.ch@k.nosp@m.de.or.nosp@m.g)

Definition at line 61 of file twin.h.

Member Enumeration Documentation

◆ IconSource

enum KWin::IconSource

Masks specifying from which sources to read an icon.

They are tried from the best until an icon is found.

  • NETWM from property from the window manager specification
  • WMHints from WMHints property
  • ClassHint load icon after getting name from the classhint
  • XApp load the standard X icon (last fallback)
Enumerator
NETWM 

read from property from the window manager specification

WMHints 

read from WMHints property

ClassHint 

load icon after getting name from the classhint

XApp 

load the standard X icon (last fallback)

Definition at line 231 of file twin.h.

Member Function Documentation

◆ activateWindow()

void KWin::activateWindow ( WId  win,
long  time = 0 
)
static

Requests that window win is activated.

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 tdebase package (tdebase/twin/README), or ask on the twin@.nosp@m.kde..nosp@m.org mailing list.

Parameters
winthe id of the window to make active
timeX server timestamp of the user activity that caused this request
Since
3.2

Definition at line 237 of file twin.cpp.

◆ allowedActionsSupported()

bool KWin::allowedActionsSupported ( )
static

Returns true if the WM announces which actions it allows for windows.

Since
3.2

Definition at line 1223 of file twin.cpp.

◆ appStarted()

void KWin::appStarted ( )
static
Deprecated:
Use TDEStartupInfo::appStarted

Definition at line 731 of file twin.cpp.

◆ clearState()

void KWin::clearState ( WId  win,
unsigned long  state 
)
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::SkipPager, NET::Hidden, NET::FullScreen, NET::KeepAbove, NET::KeepBelow, NET::StaysOnTop

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

Definition at line 553 of file twin.cpp.

◆ compositingActive()

bool KWin::compositingActive ( )
static

Returns true if a compositing manager is running (i.e.

ARGB windows are supported, effects will be provided, etc.).

Definition at line 146 of file twin.cpp.

◆ currentDesktop()

int KWin::currentDesktop ( )
static

Convenience function to access the current desktop.

See NETRootInfo.

Returns
the number of the current desktop

Definition at line 641 of file twin.cpp.

◆ deIconifyWindow()

void KWin::deIconifyWindow ( WId  win,
bool  animation = true 
)
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()

Definition at line 697 of file twin.cpp.

◆ demandAttention()

void KWin::demandAttention ( WId  win,
bool  set = true 
)
static

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.

Since
3.2

Definition at line 269 of file twin.cpp.

◆ forceActiveWindow()

void KWin::forceActiveWindow ( WId  win,
long  time = 0 
)
static

Sets window win to be the active 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().

Parameters
winthe id of the window to make active
timeX server timestamp of the user activity that caused this request
Since
3.2

Definition at line 249 of file twin.cpp.

◆ groupLeader()

WId KWin::groupLeader ( WId  window)
static

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

Parameters
windowthe id of the window
Since
3.2

Definition at line 327 of file twin.cpp.

◆ icccmCompliantMappingState()

bool KWin::icccmCompliantMappingState ( )
static

Definition at line 1209 of file twin.cpp.

◆ icon() [1/2]

TQPixmap KWin::icon ( WId  win,
int  width,
int  height,
bool  scale,
int  flags 
)
static

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.

Parameters
winthe id of the window
widththe desired width, or -1
heightthe desired height, or -1
scaleif true the icon will be scaled to the desired size. Otherwise the icon will not be modified.
flagsOR-ed flags from the IconSource enum
Since
3.2

Definition at line 399 of file twin.cpp.

◆ icon() [2/2]

TQPixmap KWin::icon ( WId  win,
int  width = -1,
int  height = -1,
bool  scale = false 
)
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
widththe desired width, or -1
heightthe desired height, or -1
scaleif true the icon will be scaled to the desired size. Otherwise the icon will not be modified.
Returns
the icon of the window

Definition at line 393 of file twin.cpp.

◆ iconifyWindow()

void KWin::iconifyWindow ( WId  win,
bool  animation = true 
)
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()

Definition at line 684 of file twin.cpp.

◆ info()

KWin::Info KWin::info ( WId  win)
static
Deprecated:
Use windowInfo() .

Definition at line 347 of file twin.cpp.

◆ invokeContextHelp()

void KWin::invokeContextHelp ( )
static

Invokes interactive context help.

Definition at line 214 of file twin.cpp.

◆ lowerWindow()

void KWin::lowerWindow ( WId  win)
static

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 TQWidget::lower() or XLowerWindow() if necessary.

Since
3.2

Definition at line 720 of file twin.cpp.

◆ numberOfDesktops()

int KWin::numberOfDesktops ( )
static

Convenience function to access the number of desktops.

See NETRootInfo.

Returns
the number of desktops

Definition at line 653 of file twin.cpp.

◆ raiseWindow()

void KWin::raiseWindow ( WId  win)
static

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 TQWidget::raise() or XRaiseWindow() if necessary.

Since
3.2

Definition at line 709 of file twin.cpp.

◆ readNameProperty()

TQString KWin::readNameProperty ( WId  window,
unsigned long  atom 
)
static

Function that reads and returns the contents of the given text property (WM_NAME, WM_ICON_NAME,...).

Since
3.2

Definition at line 1237 of file twin.cpp.

◆ setActiveWindow()

void KWin::setActiveWindow ( WId  win)
static
Deprecated:
Consider using activateWindow(), use forceActiveWindow() only if necessary.

Definition at line 260 of file twin.cpp.

◆ setCurrentDesktop()

void KWin::setCurrentDesktop ( int  desktop)
static

Convenience function to set the current desktop to desktop.

See NETRootInfo.

Parameters
desktopthe number of the new desktop

Definition at line 665 of file twin.cpp.

◆ setCurrentDesktopViewport()

void KWin::setCurrentDesktopViewport ( int  desktop,
TQPoint  viewport 
)
static

Convenience function to set the current viewport to viewport.

See NETRootInfo.

Parameters
desktopthe number of the new desktop
viewportthe position of the new viewport
Since
3.5.5

Definition at line 673 of file twin.cpp.

◆ setExtendedStrut()

void KWin::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

Sets the strut of window win to to left width ranging from left_start to left_end on the left edge, and simiarly for the other edges.

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 ).

Parameters
winthe id of the window
left_widthwidth of the strut at the left edge
left_startstarting y coordinate of the strut at the left edge
left_endending y coordinate of the strut at the left edge
right_widthwidth of the strut at the right edge
right_startstarting y coordinate of the strut at the right edge
right_endending y coordinate of the strut at the right edge
top_widthwidth of the strut at the top edge
top_startstarting x coordinate of the strut at the top edge
top_endending x coordinate of the strut at the top edge
bottom_widthwidth of the strut at the bottom edge
bottom_startstarting x coordinate of the strut at the bottom edge
bottom_endending x coordinate of the strut at the bottom edge

Definition at line 605 of file twin.cpp.

◆ setIcons()

void KWin::setIcons ( WId  win,
const TQPixmap &  icon,
const TQPixmap &  miniIcon 
)
static

Sets an icon and a miniIcon on window win.

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

Definition at line 515 of file twin.cpp.

◆ setMainWindow()

void KWin::setMainWindow ( TQWidget *  subwindow,
WId  mainwindow 
)
static

Sets the parent window of subwindow to be mainwindow.

This overrides the parent set the usual way as the TQWidget 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 TQWidget parent.

This function should be used before a dialog is shown for a window that belongs to another application.

Since
3.4

Definition at line 305 of file twin.cpp.

◆ setOnAllDesktops()

void KWin::setOnAllDesktops ( WId  win,
bool  b 
)
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

Definition at line 584 of file twin.cpp.

◆ setOnDesktop()

void KWin::setOnDesktop ( WId  win,
int  desktop 
)
static

Moves window win to desktop desktop.

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

Definition at line 597 of file twin.cpp.

◆ setOpacity()

void KWin::setOpacity ( WId  win,
uint  percent 
)
static

Sets the opacity of window win to percetage percent.

Convenience function that just sets an X property needs a running composite manager for any visible effect

Parameters
winthe id of the window
percentthe opacity value in percent (will be justified to [ 0: transparent - 100: opaque ])
Since
3.4

Definition at line 561 of file twin.cpp.

◆ setShadowSize()

void KWin::setShadowSize ( WId  win,
uint  percent 
)
static

Sets the shadowsize of window win to percetage percent.

Convenience function that just sets an X property needs the running KDE kompmgr manager for any visible effect

Parameters
winthe id of the window
percentthe opacity value in percent (0 leads to a completely unshadowed window)
Since
3.4

Definition at line 575 of file twin.cpp.

◆ setState()

void KWin::setState ( WId  win,
unsigned long  state 
)
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::SkipPager, NET::Hidden, NET::FullScreen, NET::KeepAbove, NET::KeepBelow, NET::StaysOnTop

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

Definition at line 545 of file twin.cpp.

◆ setStrut()

void KWin::setStrut ( WId  win,
int  left,
int  right,
int  top,
int  bottom 
)
static
Deprecated:
use setExtendedStrut() 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

Definition at line 628 of file twin.cpp.

◆ setSystemTrayWindowFor()

void KWin::setSystemTrayWindowFor ( WId  trayWin,
WId  forWin 
)
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
forWinthe id of the window represented by the system tray window

Definition at line 221 of file twin.cpp.

◆ setType()

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

Sets the type of window win to windowType.

Parameters
winthe id of the window
windowTypethe type of the window (see NET::WindowType)

Definition at line 537 of file twin.cpp.

◆ setUserTime()

void KWin::setUserTime ( WId  win,
long  time 
)
static

Sets user timestamp time on window win.

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.

Since
3.2

Definition at line 277 of file twin.cpp.

◆ transientFor()

WId KWin::transientFor ( WId  window)
static

Returns the WM_TRANSIENT_FOR property for the given window, i.e.

the mainwindow for this window.

Parameters
windowthe id of the window
Since
3.2

Definition at line 291 of file twin.cpp.

◆ windowInfo()

KWin::WindowInfo KWin::windowInfo ( WId  win,
unsigned long  properties = 0,
unsigned long  properties2 = 0 
)
static

Returns information about window win.

It is recommended to check whether the returned info is valid by calling the valid() method.

Parameters
winthe id of the window
propertiesall properties that should be retrieved (see NET::Property enum for details) - passing 0 means all properties. Unlisted properties cause related information to be invalid in the returned data, but make this function faster when not all data is needed.
properties2additional properties (see NET::Property2 enum). Note that specifying 0 means no properties, not all.
Returns
the window information
Since
3.2

Definition at line 285 of file twin.cpp.


The documentation for this class was generated from the following files:
  • twin.h
  • twin.cpp

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.