kwin Library API Documentation

KWinInternal::Client Class Reference

The Client class encapsulates a window decoration frame. More...

#include <client.h>

Inheritance diagram for KWinInternal::Client:

QObject KDecorationDefines List of all members.

Public Types

enum  Sizemode {
  SizemodeAny, SizemodeFixedW, SizemodeFixedH, SizemodeMax,
  SizemodeShaded
}

Public Member Functions

 Client (Workspace *ws)
Window window () const
Window frameId () const
Window wrapperId () const
Window decorationId () const
Workspaceworkspace () const
const ClienttransientFor () const
ClienttransientFor ()
bool isTransient () const
bool groupTransient () const
bool wasOriginallyGroupTransient () const
ClientList mainClients () const
bool hasTransient (const Client *c, bool indirect) const
const ClientListtransients () const
void checkTransient (Window w)
ClientfindModal ()
const Groupgroup () const
Groupgroup ()
void checkGroup (Group *gr=NULL, bool force=false)
NET::WindowType windowType (bool direct=false, int supported_types=SUPPORTED_WINDOW_TYPES_MASK) const
const WindowRulesrules () const
QRect geometry () const
QSize size () const
QSize minSize () const
QSize maxSize () const
QPoint pos () const
QRect rect () const
int x () const
int y () const
int width () const
int height () const
QPoint clientPos () const
QSize clientSize () const
bool windowEvent (XEvent *e)
virtual bool eventFilter (QObject *o, QEvent *e)
bool manage (Window w, bool isMapped)
void releaseWindow (bool on_shutdown=false)
QSize adjustedSize (const QSize &, Sizemode mode=SizemodeAny) const
QPixmap icon () const
QPixmap miniIcon () const
bool isActive () const
void setActive (bool, bool updateOpacity=true)
int desktop () const
void setDesktop (int)
bool isOnDesktop (int d) const
bool isOnCurrentDesktop () const
bool isOnAllDesktops () const
void setOnAllDesktops (bool set)
bool isShown (bool shaded_is_shown) const
bool isShade () const
ShadeMode shadeMode () const
void setShade (ShadeMode mode)
bool isShadeable () const
bool isMinimized () const
bool isMaximizable () const
QRect geometryRestore () const
MaximizeMode maximizeMode () const
bool isMinimizable () const
void setMaximize (bool vertically, bool horizontally)
void setFullScreen (bool set, bool user)
bool isFullScreen () const
bool isFullScreenable (bool fullscreen_hack=false) const
bool userCanSetFullScreen () const
QRect geometryFSRestore () const
int fullScreenMode () const
bool isUserNoBorder () const
void setUserNoBorder (bool set)
bool userCanSetNoBorder () const
bool noBorder () const
bool skipTaskbar (bool from_outside=false) const
void setSkipTaskbar (bool set, bool from_outside)
bool skipPager () const
void setSkipPager (bool)
bool keepAbove () const
void setKeepAbove (bool)
bool keepBelow () const
void setKeepBelow (bool)
Layer layer () const
Layer belongsToLayer () const
void invalidateLayer ()
void setModal (bool modal)
bool isModal () const
bool wantsTabFocus () const
bool wantsInput () const
bool hasNETSupport () const
bool isMovable () const
bool isDesktop () const
bool isDock () const
bool isToolbar () const
bool isTopMenu () const
bool isMenu () const
bool isNormalWindow () const
bool isDialog () const
bool isSplash () const
bool isUtility () const
bool isOverride () const
bool isSpecialWindow () const
bool isResizable () const
bool isCloseable () const
void takeActivity (int flags, bool handled, allowed_t)
void takeFocus (allowed_t)
void demandAttention (bool set=true)
void setMask (const QRegion &r, int mode=X::Unsorted)
QRegion mask () const
void updateDecoration (bool check_workspace_pos, bool force=false)
void checkBorderSizes ()
bool shape () const
void updateShape ()
void setGeometry (int x, int y, int w, int h, ForceGeometry_t force=NormalGeometrySet)
void setGeometry (const QRect &r, ForceGeometry_t force=NormalGeometrySet)
void move (int x, int y, ForceGeometry_t force=NormalGeometrySet)
void move (const QPoint &p, ForceGeometry_t force=NormalGeometrySet)
void plainResize (int w, int h, ForceGeometry_t force=NormalGeometrySet)
void plainResize (const QSize &s, ForceGeometry_t force=NormalGeometrySet)
void keepInArea (QRect area, bool partial=false)
void growHorizontal ()
void shrinkHorizontal ()
void growVertical ()
void shrinkVertical ()
bool providesContextHelp () const
KShortcut shortcut () const
void setShortcut (const QString &cut)
bool performMouseCommand (Options::MouseCommand, QPoint globalPos, bool handled=false)
QCString windowRole () const
QCString sessionId ()
QCString resourceName () const
QCString resourceClass () const
QCString wmCommand ()
QCString wmClientMachine (bool use_localhost) const
Window wmClientLeader () const
pid_t pid () const
QRect adjustedClientArea (const QRect &desktop, const QRect &area) const
Colormap colormap () const
void hideClient (bool hide)
void virtualDesktopChange ()
QString caption (bool full=true) const
void updateCaption ()
void keyPressEvent (uint key_code)
void updateMouseGrab ()
Window moveResizeGrabWindow () const
const QPoint calculateGravitation (bool invert, int gravity=0) const
void NETMoveResize (int x_root, int y_root, NET::Direction direction)
void NETMoveResizeWindow (int flags, int x, int y, int width, int height)
void restackWindow (Window above, int detail, NET::RequestSource source, Time timestamp, bool send_event=false)
void gotPing (Time timestamp)
void checkWorkspacePosition ()
void updateUserTime (Time time=CurrentTime)
Time userTime () const
bool hasUserTimeSupport () const
bool ignoreFocusStealing () const
void minimize (bool avoid_animation=false)
void unminimize (bool avoid_animation=false)
void closeWindow ()
void killWindow ()
void maximize (MaximizeMode)
void toggleShade ()
void showContextHelp ()
void cancelAutoRaise ()
void destroyClient ()
void checkActiveModal ()
void setOpacity (bool translucent, uint opacity=0)
void setShadowSize (uint shadowSize)
void updateOpacity ()
void updateShadowSize ()
bool hasCustomOpacity ()
void setCustomOpacityFlag (bool custom=true)
bool getWindowOpacity ()
int opacityPercentage ()
void checkAndSetInitialRuledOpacity ()
uint ruleOpacityInactive ()
uint ruleOpacityActive ()
unsigned int opacity ()
bool isBMP ()
void setBMP (bool b)
bool touches (const Client *c)
void setShapable (bool b)

