2007-11-27 19:40:25 +00:00
|
|
|
/********************************************************************
|
2007-04-29 17:35:43 +00:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
|
|
|
Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
2007-11-27 19:40:25 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_CLIENT_H
|
|
|
|
#define KWIN_CLIENT_H
|
|
|
|
|
2007-06-25 08:51:44 +00:00
|
|
|
#include <config-X11.h>
|
|
|
|
|
2008-02-02 20:54:19 +00:00
|
|
|
#include <QFrame>
|
2007-04-29 17:35:43 +00:00
|
|
|
#include <QPixmap>
|
|
|
|
#include <netwm.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <kshortcut.h>
|
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
#include <fixx11h.h>
|
|
|
|
|
|
|
|
#include "utils.h"
|
|
|
|
#include "options.h"
|
|
|
|
#include "workspace.h"
|
|
|
|
#include "kdecoration.h"
|
|
|
|
#include "rules.h"
|
|
|
|
#include "toplevel.h"
|
2009-11-15 03:24:04 +00:00
|
|
|
#include "clientgroup.h"
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2007-06-25 08:51:44 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
#include <X11/extensions/sync.h>
|
|
|
|
#endif
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
// TODO: Cleanup the order of things in this .h file
|
|
|
|
|
2007-11-26 15:42:44 +00:00
|
|
|
class QProcess;
|
2007-04-29 17:35:43 +00:00
|
|
|
class QTimer;
|
|
|
|
class KStartupInfoData;
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
2009-09-13 11:36:45 +00:00
|
|
|
namespace TabBox {
|
|
|
|
|
|
|
|
class TabBoxClientImpl;
|
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
class Workspace;
|
|
|
|
class Client;
|
|
|
|
class Bridge;
|
2009-04-22 17:29:56 +00:00
|
|
|
class PaintRedirector;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
class Client
|
|
|
|
: public Toplevel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2008-12-18 13:50:57 +00:00
|
|
|
Client( Workspace* ws );
|
2007-04-29 17:35:43 +00:00
|
|
|
Window wrapperId() const;
|
|
|
|
Window decorationId() const;
|
|
|
|
|
|
|
|
const Client* transientFor() const;
|
|
|
|
Client* transientFor();
|
|
|
|
bool isTransient() const;
|
|
|
|
bool groupTransient() const;
|
|
|
|
bool wasOriginallyGroupTransient() const;
|
2008-12-18 13:50:57 +00:00
|
|
|
ClientList mainClients() const; // Call once before loop , is not indirect
|
|
|
|
ClientList allMainClients() const; // Call once before loop , is indirect
|
2007-04-29 17:35:43 +00:00
|
|
|
bool hasTransient( const Client* c, bool indirect ) const;
|
2008-12-18 13:50:57 +00:00
|
|
|
const ClientList& transients() const; // Is not indirect
|
2007-04-29 17:35:43 +00:00
|
|
|
void checkTransient( Window w );
|
|
|
|
Client* findModal( bool allow_itself = false );
|
|
|
|
const Group* group() const;
|
|
|
|
Group* group();
|
|
|
|
void checkGroup( Group* gr = NULL, bool force = false );
|
2007-04-30 09:44:32 +00:00
|
|
|
void changeClientLeaderGroup( Group* gr );
|
2007-04-29 17:35:43 +00:00
|
|
|
const WindowRules* rules() const;
|
|
|
|
void removeRule( Rules* r );
|
|
|
|
void setupWindowRules( bool ignore_temporary );
|
|
|
|
void applyWindowRules();
|
2007-04-30 12:24:10 +00:00
|
|
|
void updateWindowRules();
|
2008-11-17 08:03:39 +00:00
|
|
|
void updateFullscreenMonitors( NETFullscreenMonitors topology );
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
/**
|
|
|
|
* Returns true for "special" windows and false for windows which are "normal"
|
|
|
|
* (normal=window which has a border, can be moved by the user, can be closed, etc.)
|
|
|
|
* true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now)
|
|
|
|
* false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
|
|
|
|
*/
|
2007-04-29 17:35:43 +00:00
|
|
|
bool isSpecialWindow() const;
|
|
|
|
bool hasNETSupport() const;
|
|
|
|
|
|
|
|
QSize minSize() const;
|
|
|
|
QSize maxSize() const;
|
2008-12-18 13:50:57 +00:00
|
|
|
virtual QPoint clientPos() const; // Inside of geometry()
|
2007-07-18 15:01:59 +00:00
|
|
|
virtual QSize clientSize() const;
|
2009-06-11 20:12:11 +00:00
|
|
|
virtual QRect visibleRect() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
bool windowEvent( XEvent* e );
|
|
|
|
virtual bool eventFilter( QObject* o, QEvent* e );
|
2007-06-25 08:51:44 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
void syncEvent( XSyncAlarmNotifyEvent* e );
|
|
|
|
#endif
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
bool manage( Window w, bool isMapped );
|
|
|
|
void releaseWindow( bool on_shutdown = false );
|
|
|
|
void destroyClient();
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
/// How to resize the window in order to obey constains (mainly aspect ratios)
|
|
|
|
enum Sizemode
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
|
|
|
SizemodeAny,
|
2008-12-18 13:50:57 +00:00
|
|
|
SizemodeFixedW, ///< Try not to affect width
|
|
|
|
SizemodeFixedH, ///< Try not to affect height
|
|
|
|
SizemodeMax ///< Try not to make it larger in either direction
|
2007-04-29 17:35:43 +00:00
|
|
|
};
|
|
|
|
QSize adjustedSize( const QSize&, Sizemode mode = SizemodeAny ) const;
|
|
|
|
QSize adjustedSize() const;
|
|
|
|
|
|
|
|
QPixmap icon() const;
|
|
|
|
QPixmap miniIcon() const;
|
|
|
|
|
|
|
|
bool isActive() const;
|
|
|
|
void setActive( bool );
|
|
|
|
|
|
|
|
virtual int desktop() const;
|
|
|
|
void setDesktop( int );
|
|
|
|
void setOnAllDesktops( bool set );
|
2008-12-18 13:50:57 +00:00
|
|
|
|
2010-05-11 20:30:20 +00:00
|
|
|
virtual QStringList activities() const;
|
|
|
|
void setOnActivity( const QString &activity, bool enable );
|
|
|
|
void setOnAllActivities( bool set );
|
2010-05-19 22:32:57 +00:00
|
|
|
void setOnActivities( QStringList newActivitiesList );
|
|
|
|
void updateActivities( bool includeTransients );
|
2010-05-11 20:30:20 +00:00
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
/// Is not minimized and not hidden. I.e. normally visible on some virtual desktop.
|
2007-04-29 17:35:43 +00:00
|
|
|
bool isShown( bool shaded_is_shown ) const;
|
2008-12-18 13:50:57 +00:00
|
|
|
bool isHiddenInternal() const; // For compositing
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
bool isShade() const; // True only for ShadeNormal
|
|
|
|
ShadeMode shadeMode() const; // Prefer isShade()
|
2007-04-29 17:35:43 +00:00
|
|
|
void setShade( ShadeMode mode );
|
|
|
|
bool isShadeable() const;
|
|
|
|
|
|
|
|
bool isMinimized() const;
|
|
|
|
bool isMaximizable() const;
|
|
|
|
QRect geometryRestore() const;
|
|
|
|
MaximizeMode maximizeModeRestore() const;
|
|
|
|
MaximizeMode maximizeMode() const;
|
|
|
|
bool isMinimizable() const;
|
|
|
|
void setMaximize( bool vertically, bool horizontally );
|
|
|
|
QRect iconGeometry() const;
|
|
|
|
|
|
|
|
void setFullScreen( bool set, bool user );
|
|
|
|
bool isFullScreen() const;
|
|
|
|
bool isFullScreenable( bool fullscreen_hack = false ) const;
|
2008-08-23 09:20:42 +00:00
|
|
|
bool isActiveFullScreen() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
bool userCanSetFullScreen() const;
|
2008-12-18 13:50:57 +00:00
|
|
|
QRect geometryFSRestore() const { return geom_fs_restore; } // Only for session saving
|
2007-04-29 17:35:43 +00:00
|
|
|
int fullScreenMode() const { return fullscreen_mode; } // only for session saving
|
|
|
|
|
|
|
|
bool noBorder() const;
|
2008-03-23 00:12:11 +00:00
|
|
|
void setNoBorder( bool set );
|
|
|
|
bool userCanSetNoBorder() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
bool skipTaskbar( bool from_outside = false ) const;
|
|
|
|
void setSkipTaskbar( bool set, bool from_outside );
|
|
|
|
|
|
|
|
bool skipPager() const;
|
|
|
|
void setSkipPager( bool );
|
|
|
|
|
2010-05-03 20:04:44 +00:00
|
|
|
bool skipSwitcher() const;
|
|
|
|
void setSkipSwitcher( bool set );
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
bool keepAbove() const;
|
|
|
|
void setKeepAbove( bool );
|
|
|
|
bool keepBelow() const;
|
|
|
|
void setKeepBelow( bool );
|
|
|
|
Layer layer() const;
|
|
|
|
Layer belongsToLayer() const;
|
|
|
|
void invalidateLayer();
|
|
|
|
int sessionStackingOrder() const;
|
|
|
|
|
|
|
|
void setModal( bool modal );
|
|
|
|
bool isModal() const;
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
// Auxiliary functions, depend on the windowType
|
2007-04-29 17:35:43 +00:00
|
|
|
bool wantsTabFocus() const;
|
|
|
|
bool wantsInput() const;
|
|
|
|
|
|
|
|
bool isResizable() const;
|
|
|
|
bool isMovable() const;
|
2008-07-25 10:31:47 +00:00
|
|
|
bool isMovableAcrossScreens() const;
|
2008-12-18 13:50:57 +00:00
|
|
|
bool isCloseable() const; ///< May be closed by the user (May have a close button)
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
void takeActivity( int flags, bool handled, allowed_t ); // Takes ActivityFlags as arg (in utils.h)
|
2007-04-29 17:35:43 +00:00
|
|
|
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 );
|
2008-03-19 19:32:32 +00:00
|
|
|
bool checkBorderSizes( bool also_resize );
|
2009-04-22 17:29:56 +00:00
|
|
|
void triggerDecorationRepaint();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
void updateShape();
|
2008-12-18 13:50:57 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
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 );
|
2008-12-18 13:50:57 +00:00
|
|
|
void move( const QPoint& p, ForceGeometry_t force = NormalGeometrySet );
|
|
|
|
/// plainResize() simply resizes
|
2007-04-29 17:35:43 +00:00
|
|
|
void plainResize( int w, int h, ForceGeometry_t force = NormalGeometrySet );
|
|
|
|
void plainResize( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
|
2008-12-18 13:50:57 +00:00
|
|
|
/// resizeWithChecks() resizes according to gravity, and checks workarea position
|
2007-04-29 17:35:43 +00:00
|
|
|
void resizeWithChecks( int w, int h, ForceGeometry_t force = NormalGeometrySet );
|
|
|
|
void resizeWithChecks( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
|
|
|
|
void keepInArea( QRect area, bool partial = false );
|
2009-09-08 20:01:08 +00:00
|
|
|
void setElectricBorderMode( ElectricMaximizingMode mode );
|
|
|
|
ElectricMaximizingMode electricBorderMode() const;
|
|
|
|
void setElectricBorderMaximizing( bool maximizing );
|
|
|
|
bool isElectricBorderMaximizing() const;
|
|
|
|
QRect electricBorderMaximizeGeometry();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2009-11-16 02:53:12 +00:00
|
|
|
QSize sizeForClientSize( const QSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
|
|
|
|
|
2009-09-13 17:09:44 +00:00
|
|
|
/** Set the quick tile mode ("snap") of this window.
|
|
|
|
* This will also handle preserving and restoring of window geometry as necessary.
|
|
|
|
* @param mode The tile mode (left/right) to give this window.
|
|
|
|
*/
|
2009-12-23 01:36:44 +00:00
|
|
|
void setQuickTileMode( QuickTileMode mode, bool keyboard = false );
|
2009-09-13 17:09:44 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
void growHorizontal();
|
|
|
|
void shrinkHorizontal();
|
|
|
|
void growVertical();
|
|
|
|
void shrinkVertical();
|
|
|
|
|
|
|
|
bool providesContextHelp() const;
|
|
|
|
KShortcut shortcut() const;
|
|
|
|
void setShortcut( const QString& cut );
|
|
|
|
|
2009-11-17 07:17:49 +00:00
|
|
|
WindowOperation mouseButtonToWindowOperation( Qt::MouseButtons button );
|
2008-12-18 13:50:57 +00:00
|
|
|
bool performMouseCommand( Options::MouseCommand, const QPoint& globalPos, bool handled = false );
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
QRect adjustedClientArea( const QRect& desktop, const QRect& area ) const;
|
|
|
|
|
|
|
|
Colormap colormap() const;
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
/// Updates visibility depending on being shaded, virtual desktop, etc.
|
2007-04-29 17:35:43 +00:00
|
|
|
void updateVisibility();
|
2008-12-18 13:50:57 +00:00
|
|
|
/// Hides a client - Basically like minimize, but without effects, it's simply hidden
|
2007-04-29 17:35:43 +00:00
|
|
|
void hideClient( bool hide );
|
2008-12-18 13:50:57 +00:00
|
|
|
bool hiddenPreview() const; ///< Window is mapped in order to get a window pixmap
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2008-08-12 11:02:58 +00:00
|
|
|
virtual void setupCompositing();
|
|
|
|
virtual void finishCompositing();
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
QString caption( bool full = true ) const;
|
|
|
|
void updateCaption();
|
|
|
|
|
|
|
|
void keyPressEvent( uint key_code ); // FRAME ??
|
|
|
|
void updateMouseGrab();
|
|
|
|
Window moveResizeGrabWindow() const;
|
|
|
|
|
|
|
|
const QPoint calculateGravitation( bool invert, int gravity = 0 ) const; // FRAME public?
|
|
|
|
|
|
|
|
void NETMoveResize( int x_root, int y_root, NET::Direction direction );
|
|
|
|
void NETMoveResizeWindow( int flags, int x, int y, int width, int height );
|
2008-12-18 13:50:57 +00:00
|
|
|
void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp,
|
|
|
|
bool send_event = false );
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
void gotPing( Time timestamp );
|
|
|
|
|
|
|
|
void checkWorkspacePosition();
|
|
|
|
void updateUserTime( Time time = CurrentTime );
|
|
|
|
Time userTime() const;
|
|
|
|
bool hasUserTimeSupport() const;
|
|
|
|
bool ignoreFocusStealing() const;
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
/// Does 'delete c;'
|
2007-04-29 17:35:43 +00:00
|
|
|
static void deleteClient( Client* c, allowed_t );
|
|
|
|
|
|
|
|
static bool belongToSameApplication( const Client* c1, const Client* c2, bool active_hack = false );
|
|
|
|
static bool sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool active_hack );
|
|
|
|
static void readIcons( Window win, QPixmap* icon, QPixmap* miniicon );
|
|
|
|
|
|
|
|
void minimize( bool avoid_animation = false );
|
|
|
|
void unminimize( bool avoid_animation = false );
|
|
|
|
void closeWindow();
|
|
|
|
void killWindow();
|
|
|
|
void maximize( MaximizeMode );
|
|
|
|
void toggleShade();
|
|
|
|
void showContextHelp();
|
2008-12-15 08:27:17 +00:00
|
|
|
void cancelShadeHoverTimer();
|
2007-04-29 17:35:43 +00:00
|
|
|
void cancelAutoRaise();
|
|
|
|
void checkActiveModal();
|
2009-02-17 15:50:00 +00:00
|
|
|
StrutRect strutRect( StrutArea area ) const;
|
|
|
|
StrutRects strutRects() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
bool hasStrut() const;
|
2009-11-15 03:24:04 +00:00
|
|
|
|
|
|
|
// Tabbing functions
|
|
|
|
ClientGroup* clientGroup() const; // Returns a pointer to client_group
|
|
|
|
void setClientGroup( ClientGroup* group );
|
|
|
|
/*
|
|
|
|
* If shown is true the client is mapped and raised, if false
|
|
|
|
* the client is unmapped and hidden, this function is called
|
|
|
|
* when the tabbing group of the client switches its visible
|
|
|
|
* client.
|
|
|
|
*/
|
|
|
|
void setClientShown( bool shown );
|
|
|
|
/*
|
|
|
|
* When a click is done in the decoration and it calls the group
|
|
|
|
* to change the visible client it starts to move-resize the new
|
|
|
|
* client, this function stops it.
|
|
|
|
*/
|
|
|
|
void dontMoveResize();
|
|
|
|
|
2009-02-15 16:37:42 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the window has a strut that expands through the invisible area of
|
|
|
|
* an xinerama setup where the monitors are not the same resolution.
|
|
|
|
*/
|
|
|
|
bool hasOffscreenXineramaStrut() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
bool isMove() const
|
|
|
|
{
|
|
|
|
return moveResizeMode && mode == PositionCenter;
|
|
|
|
}
|
|
|
|
bool isResize() const
|
|
|
|
{
|
|
|
|
return moveResizeMode && mode != PositionCenter;
|
|
|
|
}
|
2008-12-18 13:50:57 +00:00
|
|
|
|
2008-10-17 10:30:43 +00:00
|
|
|
// Decorations <-> Effects
|
2009-04-22 17:29:56 +00:00
|
|
|
const QPixmap *topDecoPixmap() const { return &decorationPixmapTop; }
|
|
|
|
const QPixmap *leftDecoPixmap() const { return &decorationPixmapLeft; }
|
|
|
|
const QPixmap *bottomDecoPixmap() const { return &decorationPixmapBottom; }
|
|
|
|
const QPixmap *rightDecoPixmap() const { return &decorationPixmapRight; }
|
|
|
|
|
2009-07-29 11:07:28 +00:00
|
|
|
int paddingLeft() const { return padding_left; }
|
|
|
|
int paddingRight() const { return padding_right; }
|
|
|
|
int paddingTop() const { return padding_top; }
|
|
|
|
int paddingBottom() const { return padding_bottom; }
|
|
|
|
|
2009-04-22 19:00:51 +00:00
|
|
|
bool decorationPixmapRequiresRepaint();
|
2009-04-22 17:29:56 +00:00
|
|
|
void ensureDecorationPixmapsPainted();
|
|
|
|
|
2009-05-04 22:35:33 +00:00
|
|
|
QRect decorationRect() const {
|
2009-05-27 16:08:26 +00:00
|
|
|
return (decoration && decoration->widget()) ?
|
|
|
|
decoration->widget()->rect().translated(-padding_left, -padding_top) :
|
|
|
|
QRect(0, 0, width(), height());
|
2009-05-04 22:35:33 +00:00
|
|
|
}
|
|
|
|
|
2009-11-25 23:32:35 +00:00
|
|
|
QRect transparentRect() const;
|
|
|
|
|
2009-11-08 19:47:58 +00:00
|
|
|
QRegion decorationPendingRegion() const;
|
|
|
|
|
2009-05-04 22:35:33 +00:00
|
|
|
enum CoordinateMode {
|
|
|
|
DecorationRelative, // Relative to the top left corner of the decoration
|
|
|
|
WindowRelative // Relative to the top left corner of the window
|
|
|
|
};
|
|
|
|
void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom, CoordinateMode mode) const;
|
2009-07-29 11:48:55 +00:00
|
|
|
virtual void addRepaintFull();
|
2009-05-04 22:35:33 +00:00
|
|
|
|
2009-09-13 11:36:45 +00:00
|
|
|
TabBox::TabBoxClientImpl* tabBoxClient() const { return m_tabBoxClient; }
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
private slots:
|
|
|
|
void autoRaise();
|
|
|
|
void shadeHover();
|
2008-12-15 08:27:17 +00:00
|
|
|
void shadeUnhover();
|
2007-04-29 17:35:43 +00:00
|
|
|
void shortcutActivated();
|
2007-05-22 15:46:42 +00:00
|
|
|
void delayedMoveResize();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
friend class Bridge; // FRAME
|
|
|
|
virtual void processMousePressEvent( QMouseEvent* e );
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
private:
|
|
|
|
// Use Workspace::createClient()
|
|
|
|
virtual ~Client(); ///< Use destroyClient() or releaseWindow()
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
Position mousePosition( const QPoint& ) const;
|
2007-05-22 15:46:42 +00:00
|
|
|
void updateCursor();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
// Transparent stuff
|
2007-04-29 17:35:43 +00:00
|
|
|
void drawbound( const QRect& geom );
|
|
|
|
void clearbound();
|
|
|
|
void doDrawbound( const QRect& geom, bool clear );
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
// Handlers for X11 events
|
2007-04-29 17:35:43 +00:00
|
|
|
bool mapRequestEvent( XMapRequestEvent* e );
|
2008-12-18 13:50:57 +00:00
|
|
|
void unmapNotifyEvent( XUnmapEvent* e );
|
|
|
|
void destroyNotifyEvent( XDestroyWindowEvent* e );
|
2007-04-29 17:35:43 +00:00
|
|
|
void configureRequestEvent( XConfigureRequestEvent* e );
|
|
|
|
virtual void propertyNotifyEvent( XPropertyEvent* e );
|
|
|
|
void clientMessageEvent( XClientMessageEvent* e );
|
|
|
|
void enterNotifyEvent( XCrossingEvent* e );
|
|
|
|
void leaveNotifyEvent( XCrossingEvent* e );
|
|
|
|
void focusInEvent( XFocusInEvent* e );
|
|
|
|
void focusOutEvent( XFocusOutEvent* e );
|
2007-06-25 08:51:44 +00:00
|
|
|
#ifdef HAVE_XDAMAGE
|
|
|
|
virtual void damageNotifyEvent( XDamageNotifyEvent* e );
|
|
|
|
#endif
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
bool buttonPressEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
|
|
|
|
bool buttonReleaseEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
|
|
|
|
bool motionNotifyEvent( Window w, int state, int x, int y, int x_root, int y_root );
|
2010-01-09 09:49:52 +00:00
|
|
|
void checkQuickTilingMaximizationZones( int xroot, int yroot );
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2009-11-17 07:17:49 +00:00
|
|
|
bool processDecorationButtonPress( int button, int state, int x, int y, int x_root, int y_root,
|
|
|
|
bool ignoreMenu = false );
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void debug( kdbgstream& stream ) const;
|
2008-08-24 13:32:57 +00:00
|
|
|
virtual bool shouldUnredirect() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void pingTimeout();
|
|
|
|
void processKillerExited();
|
|
|
|
void demandAttentionKNotify();
|
2007-06-25 08:51:44 +00:00
|
|
|
void syncTimeout();
|
2008-09-30 12:03:20 +00:00
|
|
|
void delayedSetShortcut();
|
2009-04-22 17:29:56 +00:00
|
|
|
void repaintDecorationPending();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
private:
|
2008-12-18 13:50:57 +00:00
|
|
|
void exportMappingState( int s ); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1
|
|
|
|
bool isManaged() const; ///< Returns false if this client is not yet managed
|
2007-04-29 17:35:43 +00:00
|
|
|
void updateAllowedActions( bool force = false );
|
2008-11-17 08:03:39 +00:00
|
|
|
QRect fullscreenMonitorsArea( NETFullscreenMonitors topology ) const;
|
2007-04-29 17:35:43 +00:00
|
|
|
void changeMaximize( bool horizontal, bool vertical, bool adjust );
|
|
|
|
void checkMaximizeGeometry();
|
2008-12-18 13:50:57 +00:00
|
|
|
int checkFullScreenHack( const QRect& geom ) const; // 0 - None, 1 - One xinerama screen, 2 - Full area
|
2007-04-29 17:35:43 +00:00
|
|
|
void updateFullScreenHack( const QRect& geom );
|
|
|
|
void getWmNormalHints();
|
|
|
|
void getMotifHints();
|
|
|
|
void getIcons();
|
|
|
|
void fetchName();
|
|
|
|
void fetchIconicName();
|
|
|
|
QString readName() const;
|
|
|
|
void setCaption( const QString& s, bool force = false );
|
|
|
|
bool hasTransientInternal( const Client* c, bool indirect, ConstClientList& set ) const;
|
|
|
|
void finishWindowRules();
|
|
|
|
void setShortcutInternal( const KShortcut& cut );
|
|
|
|
|
|
|
|
void checkDirection( int new_diff, int old_diff, QRect& rect, const QRect& area );
|
|
|
|
void configureRequest( int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool );
|
|
|
|
NETExtendedStrut strut() const;
|
|
|
|
int checkShadeGeometry( int w, int h );
|
|
|
|
void blockGeometryUpdates( bool block );
|
2007-06-25 08:51:44 +00:00
|
|
|
void getSyncCounter();
|
|
|
|
void sendSyncRequest();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
bool startMoveResize();
|
|
|
|
void finishMoveResize( bool cancel );
|
|
|
|
void leaveMoveResize();
|
|
|
|
void checkUnrestrictedMoveResize();
|
|
|
|
void handleMoveResize( int x, int y, int x_root, int y_root );
|
2007-05-22 15:46:42 +00:00
|
|
|
void startDelayedMoveResize();
|
|
|
|
void stopDelayedMoveResize();
|
2007-04-29 17:35:43 +00:00
|
|
|
void positionGeometryTip();
|
|
|
|
void grabButton( int mod );
|
|
|
|
void ungrabButton( int mod );
|
|
|
|
void resetMaximize();
|
|
|
|
void resizeDecoration( const QSize& s );
|
2007-06-25 08:51:44 +00:00
|
|
|
void performMoveResize();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
void pingWindow();
|
|
|
|
void killProcess( bool ask, Time timestamp = CurrentTime );
|
|
|
|
void updateUrgency();
|
|
|
|
static void sendClientMessage( Window w, Atom a, Atom protocol,
|
|
|
|
long data1 = 0, long data2 = 0, long data3 = 0 );
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
void embedClient( Window w, const XWindowAttributes& attr );
|
2007-04-29 17:35:43 +00:00
|
|
|
void detectNoBorder();
|
|
|
|
void destroyDecoration();
|
|
|
|
void updateFrameExtents();
|
|
|
|
|
2008-08-12 11:02:58 +00:00
|
|
|
void internalShow( allowed_t );
|
|
|
|
void internalHide( allowed_t );
|
|
|
|
void internalKeep( allowed_t );
|
|
|
|
void map( allowed_t );
|
|
|
|
void unmap( allowed_t );
|
|
|
|
void updateHiddenPreview();
|
|
|
|
|
2007-07-04 09:51:10 +00:00
|
|
|
void updateInputShape();
|
2009-04-22 17:29:56 +00:00
|
|
|
void repaintDecorationPixmap( QPixmap& pix, const QRect& r, const QPixmap& src, QRegion reg );
|
|
|
|
void resizeDecorationPixmaps();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
Time readUserTimeMapTimestamp( const KStartupInfoId* asn_id, const KStartupInfoData* asn_data,
|
|
|
|
bool session ) const;
|
|
|
|
Time readUserCreationTime() const;
|
|
|
|
void startupIdChanged();
|
2008-12-18 13:50:57 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
Window client;
|
|
|
|
Window wrapper;
|
|
|
|
KDecoration* decoration;
|
|
|
|
Bridge* bridge;
|
|
|
|
int desk;
|
2010-05-11 20:30:20 +00:00
|
|
|
QStringList activityList;
|
2007-04-29 17:35:43 +00:00
|
|
|
bool buttonDown;
|
|
|
|
bool moveResizeMode;
|
|
|
|
bool move_faked_activity;
|
|
|
|
Window move_resize_grab_window;
|
|
|
|
bool move_resize_has_keyboard_grab;
|
|
|
|
bool unrestrictedMoveResize;
|
|
|
|
|
|
|
|
Position mode;
|
|
|
|
QPoint moveOffset;
|
|
|
|
QPoint invertedMoveOffset;
|
|
|
|
QRect moveResizeGeom;
|
|
|
|
QRect initialMoveResizeGeom;
|
2008-12-18 13:50:57 +00:00
|
|
|
XSizeHints xSizeHint;
|
2007-04-29 17:35:43 +00:00
|
|
|
void sendSyntheticConfigureNotify();
|
2008-08-12 11:02:58 +00:00
|
|
|
enum MappingState
|
|
|
|
{
|
2008-12-18 13:50:57 +00:00
|
|
|
Withdrawn, ///< Not handled, as per ICCCM WithdrawnState
|
|
|
|
Mapped, ///< The frame is mapped
|
|
|
|
Unmapped, ///< The frame is not mapped
|
|
|
|
Kept ///< The frame should be unmapped, but is kept (For compositing)
|
2008-08-12 11:02:58 +00:00
|
|
|
};
|
|
|
|
MappingState mapping_state;
|
2009-09-13 17:09:44 +00:00
|
|
|
|
|
|
|
/** The quick tile mode of this window.
|
|
|
|
*/
|
|
|
|
QuickTileMode quick_tile_mode;
|
2009-10-14 09:33:00 +00:00
|
|
|
QRect geom_pretile;
|
2009-09-13 17:09:44 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
void readTransient();
|
|
|
|
Window verifyTransientFor( Window transient_for, bool set );
|
|
|
|
void addTransient( Client* cl );
|
|
|
|
void removeTransient( Client* cl );
|
|
|
|
void removeFromMainClients();
|
|
|
|
void cleanGrouping();
|
|
|
|
void checkGroupTransients();
|
|
|
|
void setTransient( Window new_transient_for_id );
|
|
|
|
Client* transient_for;
|
|
|
|
Window transient_for_id;
|
|
|
|
Window original_transient_for_id;
|
2008-12-18 13:50:57 +00:00
|
|
|
ClientList transients_list; // SELI TODO: Make this ordered in stacking order?
|
2007-04-29 17:35:43 +00:00
|
|
|
ShadeMode shade_mode;
|
2008-12-18 13:50:57 +00:00
|
|
|
uint active : 1;
|
|
|
|
uint deleting : 1; ///< True when doing cleanup and destroying the client
|
|
|
|
uint keep_above : 1; ///< NET::KeepAbove (was stays_on_top)
|
|
|
|
uint skip_taskbar : 1;
|
|
|
|
uint original_skip_taskbar : 1; ///< Unaffected by KWin
|
|
|
|
uint Pdeletewindow : 1; ///< Does the window understand the DeleteWindow protocol?
|
|
|
|
uint Ptakefocus : 1;///< Does the window understand the TakeFocus protocol?
|
|
|
|
uint Ptakeactivity : 1; ///< Does it support _NET_WM_TAKE_ACTIVITY
|
|
|
|
uint Pcontexthelp : 1; ///< Does the window understand the ContextHelp protocol?
|
|
|
|
uint Pping : 1; ///< Does it support _NET_WM_PING?
|
|
|
|
uint input : 1; ///< Does the window want input in its wm_hints
|
2007-04-29 17:35:43 +00:00
|
|
|
uint skip_pager : 1;
|
2010-05-03 20:04:44 +00:00
|
|
|
uint skip_switcher : 1;
|
2007-04-29 17:35:43 +00:00
|
|
|
uint motif_may_resize : 1;
|
2008-12-18 13:50:57 +00:00
|
|
|
uint motif_may_move : 1;
|
2007-04-29 17:35:43 +00:00
|
|
|
uint motif_may_close : 1;
|
2008-12-18 13:50:57 +00:00
|
|
|
uint keep_below : 1; ///< NET::KeepBelow
|
2007-04-29 17:35:43 +00:00
|
|
|
uint minimized : 1;
|
2008-12-18 13:50:57 +00:00
|
|
|
uint hidden : 1; ///< Forcibly hidden by calling hide()
|
|
|
|
uint modal : 1; ///< NET::Modal
|
2007-04-29 17:35:43 +00:00
|
|
|
uint noborder : 1;
|
2009-10-03 14:32:24 +00:00
|
|
|
uint app_noborder : 1; ///< App requested no border via window type, shape extension, etc.
|
|
|
|
uint motif_noborder : 1; ///< App requested no border via Motif WM hints
|
2008-12-18 13:50:57 +00:00
|
|
|
uint urgency : 1; ///< XWMHints, UrgencyHint
|
|
|
|
uint ignore_focus_stealing : 1; ///< Don't apply focus stealing prevention to this client
|
2007-04-29 17:35:43 +00:00
|
|
|
uint demands_attention : 1;
|
|
|
|
WindowRules client_rules;
|
|
|
|
void getWMHints();
|
|
|
|
void readIcons();
|
|
|
|
void getWindowProtocols();
|
|
|
|
QPixmap icon_pix;
|
|
|
|
QPixmap miniicon_pix;
|
|
|
|
QCursor cursor;
|
2008-12-18 13:50:57 +00:00
|
|
|
// DON'T reorder - Saved to config files !!!
|
|
|
|
enum FullScreenMode
|
|
|
|
{
|
|
|
|
FullScreenNone,
|
|
|
|
FullScreenNormal,
|
|
|
|
FullScreenHack ///< Non-NETWM fullscreen (noborder and size of desktop)
|
|
|
|
};
|
2007-04-29 17:35:43 +00:00
|
|
|
FullScreenMode fullscreen_mode;
|
|
|
|
MaximizeMode max_mode;
|
|
|
|
QRect geom_restore;
|
|
|
|
QRect geom_fs_restore;
|
|
|
|
MaximizeMode maxmode_restore;
|
|
|
|
QTimer* autoRaiseTimer;
|
|
|
|
QTimer* shadeHoverTimer;
|
2007-05-22 15:46:42 +00:00
|
|
|
QTimer* delayedMoveResizeTimer;
|
2007-04-29 17:35:43 +00:00
|
|
|
Colormap cmap;
|
|
|
|
QString cap_normal, cap_iconic, cap_suffix;
|
|
|
|
Group* in_group;
|
|
|
|
Window window_group;
|
2009-11-15 03:24:04 +00:00
|
|
|
ClientGroup* client_group;
|
2007-04-29 17:35:43 +00:00
|
|
|
Layer in_layer;
|
|
|
|
QTimer* ping_timer;
|
2007-11-26 15:42:44 +00:00
|
|
|
QProcess* process_killer;
|
2007-04-29 17:35:43 +00:00
|
|
|
Time ping_timestamp;
|
|
|
|
Time user_time;
|
|
|
|
unsigned long allowed_actions;
|
|
|
|
QSize client_size;
|
2008-12-18 13:50:57 +00:00
|
|
|
int block_geometry_updates; // > 0 = New geometry is remembered, but not actually set
|
|
|
|
enum PendingGeometry_t
|
|
|
|
{
|
|
|
|
PendingGeometryNone,
|
|
|
|
PendingGeometryNormal,
|
|
|
|
PendingGeometryForced
|
|
|
|
};
|
2007-06-19 15:40:09 +00:00
|
|
|
PendingGeometry_t pending_geometry_update;
|
2007-04-29 17:35:43 +00:00
|
|
|
QRect geom_before_block;
|
2009-05-04 23:19:42 +00:00
|
|
|
QRect deco_rect_before_block;
|
2007-04-29 17:35:43 +00:00
|
|
|
bool shade_geometry_change;
|
2007-06-25 08:51:44 +00:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
XSyncCounter sync_counter;
|
|
|
|
XSyncValue sync_counter_value;
|
|
|
|
XSyncAlarm sync_alarm;
|
|
|
|
#endif
|
|
|
|
QTimer* sync_timeout;
|
|
|
|
bool sync_resize_pending;
|
2007-04-29 17:35:43 +00:00
|
|
|
int border_left, border_right, border_top, border_bottom;
|
2009-05-04 22:35:33 +00:00
|
|
|
int padding_left, padding_right, padding_top, padding_bottom;
|
2007-04-29 17:35:43 +00:00
|
|
|
QRegion _mask;
|
2008-12-18 13:50:57 +00:00
|
|
|
static bool check_active_modal; ///< \see Client::checkActiveModal()
|
2007-04-29 17:35:43 +00:00
|
|
|
KShortcut _shortcut;
|
|
|
|
int sm_stacking_order;
|
|
|
|
friend struct FetchNameInternalPredicate;
|
|
|
|
friend struct CheckIgnoreFocusStealingProcedure;
|
|
|
|
friend struct ResetupRulesProcedure;
|
|
|
|
friend class GeometryUpdatesBlocker;
|
|
|
|
QTimer* demandAttentionKNotifyTimer;
|
2009-04-22 17:29:56 +00:00
|
|
|
QPixmap decorationPixmapLeft, decorationPixmapRight, decorationPixmapTop, decorationPixmapBottom;
|
|
|
|
PaintRedirector* paintRedirector;
|
2009-09-13 11:36:45 +00:00
|
|
|
TabBox::TabBoxClientImpl* m_tabBoxClient;
|
2007-04-30 09:45:07 +00:00
|
|
|
|
2009-09-08 20:01:08 +00:00
|
|
|
bool electricMaximizing;
|
|
|
|
ElectricMaximizingMode electricMode;
|
|
|
|
|
2007-04-30 09:45:07 +00:00
|
|
|
friend bool performTransiencyCheck();
|
2007-04-29 17:35:43 +00:00
|
|
|
};
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
/**
|
|
|
|
* Helper for Client::blockGeometryUpdates() being called in pairs (true/false)
|
|
|
|
*/
|
2007-04-29 17:35:43 +00:00
|
|
|
class GeometryUpdatesBlocker
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GeometryUpdatesBlocker( Client* c )
|
|
|
|
: cl( c ) { cl->blockGeometryUpdates( true ); }
|
|
|
|
~GeometryUpdatesBlocker()
|
|
|
|
{ cl->blockGeometryUpdates( false ); }
|
2008-12-18 13:50:57 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
private:
|
|
|
|
Client* cl;
|
|
|
|
};
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
/**
|
|
|
|
* NET WM Protocol handler class
|
|
|
|
*/
|
2008-11-17 08:03:39 +00:00
|
|
|
class WinInfo : public NETWinInfo2
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
|
|
|
private:
|
2008-12-18 13:50:57 +00:00
|
|
|
typedef KWin::Client Client; // Because of NET::Client
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
public:
|
|
|
|
WinInfo( Client* c, Display * display, Window window,
|
2008-12-18 13:50:57 +00:00
|
|
|
Window rwin, const unsigned long pr[], int pr_size );
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void changeDesktop(int desktop);
|
2008-11-17 08:03:39 +00:00
|
|
|
virtual void changeFullscreenMonitors(NETFullscreenMonitors topology);
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void changeState( unsigned long state, unsigned long mask );
|
|
|
|
void disable();
|
2008-12-18 13:50:57 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
private:
|
|
|
|
Client * m_client;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline Window Client::wrapperId() const
|
|
|
|
{
|
|
|
|
return wrapper;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline Window Client::decorationId() const
|
|
|
|
{
|
|
|
|
return decoration != NULL ? decoration->widget()->winId() : None;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const Client* Client::transientFor() const
|
|
|
|
{
|
|
|
|
return transient_for;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline Client* Client::transientFor()
|
|
|
|
{
|
|
|
|
return transient_for;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool Client::groupTransient() const
|
|
|
|
{
|
2007-07-19 16:24:51 +00:00
|
|
|
return transient_for_id == rootWindow();
|
2007-04-29 17:35:43 +00:00
|
|
|
}
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
// Needed because verifyTransientFor() may set transient_for_id to root window,
|
2007-04-29 17:35:43 +00:00
|
|
|
// if the original value has a problem (window doesn't exist, etc.)
|
|
|
|
inline bool Client::wasOriginallyGroupTransient() const
|
|
|
|
{
|
2007-07-19 16:24:51 +00:00
|
|
|
return original_transient_for_id == rootWindow();
|
2007-04-29 17:35:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline bool Client::isTransient() const
|
|
|
|
{
|
|
|
|
return transient_for_id != None;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const ClientList& Client::transients() const
|
|
|
|
{
|
|
|
|
return transients_list;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const Group* Client::group() const
|
|
|
|
{
|
|
|
|
return in_group;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline Group* Client::group()
|
|
|
|
{
|
|
|
|
return in_group;
|
|
|
|
}
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
inline void Client::setClientGroup( ClientGroup* group )
|
|
|
|
{
|
|
|
|
client_group = group;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline ClientGroup* Client::clientGroup() const
|
|
|
|
{
|
|
|
|
return client_group;
|
|
|
|
}
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
inline bool Client::isMinimized() const
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
|
|
|
return minimized;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool Client::isActive() const
|
|
|
|
{
|
|
|
|
return active;
|
|
|
|
}
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
inline bool Client::isShown( bool shaded_is_shown ) const
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
2009-11-15 03:24:04 +00:00
|
|
|
return !isMinimized() && ( !isShade() || shaded_is_shown ) && !hidden &&
|
|
|
|
( clientGroup() == NULL || clientGroup()->visible() == this );
|
2007-04-29 17:35:43 +00:00
|
|
|
}
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
inline bool Client::isHiddenInternal() const
|
2008-02-23 13:41:53 +00:00
|
|
|
{
|
|
|
|
return hidden;
|
|
|
|
}
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
inline bool Client::isShade() const
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
|
|
|
return shade_mode == ShadeNormal;
|
|
|
|
}
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
inline ShadeMode Client::shadeMode() const
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
|
|
|
return shade_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline QPixmap Client::icon() const
|
|
|
|
{
|
|
|
|
return icon_pix;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline QPixmap Client::miniIcon() const
|
|
|
|
{
|
|
|
|
return miniicon_pix;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline QRect Client::geometryRestore() const
|
|
|
|
{
|
|
|
|
return geom_restore;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline Client::MaximizeMode Client::maximizeModeRestore() const
|
|
|
|
{
|
|
|
|
return maxmode_restore;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline Client::MaximizeMode Client::maximizeMode() const
|
|
|
|
{
|
|
|
|
return max_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool Client::skipTaskbar( bool from_outside ) const
|
|
|
|
{
|
|
|
|
return from_outside ? original_skip_taskbar : skip_taskbar;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool Client::skipPager() const
|
|
|
|
{
|
|
|
|
return skip_pager;
|
|
|
|
}
|
|
|
|
|
2010-05-03 20:04:44 +00:00
|
|
|
inline bool Client::skipSwitcher() const
|
|
|
|
{
|
|
|
|
return skip_switcher;
|
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
inline bool Client::keepAbove() const
|
|
|
|
{
|
|
|
|
return keep_above;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool Client::keepBelow() const
|
|
|
|
{
|
|
|
|
return keep_below;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool Client::isFullScreen() const
|
|
|
|
{
|
|
|
|
return fullscreen_mode != FullScreenNone;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool Client::isModal() const
|
|
|
|
{
|
|
|
|
return modal;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool Client::hasNETSupport() const
|
|
|
|
{
|
|
|
|
return info->hasNETSupport();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline Colormap Client::colormap() const
|
|
|
|
{
|
|
|
|
return cmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void Client::invalidateLayer()
|
|
|
|
{
|
|
|
|
in_layer = UnknownLayer;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline int Client::sessionStackingOrder() const
|
|
|
|
{
|
|
|
|
return sm_stacking_order;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool Client::isManaged() const
|
|
|
|
{
|
2008-08-12 11:02:58 +00:00
|
|
|
return mapping_state != Withdrawn;
|
2007-04-29 17:35:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline QPoint Client::clientPos() const
|
|
|
|
{
|
|
|
|
return QPoint( border_left, border_top );
|
|
|
|
}
|
|
|
|
|
|
|
|
inline QSize Client::clientSize() const
|
|
|
|
{
|
|
|
|
return client_size;
|
|
|
|
}
|
|
|
|
|
2009-06-11 20:12:11 +00:00
|
|
|
inline QRect Client::visibleRect() const
|
|
|
|
{
|
|
|
|
return geometry().adjusted( -padding_left, -padding_top, padding_right, padding_bottom );
|
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
inline void Client::setGeometry( const QRect& r, ForceGeometry_t force )
|
|
|
|
{
|
|
|
|
setGeometry( r.x(), r.y(), r.width(), r.height(), force );
|
|
|
|
}
|
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
inline void Client::move( const QPoint& p, ForceGeometry_t force )
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
|
|
|
move( p.x(), p.y(), force );
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void Client::plainResize( const QSize& s, ForceGeometry_t force )
|
|
|
|
{
|
|
|
|
plainResize( s.width(), s.height(), force );
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void Client::resizeWithChecks( const QSize& s, ForceGeometry_t force )
|
|
|
|
{
|
|
|
|
resizeWithChecks( s.width(), s.height(), force );
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool Client::hasUserTimeSupport() const
|
|
|
|
{
|
|
|
|
return info->userTime() != -1U;
|
|
|
|
}
|
2008-12-18 13:50:57 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
inline bool Client::ignoreFocusStealing() const
|
|
|
|
{
|
|
|
|
return ignore_focus_stealing;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const WindowRules* Client::rules() const
|
|
|
|
{
|
|
|
|
return &client_rules;
|
|
|
|
}
|
|
|
|
|
|
|
|
KWIN_PROCEDURE( CheckIgnoreFocusStealingProcedure, Client, cl->ignore_focus_stealing = options->checkIgnoreFocusStealing( cl ));
|
|
|
|
|
|
|
|
inline Window Client::moveResizeGrabWindow() const
|
|
|
|
{
|
|
|
|
return move_resize_grab_window;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline KShortcut Client::shortcut() const
|
|
|
|
{
|
|
|
|
return _shortcut;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void Client::removeRule( Rules* rule )
|
|
|
|
{
|
|
|
|
client_rules.remove( rule );
|
|
|
|
}
|
|
|
|
|
2007-07-04 09:51:10 +00:00
|
|
|
inline bool Client::hiddenPreview() const
|
|
|
|
{
|
2008-08-12 11:02:58 +00:00
|
|
|
return mapping_state == Kept;
|
2007-07-04 09:51:10 +00:00
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
KWIN_COMPARE_PREDICATE( WrapperIdMatchPredicate, Client, Window, cl->wrapperId() == value );
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|