Static Public Member Functions

static QCString staticWindowRole (WId)
static QCString staticSessionId (WId)
static QCString staticWmCommand (WId)
static QCString staticWmClientMachine (WId)
static Window staticWmClientLeader (WId)
static void deleteClient (Client *c, allowed_t)
static bool resourceMatch (const Client *c1, const Client *c2)
static bool belongToSameApplication (const Client *c1, const Client *c2, bool active_hack=false)
static void readIcons (Window win, QPixmap *icon, QPixmap *miniicon)

Friends

class Bridge
struct FetchNameInternalPredicate
struct CheckIgnoreFocusStealingProcedure
struct ResetupRulesProcedure

Detailed Description

The Client class encapsulates a window decoration frame.

Definition at line 46 of file client.h.


Constructor & Destructor Documentation

KWinInternal::Client::Client Workspace ws  ) 
 

This ctor is "dumb" - it only initializes data. All the real initialization is done in manage().

Definition at line 69 of file client.cpp.

References KDecorationDefines::MaximizeRestore.


Member Function Documentation

bool KWinInternal::Client::windowEvent XEvent *  e  ) 
 

General handler for XEvents concerning the client window

Definition at line 511 of file events.cpp.

References checkWorkspacePosition(), KWinInternal::Shape::hasShape(), isActive(), isTopMenu(), KWinInternal::Workspace::setWasUserInteraction(), KWinInternal::Shape::shapeEvent(), KWinInternal::Workspace::updateClientArea(), KWinInternal::Workspace::updateColormap(), updateShape(), updateUserTime(), window(), and workspace().

Referenced by KWinInternal::Workspace::workspaceEvent().

bool KWinInternal::Client::manage Window  w,
bool  isMapped
 

Manages the clients. This means handling the very first maprequest: reparenting, initial geometry, initial state, placement, etc. Returns false if KWin is not going to manage this window.

Definition at line 37 of file manage.cpp.

References KWinInternal::SessionInfo::active, KWinInternal::Workspace::allowClientActivation(), QValueList::begin(), QRect::bottom(), caption(), QRect::center(), checkAndSetInitialRuledOpacity(), KWinInternal::WindowRules::checkDesktop(), KWinInternal::Options::checkIgnoreFocusStealing(), KWinInternal::WindowRules::checkIgnorePosition(), KWinInternal::WindowRules::checkMaximize(), KWinInternal::WindowRules::checkMinimize(), KWinInternal::WindowRules::checkNoBorder(), KWinInternal::WindowRules::checkPosition(), KWinInternal::Workspace::checkStartupNotification(), KWinInternal::Workspace::clientArea(), QValueList::ConstIterator(), QValueList::count(), KWinInternal::Workspace::currentDesktop(), demandAttention(), desktop(), KWinInternal::SessionInfo::desktop, KWinInternal::WindowRules::discardTemporary(), QValueList::end(), KWinInternal::Options::focusPolicyIsReasonable(), frameId(), QString::fromLatin1(), KWinInternal::SessionInfo::fsrestore, KWinInternal::SessionInfo::fullscreen, geometry(), KWinInternal::SessionInfo::geometry, KWinInternal::grabXServer(), hasNETSupport(), KWinInternal::Shape::hasShape(), QRect::height(), height(), hideClient(), KWinInternal::Options::ignorePositionClasses, isDesktop(), isDialog(), isFullScreenable(), isMaximizable(), isMovable(), isNormalWindow(), isOnCurrentDesktop(), isOverride(), isShown(), isSpecialWindow(), isSplash(), isToolbar(), isTopMenu(), isTransient(), isUtility(), KWinInternal::SessionInfo::keepAbove, KWinInternal::SessionInfo::keepBelow, keepInArea(), QCString::lower(), mainClients(), maximize(), KWinInternal::SessionInfo::maximized, KDecorationDefines::MaximizeFull, KDecorationDefines::MaximizeHorizontal, KDecorationDefines::MaximizeRestore, KDecorationDefines::MaximizeVertical, minimize(), KWinInternal::SessionInfo::minimized, move(), KWinInternal::SessionInfo::onAllDesktops, KWinInternal::options, KWinInternal::Workspace::place(), plainResize(), QCursor::pos(), KWinInternal::Notify::raise(), KWinInternal::Workspace::raiseClient(), KWinInternal::Workspace::requestFocus(), resourceClass(), KWinInternal::Workspace::restackClientUnderActive(), KWinInternal::SessionInfo::restore, QRect::right(), rules(), KWinInternal::Workspace::sessionSaving(), KWinInternal::Workspace::setCurrentDesktop(), setFullScreen(), QRect::setHeight(), setKeepAbove(), setKeepBelow(), setModal(), setShade(), setShortcut(), QRect::setSize(), setSkipPager(), setSkipTaskbar(), setUserNoBorder(), QRect::setWidth(), QRect::setX(), QRect::setY(), KWinInternal::SessionInfo::shaded, KWinInternal::SessionInfo::shortcut, QRect::size(), KWinInternal::SessionInfo::skipPager, KWinInternal::SessionInfo::skipTaskbar, staticWindowRole(), KWinInternal::Workspace::takeSessionInfo(), KWinInternal::ungrabXServer(), KWinInternal::Workspace::updateClientLayer(), updateDecoration(), KWinInternal::Workspace::updateOnAllDesktopsOfTransients(), updateShape(), KWinInternal::SessionInfo::userNoBorder, userTime(), virtualDesktopChange(), wantsTabFocus(), KWinInternal::Workspace::wasUserInteraction(), QRect::width(), width(), window(), workspace(), x(), QRect::x(), KWinInternal::Options::xineramaPlacementEnabled, y(), and QRect::y().

void KWinInternal::Client::releaseWindow bool  on_shutdown = false  ) 
 

Releases the window. The client has done its job and the window is still existing.

Definition at line 177 of file client.cpp.

References KWinInternal::atoms, KWinInternal::Workspace::clientHidden(), deleteClient(), frameId(), KWinInternal::Atoms::kde_net_wm_user_creation_time, KWinInternal::Workspace::removeClient(), setModal(), setOpacity(), workspace(), x(), and y().

QSize KWinInternal::Client::adjustedSize const QSize frame,
Sizemode  mode = SizemodeAny
const
 

Adjust the frame size frame according to he window's size hints.

Definition at line 1004 of file geometry.cpp.

References QSize::height(), and QSize::width().

Referenced by checkWorkspacePosition(), growHorizontal(), growVertical(), setFullScreen(), shrinkHorizontal(), and shrinkVertical().

void KWinInternal::Client::setActive bool  act,
bool  updateOpacity_ = true
 

Sets the client's active state to act.

This function does only change the visual appearance of the client, it does not change the focus setting. Use Workspace::activateClient() or Workspace::requestFocus() instead.

If a client receives or looses the focus, it calls setActive() on its own.

Definition at line 774 of file activation.cpp.

References KDecoration::activeChange(), KWinInternal::Options::activeWindowOpacity, QValueList::begin(), cancelAutoRaise(), QValueList::ConstIterator(), QValueList::end(), isModal(), mainClients(), KWinInternal::options, KWinInternal::Notify::raise(), KWinInternal::Workspace::setActiveClient(), setOpacity(), setShade(), transientFor(), KWinInternal::Options::translucentActiveWindows, KWinInternal::Workspace::updateClientLayer(), updateMouseGrab(), updateOpacity(), updateShadowSize(), and workspace().

Referenced by KWinInternal::Workspace::fakeRequestedActivity(), KWinInternal::Workspace::setActiveClient(), setShade(), KWinInternal::Workspace::takeActivity(), and KWinInternal::Workspace::unfakeActivity().

int KWinInternal::Client::desktop  )  const [inline]
 

Returns the virtual desktop within the workspace() the client window is located in, 0 if it isn't located on any special desktop (not mapped yet), or NET::OnAllDesktops. Do not use desktop() directly, use isOnDesktop() instead.

Definition at line 652 of file client.h.

Referenced by KWinInternal::Workspace::activateClient(), KWinInternal::Workspace::adjustClientPosition(), KWinInternal::Workspace::adjustClientSize(), belongsToLayer(), checkWorkspacePosition(), KWinInternal::Workspace::clientArea(), growHorizontal(), growVertical(), manage(), KWinInternal::Workspace::packPositionDown(), KWinInternal::Workspace::packPositionLeft(), KWinInternal::Workspace::packPositionRight(), KWinInternal::Workspace::packPositionUp(), KWinInternal::Placement::placeCascaded(), KWinInternal::Placement::placeSmart(), KWinInternal::Workspace::raiseOrLowerClient(), KWinInternal::Workspace::sendClientToDesktop(), KWinInternal::Workspace::storeSession(), KWinInternal::Workspace::takeActivity(), KWinInternal::Bridge::unobscuredRegion(), KWinInternal::Rules::update(), and KWinInternal::Workspace::updateCurrentTopMenu().

bool KWinInternal::Client::isOnDesktop int  d  )  const [inline]
 

Returns whether the client is on the virtual desktop d. This is always TRUE for onAllDesktops clients.

Definition at line 665 of file client.h.

References isOnAllDesktops().

Referenced by KWinInternal::Workspace::activateClient(), isOnCurrentDesktop(), KWinInternal::Workspace::sendClientToDesktop(), KWinInternal::Workspace::setCurrentDesktop(), KWinInternal::Workspace::takeActivity(), and KWinInternal::Workspace::updateCurrentTopMenu().

void KWinInternal::Client::setMaximize bool  vertically,
bool  horizontally
 

Sets the maximization according to vertically and horizontally

Definition at line 1720 of file geometry.cpp.

References KDecorationDefines::MaximizeHorizontal, and KDecorationDefines::MaximizeVertical.

Referenced by KWinInternal::WinInfo::changeState(), and maximize().

bool KWinInternal::Client::isMovable  )  const
 

Returns whether the window is moveable or has a fixed position.

Definition at line 1543 of file geometry.cpp.

References KWinInternal::WindowRules::checkPosition(), isFullScreen(), isOverride(), isSpecialWindow(), isSplash(), isToolbar(), KDecorationDefines::MaximizeFull, maximizeMode(), KDecorationOptions::moveResizeMaximizedWindows(), KWinInternal::options, and rules().

Referenced by isMaximizable(), manage(), KWinInternal::Workspace::slotWindowPackDown(), KWinInternal::Workspace::slotWindowPackLeft(), KWinInternal::Workspace::slotWindowPackRight(), and KWinInternal::Workspace::slotWindowPackUp().

bool KWinInternal::Client::isResizable  )  const
 

Returns whether the window is resizable or has a fixed size.

Definition at line 1559 of file geometry.cpp.

References KWinInternal::WindowRules::checkSize(), QSize::height(), isFullScreen(), isOverride(), isSpecialWindow(), isSplash(), isToolbar(), QSize::isValid(), KDecorationDefines::MaximizeFull, maximizeMode(), maxSize(), minSize(), KDecorationOptions::moveResizeMaximizedWindows(), KWinInternal::options, rules(), and QSize::width().

Referenced by growHorizontal(), growVertical(), isMaximizable(), NETMoveResize(), shrinkHorizontal(), and shrinkVertical().

void KWinInternal::Client::setGeometry int  x,
int  y,
int  w,
int  h,
ForceGeometry_t  force = NormalGeometrySet
 

Reimplemented to inform the client about the new window position.

Definition at line 1606 of file geometry.cpp.

References clientPos(), clientSize(), frameId(), QSize::height(), isShade(), shape(), updateShape(), QSize::width(), window(), wrapperId(), x(), and y().

Referenced by checkBorderSizes(), checkWorkspacePosition(), growHorizontal(), growVertical(), setFullScreen(), setGeometry(), setShade(), shrinkHorizontal(), shrinkVertical(), and updateDecoration().

void KWinInternal::Client::move int  x,
int  y,
ForceGeometry_t  force = NormalGeometrySet
 

Reimplemented to inform the client about the new window position.

Definition at line 1696 of file geometry.cpp.

References frameId(), QRect::moveTopLeft(), and QRect::topLeft().

Referenced by checkBorderSizes(), keepInArea(), manage(), move(), KWinInternal::Placement::placeAtRandom(), KWinInternal::Placement::placeCascaded(), KWinInternal::Placement::placeCentered(), KWinInternal::Placement::placeSmart(), KWinInternal::Placement::placeZeroCornered(), KWinInternal::Workspace::slotWindowPackDown(), KWinInternal::Workspace::slotWindowPackLeft(), KWinInternal::Workspace::slotWindowPackRight(), KWinInternal::Workspace::slotWindowPackUp(), and updateDecoration().

bool KWinInternal::Client::providesContextHelp  )  const
 

Returns whether the window provides context help or not. If it does, you should show a help menu item or a help button like '?' and call contextHelp() if this is invoked.

See also:
contextHelp()

Definition at line 1228 of file client.cpp.

bool KWinInternal::Client::performMouseCommand Options::MouseCommand  command,
QPoint  globalPos,
bool  handled = false
 

Performs a mouse command on this client (see options.h)

Definition at line 590 of file useractions.cpp.

Referenced by NETMoveResize().

QCString KWinInternal::Client::sessionId  ) 
 

Returns sessionId for this client, taken either from its window or from the leader window.

Definition at line 1515 of file client.cpp.

References QCString::isEmpty(), staticSessionId(), and window().

Referenced by KWinInternal::Workspace::storeSession(), and KWinInternal::Workspace::takeSessionInfo().

QCString KWinInternal::Client::wmCommand  ) 
 

Returns command property for this client, taken either from its window or from the leader window.

Definition at line 1527 of file client.cpp.

References QCString::isEmpty(), staticWmCommand(), and window().

Referenced by KWinInternal::Workspace::storeSession(), and KWinInternal::Workspace::takeSessionInfo().

QCString KWinInternal::Client::wmClientMachine bool  use_localhost  )  const
 

Returns client machine for this client, taken either from its window or from the leader window.

Definition at line 1548 of file client.cpp.

References KWinInternal::isLocalMachine().

Referenced by belongToSameApplication(), KWinInternal::Rules::match(), KWinInternal::Workspace::storeSession(), and KWinInternal::Workspace::takeSessionInfo().

Window KWinInternal::Client::wmClientLeader  )  const
 

Returns client leader window for this client. Returns the client window itself if no leader window is defined.

Definition at line 1563 of file client.cpp.

References window().

Referenced by belongToSameApplication(), and KWinInternal::Workspace::findClientLeaderGroup().

QRect KWinInternal::Client::adjustedClientArea const QRect desktopArea,
const QRect area
const
 

Returns area with the client's strut taken into account.

Used from Workspace in updateClientArea.

Definition at line 704 of file geometry.cpp.

References QRect::bottom(), geometry(), isTopMenu(), QRect::left(), QRect::right(), QRect::setBottom(), QRect::setLeft(), QRect::setRight(), QRect::setTop(), and QRect::top().

QString KWinInternal::Client::caption bool  full = true  )  const
 

Definition at line 1339 of file client.cpp.

Referenced by killWindow(), manage(), KWinInternal::Rules::match(), and KWinInternal::operator<<().

QCString KWinInternal::Client::staticWindowRole WId  w  )  [static]
 

Returns WM_WINDOW_ROLE property for a given window.

Definition at line 1459 of file client.cpp.

References KWinInternal::getStringProperty(), and QCString::lower().

Referenced by manage().

QCString KWinInternal::Client::staticSessionId WId  w  )  [static]
 

Returns SM_CLIENT_ID property for a given window.

Definition at line 1467 of file client.cpp.

References KWinInternal::getStringProperty().

Referenced by sessionId().

QCString KWinInternal::Client::staticWmCommand WId  w  )  [static]
 

Returns WM_COMMAND property for a given window.

Definition at line 1475 of file client.cpp.

References KWinInternal::getStringProperty().

Referenced by wmCommand().

Window KWinInternal::Client::staticWmClientLeader WId  w  )  [static]
 

Returns WM_CLIENT_LEADER property for a given window.

Definition at line 1483 of file client.cpp.

References KWinInternal::atoms, KWinInternal::nullErrorHandler(), and KWinInternal::Atoms::wm_client_leader.

void KWinInternal::Client::updateUserTime Time  time = CurrentTime  ) 
 

Updates the user time (time of last action in the active window). This is called inside kwin for every action with the window that qualifies for user interaction (clicking on it, activate it externally, etc.).

Definition at line 627 of file activation.cpp.

References KWinInternal::timestampCompare().

Referenced by KWinInternal::Workspace::activateClient(), keyPressEvent(), and windowEvent().

void KWinInternal::Client::minimize bool  avoid_animation = false  ) 
 

Minimizes this client plus its transients

Definition at line 544 of file client.cpp.

References isMinimizable(), isMinimized(), isOnCurrentDesktop(), mainClients(), KWinInternal::Notify::raise(), KWinInternal::Workspace::updateMinimizedOfTransients(), and workspace().

Referenced by manage().

void KWinInternal::Client::closeWindow  ) 
 

Closes the window by either sending a delete_window message or using XKill.

Definition at line 967 of file client.cpp.

References KWinInternal::atoms, group(), isCloseable(), killWindow(), KWinInternal::Notify::raise(), KWinInternal::Group::updateUserTime(), window(), KWinInternal::Atoms::wm_delete_window, and KWinInternal::Atoms::wm_protocols.

Referenced by KWinInternal::RootInfo::closeWindow().

void KWinInternal::Client::killWindow  ) 
 

Kills the window via XKill

Definition at line 994 of file client.cpp.

References caption(), destroyClient(), isDialog(), isNormalWindow(), KWinInternal::Notify::raise(), and window().

Referenced by closeWindow(), and KWinInternal::Workspace::killWindowId().

void KWinInternal::Client::showContextHelp  ) 
 

Invokes context help on the window. Only works if the window actually provides context help.

See also:
providesContextHelp()

Definition at line 1240 of file client.cpp.

References KWinInternal::atoms, QWhatsThis::enterWhatsThisMode(), KWinInternal::Atoms::net_wm_context_help, window(), and KWinInternal::Atoms::wm_protocols.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kwin Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Sep 30 18:40:46 2005 by doxygen 1.4.3 written by Dimitri van Heesch, © 1997-2003