2007-11-27 22:40:25 +03:00
|
|
|
/********************************************************************
|
2007-04-29 21:35:43 +04: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 22:40:25 +03: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 21:35:43 +04:00
|
|
|
|
|
|
|
#ifndef KWIN_CLIENT_H
|
|
|
|
#define KWIN_CLIENT_H
|
|
|
|
|
2013-04-26 13:52:15 +04:00
|
|
|
// kwin
|
2007-04-29 21:35:43 +04:00
|
|
|
#include "options.h"
|
|
|
|
#include "rules.h"
|
2012-01-12 10:42:55 +04:00
|
|
|
#include "tabgroup.h"
|
2013-04-26 13:52:15 +04:00
|
|
|
#include "toplevel.h"
|
2013-02-04 14:20:15 +04:00
|
|
|
#include "xcbutils.h"
|
2013-04-26 13:52:15 +04:00
|
|
|
// KDE
|
|
|
|
#include <KDE/KShortcut>
|
|
|
|
#include <KDE/NETWinInfo>
|
|
|
|
// Qt
|
|
|
|
#include <QPixmap>
|
|
|
|
// X
|
2007-06-25 12:51:44 +04:00
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
#include <X11/extensions/sync.h>
|
|
|
|
#endif
|
2013-04-26 13:52:15 +04:00
|
|
|
#include <X11/Xutil.h>
|
|
|
|
#include <fixx11h.h>
|
2007-06-25 12:51:44 +04:00
|
|
|
|
2008-12-18 16:50:57 +03:00
|
|
|
// TODO: Cleanup the order of things in this .h file
|
|
|
|
|
2007-04-29 21:35:43 +04:00
|
|
|
class QTimer;
|
|
|
|
class KStartupInfoData;
|
2013-04-26 13:52:15 +04:00
|
|
|
class KStartupInfoId;
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
2011-01-30 17:34:42 +03:00
|
|
|
namespace TabBox
|
|
|
|
{
|
2009-09-13 15:36:45 +04:00
|
|
|
|
|
|
|
class TabBoxClientImpl;
|
|
|
|
}
|
|
|
|
|
2007-04-29 21:35:43 +04:00
|
|
|
class Bridge;
|
2009-04-22 21:29:56 +04:00
|
|
|
class PaintRedirector;
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
class Client
|
|
|
|
: public Toplevel
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
Q_OBJECT
|
2011-12-22 17:39:55 +04:00
|
|
|
/**
|
|
|
|
* Whether this Client is active or not. Use Workspace::activateClient() to activate a Client.
|
|
|
|
* @see Workspace::activateClient
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
|
2011-12-22 17:53:11 +04:00
|
|
|
/**
|
|
|
|
* The Caption of the Client. Read from WM_NAME property together with a suffix for hostname and shortcut.
|
|
|
|
* To read only the caption as provided by WM_NAME, use the getter with an additional @c false value.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(QString caption READ caption NOTIFY captionChanged)
|
2011-12-22 17:56:56 +04:00
|
|
|
/**
|
|
|
|
* Whether the window can be closed by the user. The value is evaluated each time the getter is called.
|
|
|
|
* Because of that no changed signal is provided.
|
|
|
|
**/
|
2011-12-18 13:29:32 +04:00
|
|
|
Q_PROPERTY(bool closeable READ isCloseable)
|
2011-12-22 18:02:35 +04:00
|
|
|
/**
|
|
|
|
* The desktop this Client is on. If the Client is on all desktops the property has value -1.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(int desktop READ desktop WRITE setDesktop NOTIFY desktopChanged)
|
2012-06-22 11:29:32 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client is on all desktops. That is desktop is -1.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool onAllDesktops READ isOnAllDesktops WRITE setOnAllDesktops NOTIFY desktopChanged)
|
2011-12-22 18:34:55 +04:00
|
|
|
/**
|
|
|
|
* Whether this Client is fullScreen. A Client might either be fullScreen due to the _NET_WM property
|
|
|
|
* or through a legacy support hack. The fullScreen state can only be changed if the Client does not
|
|
|
|
* use the legacy hack. To be sure whether the state changed, connect to the notify signal.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen NOTIFY fullScreenChanged)
|
2011-12-22 18:43:35 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client can be set to fullScreen. The property is evaluated each time it is invoked.
|
|
|
|
* Because of that there is no notify signal.
|
|
|
|
**/
|
2011-12-18 13:29:32 +04:00
|
|
|
Q_PROPERTY(bool fullScreenable READ isFullScreenable)
|
2011-12-22 22:38:52 +04:00
|
|
|
/**
|
|
|
|
* The geometry of this Client. Be aware that depending on resize mode the geometryChanged signal
|
|
|
|
* might be emitted at each resize step or only at the end of the resize operation.
|
|
|
|
**/
|
2011-12-18 13:29:32 +04:00
|
|
|
Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry)
|
2011-12-22 21:28:24 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client is set to be kept above other windows.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool keepAbove READ keepAbove WRITE setKeepAbove NOTIFY keepAboveChanged)
|
|
|
|
/**
|
|
|
|
* Whether the Client is set to be kept below other windows.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool keepBelow READ keepBelow WRITE setKeepBelow NOTIFY keepBelowChanged)
|
2011-12-22 21:30:37 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client can be maximized both horizontally and vertically.
|
|
|
|
* The property is evaluated each time it is invoked.
|
|
|
|
* Because of that there is no notify signal.
|
|
|
|
**/
|
2011-12-18 13:29:32 +04:00
|
|
|
Q_PROPERTY(bool maximizable READ isMaximizable)
|
2011-12-22 21:30:37 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client can be minimized. The property is evaluated each time it is invoked.
|
|
|
|
* Because of that there is no notify signal.
|
|
|
|
**/
|
2011-12-18 13:29:32 +04:00
|
|
|
Q_PROPERTY(bool minimizable READ isMinimizable)
|
2011-12-22 22:01:01 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client is minimized.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool minimized READ isMinimized WRITE setMinimized NOTIFY minimizedChanged)
|
2011-12-22 20:54:07 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client represents a modal window.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool modal READ isModal NOTIFY modalChanged)
|
2011-12-22 21:16:04 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client is moveable. Even if it is not moveable, it might be possible to move
|
|
|
|
* it to another screen. The property is evaluated each time it is invoked.
|
|
|
|
* Because of that there is no notify signal.
|
|
|
|
* @see moveableAcrossScreens
|
|
|
|
**/
|
2011-12-18 13:29:32 +04:00
|
|
|
Q_PROPERTY(bool moveable READ isMovable)
|
2011-12-22 21:16:04 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client can be moved to another screen. The property is evaluated each time it is invoked.
|
|
|
|
* Because of that there is no notify signal.
|
|
|
|
* @see moveable
|
|
|
|
**/
|
2011-12-18 13:29:32 +04:00
|
|
|
Q_PROPERTY(bool moveableAcrossScreens READ isMovableAcrossScreens)
|
2011-12-22 20:54:59 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client provides context help. Mostly needed by decorations to decide whether to
|
|
|
|
* show the help button or not.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool providesContextHelp READ providesContextHelp CONSTANT)
|
2011-12-22 21:16:04 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client can be resized. The property is evaluated each time it is invoked.
|
|
|
|
* Because of that there is no notify signal.
|
|
|
|
**/
|
2011-12-18 13:29:32 +04:00
|
|
|
Q_PROPERTY(bool resizeable READ isResizable)
|
2011-12-22 21:10:18 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client can be shaded. The property is evaluated each time it is invoked.
|
|
|
|
* Because of that there is no notify signal.
|
|
|
|
**/
|
2011-12-18 13:29:32 +04:00
|
|
|
Q_PROPERTY(bool shadeable READ isShadeable)
|
2011-12-22 21:10:18 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client is shaded.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool shade READ isShade WRITE setShade NOTIFY shadeChanged)
|
2011-12-22 20:00:08 +04:00
|
|
|
/**
|
|
|
|
* Whether the Client is a transient Window to another Window.
|
|
|
|
* @see transientFor
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool transient READ isTransient NOTIFY transientChanged)
|
|
|
|
/**
|
|
|
|
* The Client to which this Client is a transient if any.
|
|
|
|
**/
|
2012-01-01 17:16:07 +04:00
|
|
|
Q_PROPERTY(KWin::Client *transientFor READ transientFor NOTIFY transientChanged)
|
2011-12-29 13:19:36 +04:00
|
|
|
/**
|
|
|
|
* By how much the window wishes to grow/shrink at least. Usually QSize(1,1).
|
|
|
|
* MAY BE DISOBEYED BY THE WM! It's only for information, do NOT rely on it at all.
|
|
|
|
* The value is evaluated each time the getter is called.
|
|
|
|
* Because of that no changed signal is provided.
|
|
|
|
*/
|
|
|
|
Q_PROPERTY(QSize basicUnit READ basicUnit)
|
|
|
|
/**
|
|
|
|
* Whether the Client is currently being moved by the user.
|
|
|
|
* Notify signal is emitted when the Client starts or ends move/resize mode.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool move READ isMove NOTIFY moveResizedChanged)
|
|
|
|
/**
|
|
|
|
* Whether the Client is currently being resized by the user.
|
|
|
|
* Notify signal is emitted when the Client starts or ends move/resize mode.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool resize READ isResize NOTIFY moveResizedChanged)
|
|
|
|
/**
|
|
|
|
* The optional geometry representing the minimized Client in e.g a taskbar.
|
|
|
|
* See _NET_WM_ICON_GEOMETRY at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .
|
|
|
|
* The value is evaluated each time the getter is called.
|
|
|
|
* Because of that no changed signal is provided.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(QRect iconGeometry READ iconGeometry)
|
|
|
|
/**
|
|
|
|
* Returns whether the window is any of special windows types (desktop, dock, splash, ...),
|
|
|
|
* i.e. window types that usually don't have a window frame and the user does not use window
|
|
|
|
* management (moving, raising,...) on them.
|
|
|
|
* The value is evaluated each time the getter is called.
|
|
|
|
* Because of that no changed signal is provided.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool specialWindow READ isSpecialWindow)
|
|
|
|
/**
|
|
|
|
* Whether the Client can accept keyboard focus.
|
|
|
|
* The value is evaluated each time the getter is called.
|
|
|
|
* Because of that no changed signal is provided.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool wantsInput READ wantsInput)
|
|
|
|
// TODO: a QIcon with all icon sizes?
|
|
|
|
Q_PROPERTY(QPixmap icon READ icon NOTIFY iconChanged)
|
|
|
|
/**
|
|
|
|
* Whether the Client should be excluded from window switching effects.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool skipSwitcher READ skipSwitcher WRITE setSkipSwitcher NOTIFY skipSwitcherChanged)
|
2012-02-28 00:09:36 +04:00
|
|
|
/**
|
|
|
|
* Indicates that the window should not be included on a taskbar.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool skipTaskbar READ skipTaskbar WRITE setSkipTaskbar NOTIFY skipTaskbarChanged)
|
|
|
|
/**
|
|
|
|
* Indicates that the window should not be included on a Pager.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool skipPager READ skipPager WRITE setSkipPager NOTIFY skipPagerChanged)
|
2012-01-01 17:31:11 +04:00
|
|
|
/**
|
|
|
|
* The "Window Tabs" Group this Client belongs to.
|
|
|
|
**/
|
2012-04-21 14:03:49 +04:00
|
|
|
Q_PROPERTY(KWin::TabGroup* tabGroup READ tabGroup NOTIFY tabGroupChanged SCRIPTABLE false)
|
2012-01-15 14:26:38 +04:00
|
|
|
/**
|
|
|
|
* Whether this Client is the currently visible Client in its Client Group (Window Tabs).
|
|
|
|
* For change connect to the visibleChanged signal on the Client's Group.
|
|
|
|
**/
|
2012-01-12 10:42:55 +04:00
|
|
|
Q_PROPERTY(bool isCurrentTab READ isCurrentTab)
|
2012-01-27 11:08:00 +04:00
|
|
|
/**
|
|
|
|
* Minimum size as specified in WM_NORMAL_HINTS
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(QSize minSize READ minSize)
|
|
|
|
/**
|
|
|
|
* Maximum size as specified in WM_NORMAL_HINTS
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(QSize maxSize READ maxSize)
|
|
|
|
/**
|
|
|
|
* Whether the window has a decoration or not.
|
|
|
|
* This property is not allowed to be set by applications themselves.
|
|
|
|
* The decision whether a window has a border or not belongs to the window manager.
|
|
|
|
* If this property gets abused by application developers, it will be removed again.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool noBorder READ noBorder WRITE setNoBorder)
|
2012-03-09 13:17:19 +04:00
|
|
|
/**
|
|
|
|
* Whether window state _NET_WM_STATE_DEMANDS_ATTENTION is set. This state indicates that some
|
|
|
|
* action in or with the window happened. For example, it may be set by the Window Manager if
|
|
|
|
* the window requested activation but the Window Manager refused it, or the application may set
|
|
|
|
* it if it finished some work. This state may be set by both the Client and the Window Manager.
|
|
|
|
* It should be unset by the Window Manager when it decides the window got the required attention
|
|
|
|
* (usually, that it got activated).
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool demandsAttention READ isDemandingAttention WRITE demandAttention NOTIFY demandsAttentionChanged)
|
2012-03-31 21:09:00 +04:00
|
|
|
/**
|
|
|
|
* A client can block compositing. That is while the Client is alive and the state is set,
|
|
|
|
* Compositing is suspended and is resumed when there are no Clients blocking compositing any
|
|
|
|
* more.
|
|
|
|
*
|
|
|
|
* This is actually set by a window property, unfortunately not used by the target application
|
|
|
|
* group. For convenience it's exported as a property to the scripts.
|
|
|
|
*
|
|
|
|
* Use with care!
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool blocksCompositing READ isBlockingCompositing WRITE setBlockingCompositing NOTIFY blockingCompositingChanged)
|
2012-10-12 13:34:05 +04:00
|
|
|
/**
|
|
|
|
* Whether the decoration is currently using an alpha channel.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool decorationHasAlpha READ decorationHasAlpha)
|
2011-01-30 17:34:42 +03:00
|
|
|
public:
|
2013-05-08 15:39:06 +04:00
|
|
|
explicit Client();
|
2013-05-02 20:26:05 +04:00
|
|
|
xcb_window_t wrapperId() const;
|
2013-05-03 11:36:20 +04:00
|
|
|
xcb_window_t decorationId() const;
|
2013-02-04 14:20:15 +04:00
|
|
|
xcb_window_t inputId() const { return m_decoInputExtent; }
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
const Client* transientFor() const;
|
|
|
|
Client* transientFor();
|
|
|
|
bool isTransient() const;
|
|
|
|
bool groupTransient() const;
|
|
|
|
bool wasOriginallyGroupTransient() const;
|
|
|
|
ClientList mainClients() const; // Call once before loop , is not indirect
|
|
|
|
ClientList allMainClients() const; // Call once before loop , is indirect
|
|
|
|
bool hasTransient(const Client* c, bool indirect) const;
|
|
|
|
const ClientList& transients() const; // Is not indirect
|
2013-05-03 10:53:35 +04:00
|
|
|
void checkTransient(xcb_window_t w);
|
2011-01-30 17:34:42 +03:00
|
|
|
Client* findModal(bool allow_itself = false);
|
|
|
|
const Group* group() const;
|
|
|
|
Group* group();
|
|
|
|
void checkGroup(Group* gr = NULL, bool force = false);
|
|
|
|
void changeClientLeaderGroup(Group* gr);
|
|
|
|
const WindowRules* rules() const;
|
|
|
|
void removeRule(Rules* r);
|
|
|
|
void setupWindowRules(bool ignore_temporary);
|
|
|
|
void applyWindowRules();
|
2012-02-05 21:50:23 +04:00
|
|
|
void updateWindowRules(Rules::Types selection);
|
2011-01-30 17:34:42 +03:00
|
|
|
void updateFullscreenMonitors(NETFullscreenMonitors topology);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
bool isSpecialWindow() const;
|
|
|
|
bool hasNETSupport() const;
|
|
|
|
|
|
|
|
QSize minSize() const;
|
|
|
|
QSize maxSize() const;
|
2011-11-03 02:05:03 +04:00
|
|
|
QSize basicUnit() const;
|
2011-01-30 17:34:42 +03:00
|
|
|
virtual QPoint clientPos() const; // Inside of geometry()
|
|
|
|
virtual QSize clientSize() const;
|
2011-11-09 23:39:13 +04:00
|
|
|
QPoint inputPos() const { return input_offset; } // Inside of geometry()
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
bool windowEvent(XEvent* e);
|
|
|
|
virtual bool eventFilter(QObject* o, QEvent* e);
|
2007-06-25 12:51:44 +04:00
|
|
|
#ifdef HAVE_XSYNC
|
2011-01-30 17:34:42 +03:00
|
|
|
void syncEvent(XSyncAlarmNotifyEvent* e);
|
2007-06-25 12:51:44 +04:00
|
|
|
#endif
|
2012-09-06 11:09:31 +04:00
|
|
|
NET::WindowType windowType(bool direct = false, int supported_types = 0) const;
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2013-05-03 12:20:05 +04:00
|
|
|
bool manage(xcb_window_t w, bool isMapped);
|
2011-01-30 17:34:42 +03:00
|
|
|
void releaseWindow(bool on_shutdown = false);
|
|
|
|
void destroyClient();
|
|
|
|
|
|
|
|
/// How to resize the window in order to obey constains (mainly aspect ratios)
|
|
|
|
enum Sizemode {
|
|
|
|
SizemodeAny,
|
|
|
|
SizemodeFixedW, ///< Try not to affect width
|
|
|
|
SizemodeFixedH, ///< Try not to affect height
|
|
|
|
SizemodeMax ///< Try not to make it larger in either direction
|
|
|
|
};
|
|
|
|
QSize adjustedSize(const QSize&, Sizemode mode = SizemodeAny) const;
|
|
|
|
QSize adjustedSize() const;
|
|
|
|
|
|
|
|
QPixmap icon() const;
|
|
|
|
QPixmap icon(const QSize& size) const;
|
|
|
|
QPixmap miniIcon() const;
|
|
|
|
QPixmap bigIcon() const;
|
|
|
|
QPixmap hugeIcon() const;
|
|
|
|
|
|
|
|
bool isActive() const;
|
|
|
|
void setActive(bool);
|
|
|
|
|
|
|
|
virtual int desktop() const;
|
|
|
|
void setDesktop(int);
|
|
|
|
void setOnAllDesktops(bool set);
|
|
|
|
|
|
|
|
virtual QStringList activities() const;
|
|
|
|
void setOnActivity(const QString &activity, bool enable);
|
|
|
|
void setOnAllActivities(bool set);
|
|
|
|
void setOnActivities(QStringList newActivitiesList);
|
|
|
|
void updateActivities(bool includeTransients);
|
2013-03-25 00:57:26 +04:00
|
|
|
void blockActivityUpdates(bool b = true);
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
/// Is not minimized and not hidden. I.e. normally visible on some virtual desktop.
|
|
|
|
bool isShown(bool shaded_is_shown) const;
|
|
|
|
bool isHiddenInternal() const; // For compositing
|
|
|
|
|
|
|
|
bool isShade() const; // True only for ShadeNormal
|
|
|
|
ShadeMode shadeMode() const; // Prefer isShade()
|
2011-12-22 21:10:18 +04:00
|
|
|
void setShade(bool set);
|
2011-01-30 17:34:42 +03:00
|
|
|
void setShade(ShadeMode mode);
|
|
|
|
bool isShadeable() const;
|
|
|
|
|
|
|
|
bool isMinimized() const;
|
|
|
|
bool isMaximizable() const;
|
|
|
|
QRect geometryRestore() const;
|
|
|
|
MaximizeMode maximizeMode() const;
|
2012-03-16 03:15:13 +04:00
|
|
|
QuickTileMode quickTileMode() const;
|
2011-01-30 17:34:42 +03:00
|
|
|
bool isMinimizable() const;
|
|
|
|
void setMaximize(bool vertically, bool horizontally);
|
|
|
|
QRect iconGeometry() const;
|
|
|
|
|
2011-12-22 18:34:55 +04:00
|
|
|
void setFullScreen(bool set, bool user = true);
|
2011-01-30 17:34:42 +03:00
|
|
|
bool isFullScreen() const;
|
|
|
|
bool isFullScreenable(bool fullscreen_hack = false) const;
|
|
|
|
bool isActiveFullScreen() const;
|
|
|
|
bool userCanSetFullScreen() const;
|
|
|
|
QRect geometryFSRestore() const {
|
|
|
|
return geom_fs_restore; // Only for session saving
|
|
|
|
}
|
|
|
|
int fullScreenMode() const {
|
|
|
|
return fullscreen_mode; // only for session saving
|
|
|
|
}
|
|
|
|
|
|
|
|
bool noBorder() const;
|
|
|
|
void setNoBorder(bool set);
|
|
|
|
bool userCanSetNoBorder() const;
|
|
|
|
void checkNoBorder();
|
|
|
|
|
|
|
|
bool skipTaskbar(bool from_outside = false) const;
|
2012-02-28 00:09:36 +04:00
|
|
|
void setSkipTaskbar(bool set, bool from_outside = false);
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
bool skipPager() const;
|
|
|
|
void setSkipPager(bool);
|
|
|
|
|
|
|
|
bool skipSwitcher() const;
|
|
|
|
void setSkipSwitcher(bool set);
|
|
|
|
|
|
|
|
bool keepAbove() const;
|
|
|
|
void setKeepAbove(bool);
|
|
|
|
bool keepBelow() const;
|
|
|
|
void setKeepBelow(bool);
|
2012-04-07 18:43:27 +04:00
|
|
|
virtual Layer layer() const;
|
2011-01-30 17:34:42 +03:00
|
|
|
Layer belongsToLayer() const;
|
|
|
|
void invalidateLayer();
|
|
|
|
int sessionStackingOrder() const;
|
|
|
|
|
|
|
|
void setModal(bool modal);
|
|
|
|
bool isModal() const;
|
|
|
|
|
|
|
|
// Auxiliary functions, depend on the windowType
|
|
|
|
bool wantsTabFocus() const;
|
|
|
|
bool wantsInput() const;
|
|
|
|
|
|
|
|
bool isResizable() const;
|
|
|
|
bool isMovable() const;
|
|
|
|
bool isMovableAcrossScreens() const;
|
|
|
|
bool isCloseable() const; ///< May be closed by the user (May have a close button)
|
|
|
|
|
2013-04-26 11:47:45 +04:00
|
|
|
void takeActivity(int flags, bool handled); // Takes ActivityFlags as arg (in utils.h)
|
|
|
|
void takeFocus();
|
2012-03-09 13:17:19 +04:00
|
|
|
bool isDemandingAttention() const {
|
|
|
|
return demands_attention;
|
|
|
|
}
|
2011-01-30 17:34:42 +03:00
|
|
|
void demandAttention(bool set = true);
|
|
|
|
|
2013-02-04 16:48:09 +04:00
|
|
|
void setMask(const QRegion& r, int mode = XCB_CLIP_ORDERING_UNSORTED);
|
2011-01-30 17:34:42 +03:00
|
|
|
QRegion mask() const;
|
|
|
|
|
|
|
|
void updateDecoration(bool check_workspace_pos, bool force = false);
|
|
|
|
bool checkBorderSizes(bool also_resize);
|
|
|
|
void triggerDecorationRepaint();
|
|
|
|
|
|
|
|
void updateShape();
|
|
|
|
|
2011-12-22 22:38:52 +04:00
|
|
|
void setGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet);
|
|
|
|
void setGeometry(const QRect& r, ForceGeometry_t force = NormalGeometrySet);
|
2011-01-30 17:34:42 +03:00
|
|
|
void move(int x, int y, ForceGeometry_t force = NormalGeometrySet);
|
|
|
|
void move(const QPoint& p, ForceGeometry_t force = NormalGeometrySet);
|
|
|
|
/// plainResize() simply resizes
|
2011-12-22 22:38:52 +04:00
|
|
|
void plainResize(int w, int h, ForceGeometry_t force = NormalGeometrySet);
|
|
|
|
void plainResize(const QSize& s, ForceGeometry_t force = NormalGeometrySet);
|
2011-01-30 17:34:42 +03:00
|
|
|
/// resizeWithChecks() resizes according to gravity, and checks workarea position
|
|
|
|
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);
|
2011-03-08 00:31:44 +03:00
|
|
|
void setElectricBorderMode(QuickTileMode mode);
|
|
|
|
QuickTileMode electricBorderMode() const;
|
2011-01-30 17:34:42 +03:00
|
|
|
void setElectricBorderMaximizing(bool maximizing);
|
|
|
|
bool isElectricBorderMaximizing() const;
|
2011-03-08 00:31:44 +03:00
|
|
|
QRect electricBorderMaximizeGeometry(QPoint pos, int desktop);
|
2011-01-30 17:34:42 +03:00
|
|
|
QSize sizeForClientSize(const QSize&, Sizemode mode = SizemodeAny, bool noframe = false) const;
|
|
|
|
|
|
|
|
/** 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.
|
|
|
|
*/
|
|
|
|
void setQuickTileMode(QuickTileMode mode, bool keyboard = false);
|
|
|
|
|
|
|
|
void growHorizontal();
|
|
|
|
void shrinkHorizontal();
|
|
|
|
void growVertical();
|
|
|
|
void shrinkVertical();
|
|
|
|
|
|
|
|
bool providesContextHelp() const;
|
|
|
|
KShortcut shortcut() const;
|
|
|
|
void setShortcut(const QString& cut);
|
|
|
|
|
|
|
|
WindowOperation mouseButtonToWindowOperation(Qt::MouseButtons button);
|
|
|
|
bool performMouseCommand(Options::MouseCommand, const QPoint& globalPos, bool handled = false);
|
|
|
|
|
|
|
|
QRect adjustedClientArea(const QRect& desktop, const QRect& area) const;
|
|
|
|
|
2013-05-03 13:46:18 +04:00
|
|
|
xcb_colormap_t colormap() const;
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
/// Updates visibility depending on being shaded, virtual desktop, etc.
|
|
|
|
void updateVisibility();
|
|
|
|
/// Hides a client - Basically like minimize, but without effects, it's simply hidden
|
|
|
|
void hideClient(bool hide);
|
|
|
|
bool hiddenPreview() const; ///< Window is mapped in order to get a window pixmap
|
|
|
|
|
2012-04-28 11:39:39 +04:00
|
|
|
virtual bool setupCompositing();
|
2011-01-30 17:34:42 +03:00
|
|
|
virtual void finishCompositing();
|
2012-03-31 21:09:00 +04:00
|
|
|
void setBlockingCompositing(bool block);
|
2011-03-20 17:42:05 +03:00
|
|
|
inline bool isBlockingCompositing() { return blocks_compositing; }
|
|
|
|
void updateCompositeBlocking(bool readProperty = false);
|
2011-01-30 17:34:42 +03:00
|
|
|
|
2012-10-17 00:42:19 +04:00
|
|
|
QString caption(bool full = true, bool stripped = false) const;
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
void keyPressEvent(uint key_code); // FRAME ??
|
|
|
|
void updateMouseGrab();
|
2013-05-02 21:04:43 +04:00
|
|
|
xcb_window_t moveResizeGrabWindow() const;
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
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);
|
2013-05-03 12:27:04 +04:00
|
|
|
void restackWindow(xcb_window_t above, int detail, NET::RequestSource source, xcb_timestamp_t timestamp,
|
2011-01-30 17:34:42 +03:00
|
|
|
bool send_event = false);
|
|
|
|
|
2013-05-03 13:35:46 +04:00
|
|
|
void gotPing(xcb_timestamp_t timestamp);
|
2011-01-30 17:34:42 +03:00
|
|
|
|
2011-09-29 19:52:19 +04:00
|
|
|
void checkWorkspacePosition(QRect oldGeometry = QRect(), int oldDesktop = -2);
|
2013-05-03 13:29:50 +04:00
|
|
|
void updateUserTime(xcb_timestamp_t time = XCB_TIME_CURRENT_TIME);
|
|
|
|
xcb_timestamp_t userTime() const;
|
2011-01-30 17:34:42 +03:00
|
|
|
bool hasUserTimeSupport() const;
|
|
|
|
|
|
|
|
/// Does 'delete c;'
|
2013-04-26 11:47:45 +04:00
|
|
|
static void deleteClient(Client* c);
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
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);
|
2013-05-03 12:29:13 +04:00
|
|
|
static void readIcons(xcb_window_t win, QPixmap* icon, QPixmap* miniicon, QPixmap* bigicon, QPixmap* hugeicon);
|
2011-01-30 17:34:42 +03:00
|
|
|
|
2011-12-22 22:01:01 +04:00
|
|
|
void setMinimized(bool set);
|
2011-01-30 17:34:42 +03:00
|
|
|
void minimize(bool avoid_animation = false);
|
|
|
|
void unminimize(bool avoid_animation = false);
|
|
|
|
void killWindow();
|
|
|
|
void maximize(MaximizeMode);
|
|
|
|
void toggleShade();
|
|
|
|
void showContextHelp();
|
|
|
|
void cancelShadeHoverTimer();
|
|
|
|
void cancelAutoRaise();
|
|
|
|
void checkActiveModal();
|
|
|
|
StrutRect strutRect(StrutArea area) const;
|
|
|
|
StrutRects strutRects() const;
|
|
|
|
bool hasStrut() const;
|
|
|
|
|
|
|
|
// Tabbing functions
|
2012-01-12 10:42:55 +04:00
|
|
|
TabGroup* tabGroup() const; // Returns a pointer to client_group
|
|
|
|
Q_INVOKABLE inline bool tabBefore(Client *other, bool activate) { return tabTo(other, false, activate); }
|
|
|
|
Q_INVOKABLE inline bool tabBehind(Client *other, bool activate) { return tabTo(other, true, activate); }
|
2012-04-23 00:27:04 +04:00
|
|
|
/**
|
|
|
|
* Syncs the *dynamic* @param property @param fromThisClient or the @link currentTab() to
|
|
|
|
* all members of the @link tabGroup() (if there is one)
|
|
|
|
*
|
|
|
|
* eg. if you call:
|
|
|
|
* client->setProperty("kwin_tiling_floats", true);
|
|
|
|
* client->syncTabGroupFor("kwin_tiling_floats", true)
|
|
|
|
* all clients in this tabGroup will have ::property("kwin_tiling_floats").toBool() == true
|
|
|
|
*
|
|
|
|
* WARNING: non dynamic properties are ignored - you're not supposed to alter/update such explicitly
|
|
|
|
*/
|
|
|
|
Q_INVOKABLE void syncTabGroupFor(QString property, bool fromThisClient = false);
|
2012-12-29 18:36:55 +04:00
|
|
|
Q_INVOKABLE bool untab(const QRect &toGeometry = QRect(), bool clientRemoved = false);
|
2012-01-12 10:42:55 +04:00
|
|
|
/**
|
|
|
|
* Set tab group - this is to be invoked by TabGroup::add/remove(client) and NO ONE ELSE
|
|
|
|
*/
|
|
|
|
void setTabGroup(TabGroup* group);
|
2011-01-30 17:34:42 +03:00
|
|
|
/*
|
|
|
|
* 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();
|
2012-01-12 10:42:55 +04:00
|
|
|
bool isCurrentTab() const;
|
2011-01-30 17:34:42 +03: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;
|
|
|
|
|
|
|
|
bool isMove() const {
|
|
|
|
return moveResizeMode && mode == PositionCenter;
|
|
|
|
}
|
|
|
|
bool isResize() const {
|
|
|
|
return moveResizeMode && mode != PositionCenter;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Decorations <-> Effects
|
2012-09-28 13:59:42 +04:00
|
|
|
PaintRedirector *decorationPaintRedirector() {
|
|
|
|
return paintRedirector;
|
2011-01-30 17:34:42 +03: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;
|
|
|
|
}
|
|
|
|
|
2011-04-10 23:24:27 +04:00
|
|
|
QRect decorationRect() const;
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
QRect transparentRect() const;
|
|
|
|
|
|
|
|
QRegion decorationPendingRegion() const;
|
|
|
|
|
2012-10-12 13:34:05 +04:00
|
|
|
bool decorationHasAlpha() const;
|
|
|
|
|
2013-02-17 04:56:01 +04:00
|
|
|
Position titlebarPosition();
|
|
|
|
|
2011-01-30 17:34:42 +03: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;
|
|
|
|
|
2012-05-20 17:52:24 +04:00
|
|
|
QWeakPointer<TabBox::TabBoxClientImpl> tabBoxClient() const {
|
|
|
|
return m_tabBoxClient.toWeakRef();
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2011-12-01 16:15:11 +04:00
|
|
|
bool isFirstInTabBox() const {
|
|
|
|
return m_firstInTabBox;
|
|
|
|
}
|
|
|
|
void setFirstInTabBox(bool enable) {
|
|
|
|
m_firstInTabBox = enable;
|
|
|
|
}
|
|
|
|
void updateFirstInTabBox();
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
//sets whether the client should be treated as a SessionInteract window
|
|
|
|
void setSessionInteract(bool needed);
|
2012-01-15 13:51:09 +04:00
|
|
|
virtual bool isClient() const;
|
2013-04-15 22:43:50 +04:00
|
|
|
// a helper for the workspace window packing. tests for screen validity and updates since in maximization case as with normal moving
|
|
|
|
void packTo(int left, int top);
|
2011-01-30 17:34:42 +03:00
|
|
|
|
2012-11-09 16:44:50 +04:00
|
|
|
#ifdef KWIN_BUILD_KAPPMENU
|
|
|
|
// Used by workspace
|
|
|
|
void emitShowRequest() {
|
|
|
|
emit showRequest();
|
|
|
|
}
|
|
|
|
void emitMenuHidden() {
|
|
|
|
emit menuHidden();
|
|
|
|
}
|
|
|
|
void setAppMenuAvailable();
|
|
|
|
void setAppMenuUnavailable();
|
|
|
|
void showApplicationMenu(const QPoint&);
|
|
|
|
bool menuAvailable() {
|
|
|
|
return m_menuAvailable;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-02-14 18:19:35 +04:00
|
|
|
template <typename T>
|
|
|
|
void print(T &stream) const;
|
|
|
|
|
2012-01-03 21:32:05 +04:00
|
|
|
public slots:
|
|
|
|
void closeWindow();
|
2013-01-07 11:07:27 +04:00
|
|
|
void updateCaption();
|
2012-01-03 21:32:05 +04:00
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
private slots:
|
|
|
|
void autoRaise();
|
|
|
|
void shadeHover();
|
|
|
|
void shadeUnhover();
|
|
|
|
void shortcutActivated();
|
|
|
|
void delayedMoveResize();
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend class Bridge; // FRAME
|
|
|
|
virtual void processMousePressEvent(QMouseEvent* e);
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Use Workspace::createClient()
|
|
|
|
virtual ~Client(); ///< Use destroyClient() or releaseWindow()
|
|
|
|
|
|
|
|
Position mousePosition(const QPoint&) const;
|
|
|
|
void updateCursor();
|
|
|
|
|
|
|
|
// Handlers for X11 events
|
|
|
|
bool mapRequestEvent(XMapRequestEvent* e);
|
|
|
|
void unmapNotifyEvent(XUnmapEvent* e);
|
|
|
|
void destroyNotifyEvent(XDestroyWindowEvent* e);
|
|
|
|
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);
|
2013-04-26 13:00:08 +04:00
|
|
|
virtual void damageNotifyEvent();
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2013-05-03 12:32:18 +04:00
|
|
|
bool buttonPressEvent(xcb_window_t w, int button, int state, int x, int y, int x_root, int y_root);
|
|
|
|
bool buttonReleaseEvent(xcb_window_t w, int button, int state, int x, int y, int x_root, int y_root);
|
|
|
|
bool motionNotifyEvent(xcb_window_t w, int state, int x, int y, int x_root, int y_root);
|
2011-01-30 17:34:42 +03:00
|
|
|
void checkQuickTilingMaximizationZones(int xroot, int yroot);
|
|
|
|
|
|
|
|
bool processDecorationButtonPress(int button, int state, int x, int y, int x_root, int y_root,
|
|
|
|
bool ignoreMenu = false);
|
2012-01-12 10:42:55 +04:00
|
|
|
Client* findAutogroupCandidate() const;
|
2012-08-26 18:16:38 +04:00
|
|
|
void resetShowingDesktop(bool keep_hidden);
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void debug(QDebug& stream) const;
|
|
|
|
virtual bool shouldUnredirect() const;
|
|
|
|
|
|
|
|
private slots:
|
2011-08-13 18:39:58 +04:00
|
|
|
void delayedSetShortcut();
|
|
|
|
void performMoveResize();
|
|
|
|
void removeSyncSupport();
|
2011-01-30 17:34:42 +03:00
|
|
|
void pingTimeout();
|
|
|
|
|
2010-09-21 18:31:40 +04:00
|
|
|
//Signals for the scripting interface
|
2011-01-01 12:39:02 +03:00
|
|
|
//Signals make an excellent way for communication
|
2010-09-21 18:31:40 +04:00
|
|
|
//in between objects as compared to simple function
|
|
|
|
//calls
|
2011-01-30 17:34:42 +03:00
|
|
|
signals:
|
|
|
|
void clientManaging(KWin::Client*);
|
2012-01-21 13:51:22 +04:00
|
|
|
void clientFullScreenSet(KWin::Client*, bool, bool);
|
2011-02-28 23:03:13 +03:00
|
|
|
void clientMaximizedStateChanged(KWin::Client*, KDecorationDefines::MaximizeMode);
|
2012-01-21 13:51:22 +04:00
|
|
|
void clientMaximizedStateChanged(KWin::Client* c, bool h, bool v);
|
2011-03-06 12:55:27 +03:00
|
|
|
void clientMinimized(KWin::Client* client, bool animate);
|
2011-03-06 13:08:19 +03:00
|
|
|
void clientUnminimized(KWin::Client* client, bool animate);
|
2011-03-13 14:41:30 +03:00
|
|
|
void clientStartUserMovedResized(KWin::Client*);
|
|
|
|
void clientStepUserMovedResized(KWin::Client *, const QRect&);
|
|
|
|
void clientFinishUserMovedResized(KWin::Client*);
|
2011-12-22 17:39:55 +04:00
|
|
|
void activeChanged();
|
2011-12-22 17:53:11 +04:00
|
|
|
void captionChanged();
|
2011-12-22 18:02:35 +04:00
|
|
|
void desktopChanged();
|
2011-12-22 18:34:55 +04:00
|
|
|
void fullScreenChanged();
|
2011-12-22 20:00:08 +04:00
|
|
|
void transientChanged();
|
2011-12-22 20:54:07 +04:00
|
|
|
void modalChanged();
|
2011-12-22 21:10:18 +04:00
|
|
|
void shadeChanged();
|
2013-05-07 11:46:40 +04:00
|
|
|
void keepAboveChanged(bool);
|
|
|
|
void keepBelowChanged(bool);
|
2011-12-22 22:01:01 +04:00
|
|
|
void minimizedChanged();
|
2011-12-29 13:19:36 +04:00
|
|
|
void moveResizedChanged();
|
|
|
|
void iconChanged();
|
|
|
|
void skipSwitcherChanged();
|
2012-02-28 00:09:36 +04:00
|
|
|
void skipTaskbarChanged();
|
|
|
|
void skipPagerChanged();
|
2012-01-01 17:31:11 +04:00
|
|
|
/**
|
2012-01-12 10:42:55 +04:00
|
|
|
* Emitted whenever the Client's TabGroup changed. That is whenever the Client is moved to
|
2012-01-01 17:31:11 +04:00
|
|
|
* another group, but not when a Client gets added or removed to the Client's ClientGroup.
|
|
|
|
**/
|
2012-01-12 10:42:55 +04:00
|
|
|
void tabGroupChanged();
|
2012-11-09 16:44:50 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Emitted whenever the Client want to show it menu
|
|
|
|
*/
|
|
|
|
void showRequest();
|
|
|
|
/**
|
|
|
|
* Emitted whenever the Client's menu is closed
|
|
|
|
*/
|
|
|
|
void menuHidden();
|
|
|
|
/**
|
|
|
|
* Emitted whenever the Client's menu is available
|
|
|
|
**/
|
|
|
|
void appMenuAvailable();
|
|
|
|
/**
|
|
|
|
* Emitted whenever the Client's menu is unavailable
|
|
|
|
*/
|
|
|
|
void appMenuUnavailable();
|
|
|
|
|
2012-03-09 13:17:19 +04:00
|
|
|
/**
|
|
|
|
* Emitted whenever the demands attention state changes.
|
|
|
|
**/
|
|
|
|
void demandsAttentionChanged();
|
2012-03-31 21:09:00 +04:00
|
|
|
/**
|
|
|
|
* Emitted whenever the Client's block compositing state changes.
|
|
|
|
**/
|
2012-08-23 15:42:59 +04:00
|
|
|
void blockingCompositingChanged(KWin::Client *client);
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
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
|
|
|
|
void updateAllowedActions(bool force = false);
|
|
|
|
QRect fullscreenMonitorsArea(NETFullscreenMonitors topology) const;
|
|
|
|
void changeMaximize(bool horizontal, bool vertical, bool adjust);
|
|
|
|
int checkFullScreenHack(const QRect& geom) const; // 0 - None, 1 - One xinerama screen, 2 - Full area
|
|
|
|
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 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);
|
|
|
|
void getSyncCounter();
|
|
|
|
void sendSyncRequest();
|
|
|
|
bool startMoveResize();
|
|
|
|
void finishMoveResize(bool cancel);
|
|
|
|
void leaveMoveResize();
|
|
|
|
void checkUnrestrictedMoveResize();
|
|
|
|
void handleMoveResize(int x, int y, int x_root, int y_root);
|
|
|
|
void startDelayedMoveResize();
|
|
|
|
void stopDelayedMoveResize();
|
|
|
|
void positionGeometryTip();
|
|
|
|
void grabButton(int mod);
|
|
|
|
void ungrabButton(int mod);
|
|
|
|
void resizeDecoration(const QSize& s);
|
2013-05-07 11:46:40 +04:00
|
|
|
void createDecoration(const QRect &oldgeom);
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
void pingWindow();
|
2013-05-03 13:02:06 +04:00
|
|
|
void killProcess(bool ask, xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME);
|
2011-01-30 17:34:42 +03:00
|
|
|
void updateUrgency();
|
2013-05-03 12:55:37 +04:00
|
|
|
static void sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol,
|
2011-01-30 17:34:42 +03:00
|
|
|
long data1 = 0, long data2 = 0, long data3 = 0);
|
|
|
|
|
2013-05-03 12:58:46 +04:00
|
|
|
void embedClient(xcb_window_t w, const XWindowAttributes& attr);
|
2011-01-30 17:34:42 +03:00
|
|
|
void detectNoBorder();
|
|
|
|
void destroyDecoration();
|
|
|
|
void updateFrameExtents();
|
|
|
|
|
2013-04-26 11:47:45 +04:00
|
|
|
void internalShow();
|
|
|
|
void internalHide();
|
|
|
|
void internalKeep();
|
|
|
|
void map();
|
|
|
|
void unmap();
|
2011-01-30 17:34:42 +03:00
|
|
|
void updateHiddenPreview();
|
|
|
|
|
|
|
|
void updateInputShape();
|
|
|
|
|
2013-05-03 13:29:50 +04:00
|
|
|
xcb_timestamp_t readUserTimeMapTimestamp(const KStartupInfoId* asn_id, const KStartupInfoData* asn_data,
|
2011-01-30 17:34:42 +03:00
|
|
|
bool session) const;
|
2013-05-03 13:29:50 +04:00
|
|
|
xcb_timestamp_t readUserCreationTime() const;
|
2011-01-30 17:34:42 +03:00
|
|
|
void startupIdChanged();
|
|
|
|
|
2011-09-29 17:17:59 +04:00
|
|
|
void checkOffscreenPosition (QRect* geom, const QRect& screenArea);
|
2011-07-29 00:18:41 +04:00
|
|
|
|
2011-11-09 23:39:13 +04:00
|
|
|
void updateInputWindow();
|
|
|
|
|
2012-01-12 10:42:55 +04:00
|
|
|
bool tabTo(Client *other, bool behind, bool activate);
|
|
|
|
|
2013-05-02 20:43:49 +04:00
|
|
|
xcb_window_t m_client;
|
2013-05-02 20:26:05 +04:00
|
|
|
Xcb::Window m_wrapper;
|
2011-01-30 17:34:42 +03:00
|
|
|
KDecoration* decoration;
|
|
|
|
Bridge* bridge;
|
|
|
|
int desk;
|
|
|
|
QStringList activityList;
|
2013-03-25 00:57:26 +04:00
|
|
|
int m_activityUpdatesBlocked;
|
|
|
|
bool m_blockedActivityUpdatesRequireTransients;
|
2011-01-30 17:34:42 +03:00
|
|
|
bool buttonDown;
|
|
|
|
bool moveResizeMode;
|
2013-05-02 21:04:43 +04:00
|
|
|
Xcb::Window m_moveResizeGrabWindow;
|
2011-01-30 17:34:42 +03:00
|
|
|
bool move_resize_has_keyboard_grab;
|
|
|
|
bool unrestrictedMoveResize;
|
2011-11-03 00:13:47 +04:00
|
|
|
int moveResizeStartScreen;
|
2011-12-09 23:44:06 +04:00
|
|
|
static bool s_haveResizeEffect;
|
2012-06-20 01:12:37 +04:00
|
|
|
bool m_managed;
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
Position mode;
|
|
|
|
QPoint moveOffset;
|
|
|
|
QPoint invertedMoveOffset;
|
|
|
|
QRect moveResizeGeom;
|
|
|
|
QRect initialMoveResizeGeom;
|
|
|
|
XSizeHints xSizeHint;
|
|
|
|
void sendSyntheticConfigureNotify();
|
|
|
|
enum MappingState {
|
|
|
|
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)
|
|
|
|
};
|
|
|
|
MappingState mapping_state;
|
|
|
|
|
|
|
|
/** The quick tile mode of this window.
|
|
|
|
*/
|
2011-03-08 00:31:44 +03:00
|
|
|
int quick_tile_mode;
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
void readTransient();
|
2013-05-03 10:53:35 +04:00
|
|
|
xcb_window_t verifyTransientFor(xcb_window_t transient_for, bool set);
|
2011-01-30 17:34:42 +03:00
|
|
|
void addTransient(Client* cl);
|
|
|
|
void removeTransient(Client* cl);
|
|
|
|
void removeFromMainClients();
|
|
|
|
void cleanGrouping();
|
|
|
|
void checkGroupTransients();
|
2013-05-03 10:53:35 +04:00
|
|
|
void setTransient(xcb_window_t new_transient_for_id);
|
2011-01-30 17:34:42 +03:00
|
|
|
Client* transient_for;
|
2013-05-03 10:53:35 +04:00
|
|
|
xcb_window_t m_transientForId;
|
|
|
|
xcb_window_t m_originalTransientForId;
|
2011-01-30 17:34:42 +03:00
|
|
|
ClientList transients_list; // SELI TODO: Make this ordered in stacking order?
|
|
|
|
ShadeMode shade_mode;
|
2012-03-14 12:59:41 +04:00
|
|
|
Client *shade_below;
|
2011-01-30 17:34:42 +03: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
|
|
|
|
uint skip_pager : 1;
|
|
|
|
uint skip_switcher : 1;
|
|
|
|
uint motif_may_resize : 1;
|
|
|
|
uint motif_may_move : 1;
|
|
|
|
uint motif_may_close : 1;
|
|
|
|
uint keep_below : 1; ///< NET::KeepBelow
|
|
|
|
uint minimized : 1;
|
|
|
|
uint hidden : 1; ///< Forcibly hidden by calling hide()
|
|
|
|
uint modal : 1; ///< NET::Modal
|
|
|
|
uint noborder : 1;
|
|
|
|
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
|
|
|
|
uint urgency : 1; ///< XWMHints, UrgencyHint
|
|
|
|
uint ignore_focus_stealing : 1; ///< Don't apply focus stealing prevention to this client
|
|
|
|
uint demands_attention : 1;
|
2011-03-20 17:42:05 +03:00
|
|
|
bool blocks_compositing;
|
2011-01-30 17:34:42 +03:00
|
|
|
WindowRules client_rules;
|
|
|
|
void getWMHints();
|
|
|
|
void readIcons();
|
|
|
|
void getWindowProtocols();
|
|
|
|
QPixmap icon_pix;
|
|
|
|
QPixmap miniicon_pix;
|
|
|
|
QPixmap bigicon_pix;
|
|
|
|
QPixmap hugeicon_pix;
|
2013-02-19 20:30:59 +04:00
|
|
|
Qt::CursorShape m_cursor;
|
2011-01-30 17:34:42 +03:00
|
|
|
// DON'T reorder - Saved to config files !!!
|
|
|
|
enum FullScreenMode {
|
|
|
|
FullScreenNone,
|
|
|
|
FullScreenNormal,
|
|
|
|
FullScreenHack ///< Non-NETWM fullscreen (noborder and size of desktop)
|
|
|
|
};
|
|
|
|
FullScreenMode fullscreen_mode;
|
|
|
|
MaximizeMode max_mode;
|
|
|
|
QRect geom_restore;
|
|
|
|
QRect geom_fs_restore;
|
|
|
|
QTimer* autoRaiseTimer;
|
|
|
|
QTimer* shadeHoverTimer;
|
|
|
|
QTimer* delayedMoveResizeTimer;
|
2013-05-03 13:46:18 +04:00
|
|
|
xcb_colormap_t m_colormap;
|
2012-10-17 00:42:19 +04:00
|
|
|
QString cap_normal, cap_iconic, cap_suffix, cap_deco;
|
2011-01-30 17:34:42 +03:00
|
|
|
Group* in_group;
|
2013-05-03 11:27:16 +04:00
|
|
|
xcb_window_t m_windowGroup;
|
2012-01-12 10:42:55 +04:00
|
|
|
TabGroup* tab_group;
|
2011-01-30 17:34:42 +03:00
|
|
|
Layer in_layer;
|
|
|
|
QTimer* ping_timer;
|
2012-04-17 01:52:13 +04:00
|
|
|
qint64 m_killHelperPID;
|
2013-05-03 13:35:46 +04:00
|
|
|
xcb_timestamp_t m_pingTimestamp;
|
2013-05-03 13:29:50 +04:00
|
|
|
xcb_timestamp_t m_userTime;
|
2011-01-30 17:34:42 +03:00
|
|
|
unsigned long allowed_actions;
|
|
|
|
QSize client_size;
|
|
|
|
int block_geometry_updates; // > 0 = New geometry is remembered, but not actually set
|
|
|
|
enum PendingGeometry_t {
|
|
|
|
PendingGeometryNone,
|
|
|
|
PendingGeometryNormal,
|
|
|
|
PendingGeometryForced
|
|
|
|
};
|
|
|
|
PendingGeometry_t pending_geometry_update;
|
|
|
|
QRect geom_before_block;
|
|
|
|
QRect deco_rect_before_block;
|
|
|
|
bool shade_geometry_change;
|
2007-06-25 12:51:44 +04:00
|
|
|
#ifdef HAVE_XSYNC
|
2011-08-13 18:39:58 +04:00
|
|
|
struct {
|
|
|
|
XSyncCounter counter;
|
|
|
|
XSyncValue value;
|
|
|
|
XSyncAlarm alarm;
|
|
|
|
QTimer *timeout, *failsafeTimeout;
|
|
|
|
bool isPending;
|
|
|
|
} syncRequest;
|
2007-06-25 12:51:44 +04:00
|
|
|
#endif
|
2011-01-30 17:34:42 +03:00
|
|
|
int border_left, border_right, border_top, border_bottom;
|
|
|
|
int padding_left, padding_right, padding_top, padding_bottom;
|
|
|
|
QRegion _mask;
|
|
|
|
static bool check_active_modal; ///< \see Client::checkActiveModal()
|
|
|
|
KShortcut _shortcut;
|
|
|
|
int sm_stacking_order;
|
|
|
|
friend struct FetchNameInternalPredicate;
|
|
|
|
friend struct ResetupRulesProcedure;
|
|
|
|
friend class GeometryUpdatesBlocker;
|
|
|
|
PaintRedirector* paintRedirector;
|
2012-05-20 17:52:24 +04:00
|
|
|
QSharedPointer<TabBox::TabBoxClientImpl> m_tabBoxClient;
|
2011-12-01 16:15:11 +04:00
|
|
|
bool m_firstInTabBox;
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
bool electricMaximizing;
|
2011-03-08 00:31:44 +03:00
|
|
|
QuickTileMode electricMode;
|
2011-01-30 17:34:42 +03:00
|
|
|
|
|
|
|
friend bool performTransiencyCheck();
|
|
|
|
|
|
|
|
void checkActivities();
|
|
|
|
bool activitiesDefined; //whether the x property was actually set
|
|
|
|
|
|
|
|
bool needsSessionInteract;
|
2012-11-08 03:54:05 +04:00
|
|
|
bool needsXWindowMove;
|
2011-11-09 23:39:13 +04:00
|
|
|
|
2012-11-09 16:44:50 +04:00
|
|
|
#ifdef KWIN_BUILD_KAPPMENU
|
|
|
|
bool m_menuAvailable;
|
|
|
|
#endif
|
2013-02-04 14:20:15 +04:00
|
|
|
Xcb::Window m_decoInputExtent;
|
2011-11-09 23:39:13 +04:00
|
|
|
QPoint input_offset;
|
2011-01-30 17:34:42 +03:00
|
|
|
};
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2008-12-18 16:50:57 +03:00
|
|
|
/**
|
|
|
|
* Helper for Client::blockGeometryUpdates() being called in pairs (true/false)
|
|
|
|
*/
|
2007-04-29 21:35:43 +04:00
|
|
|
class GeometryUpdatesBlocker
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
|
|
|
public:
|
2012-12-29 10:34:38 +04:00
|
|
|
explicit GeometryUpdatesBlocker(Client* c)
|
2011-01-30 17:34:42 +03:00
|
|
|
: cl(c) {
|
|
|
|
cl->blockGeometryUpdates(true);
|
|
|
|
}
|
|
|
|
~GeometryUpdatesBlocker() {
|
|
|
|
cl->blockGeometryUpdates(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Client* cl;
|
|
|
|
};
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2013-05-02 20:26:05 +04:00
|
|
|
inline xcb_window_t Client::wrapperId() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2013-05-02 20:26:05 +04:00
|
|
|
return m_wrapper;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2013-05-03 11:36:20 +04:00
|
|
|
inline xcb_window_t Client::decorationId() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2013-05-03 11:36:20 +04:00
|
|
|
if (decoration) {
|
|
|
|
return decoration->widget()->winId();
|
|
|
|
}
|
|
|
|
return XCB_WINDOW_NONE;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline const Client* Client::transientFor() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return transient_for;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline Client* Client::transientFor()
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return transient_for;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline bool Client::groupTransient() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2013-05-03 10:53:35 +04:00
|
|
|
return m_transientForId == rootWindow();
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2008-12-18 16:50:57 +03:00
|
|
|
// Needed because verifyTransientFor() may set transient_for_id to root window,
|
2007-04-29 21:35:43 +04:00
|
|
|
// if the original value has a problem (window doesn't exist, etc.)
|
|
|
|
inline bool Client::wasOriginallyGroupTransient() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2013-05-03 10:53:35 +04:00
|
|
|
return m_originalTransientForId == rootWindow();
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline bool Client::isTransient() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2013-05-03 10:53:35 +04:00
|
|
|
return m_transientForId != XCB_WINDOW_NONE;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline const ClientList& Client::transients() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return transients_list;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline const Group* Client::group() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return in_group;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline Group* Client::group()
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return in_group;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2012-01-12 10:42:55 +04:00
|
|
|
inline TabGroup* Client::tabGroup() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2012-01-12 10:42:55 +04:00
|
|
|
return tab_group;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2009-11-15 06:24:04 +03:00
|
|
|
|
2008-12-18 16:50:57 +03:00
|
|
|
inline bool Client::isMinimized() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return minimized;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline bool Client::isActive() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return active;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
inline bool Client::isShown(bool shaded_is_shown) const
|
|
|
|
{
|
|
|
|
return !isMinimized() && (!isShade() || shaded_is_shown) && !hidden &&
|
2012-01-12 10:42:55 +04:00
|
|
|
(!tabGroup() || tabGroup()->current() == this);
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2008-12-18 16:50:57 +03:00
|
|
|
inline bool Client::isHiddenInternal() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2008-02-23 16:41:53 +03:00
|
|
|
return hidden;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2008-02-23 16:41:53 +03:00
|
|
|
|
2008-12-18 16:50:57 +03:00
|
|
|
inline bool Client::isShade() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return shade_mode == ShadeNormal;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2008-12-18 16:50:57 +03:00
|
|
|
inline ShadeMode Client::shadeMode() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return shade_mode;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline QPixmap Client::icon() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return icon_pix;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline QPixmap Client::miniIcon() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return miniicon_pix;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2010-06-12 10:56:40 +04:00
|
|
|
inline QPixmap Client::bigIcon() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2010-06-12 10:56:40 +04:00
|
|
|
return bigicon_pix;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2010-06-12 10:56:40 +04:00
|
|
|
|
|
|
|
inline QPixmap Client::hugeIcon() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2010-06-12 10:56:40 +04:00
|
|
|
return hugeicon_pix;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2010-06-12 10:56:40 +04:00
|
|
|
|
2007-04-29 21:35:43 +04:00
|
|
|
inline QRect Client::geometryRestore() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return geom_restore;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline Client::MaximizeMode Client::maximizeMode() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return max_mode;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2013-02-17 04:56:01 +04:00
|
|
|
inline Client::QuickTileMode Client::quickTileMode() const
|
2012-03-16 03:15:13 +04:00
|
|
|
{
|
2013-02-17 04:56:01 +04:00
|
|
|
return (Client::QuickTileMode)quick_tile_mode;
|
2012-03-16 03:15:13 +04:00
|
|
|
}
|
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
inline bool Client::skipTaskbar(bool from_outside) const
|
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return from_outside ? original_skip_taskbar : skip_taskbar;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline bool Client::skipPager() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return skip_pager;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2010-05-04 00:04:44 +04:00
|
|
|
inline bool Client::skipSwitcher() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2010-05-04 00:04:44 +04:00
|
|
|
return skip_switcher;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2010-05-04 00:04:44 +04:00
|
|
|
|
2007-04-29 21:35:43 +04:00
|
|
|
inline bool Client::keepAbove() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return keep_above;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline bool Client::keepBelow() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return keep_below;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline bool Client::isFullScreen() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return fullscreen_mode != FullScreenNone;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline bool Client::isModal() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return modal;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline bool Client::hasNETSupport() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return info->hasNETSupport();
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2013-05-03 13:46:18 +04:00
|
|
|
inline xcb_colormap_t Client::colormap() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2013-05-03 13:46:18 +04:00
|
|
|
return m_colormap;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline void Client::invalidateLayer()
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
in_layer = UnknownLayer;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline int Client::sessionStackingOrder() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return sm_stacking_order;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline bool Client::isManaged() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2012-06-20 01:12:37 +04:00
|
|
|
return m_managed;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline QPoint Client::clientPos() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
|
|
|
return QPoint(border_left, border_top);
|
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline QSize Client::clientSize() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return client_size;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2011-12-22 22:38:52 +04:00
|
|
|
inline void Client::setGeometry(const QRect& r, ForceGeometry_t force)
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2011-12-22 22:38:52 +04:00
|
|
|
setGeometry(r.x(), r.y(), r.width(), r.height(), force);
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
inline void Client::move(const QPoint& p, ForceGeometry_t force)
|
|
|
|
{
|
|
|
|
move(p.x(), p.y(), force);
|
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2011-12-22 22:38:52 +04:00
|
|
|
inline void Client::plainResize(const QSize& s, ForceGeometry_t force)
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2011-12-22 22:38:52 +04:00
|
|
|
plainResize(s.width(), s.height(), force);
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
inline void Client::resizeWithChecks(const QSize& s, ForceGeometry_t force)
|
|
|
|
{
|
|
|
|
resizeWithChecks(s.width(), s.height(), force);
|
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline bool Client::hasUserTimeSupport() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return info->userTime() != -1U;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2008-12-18 16:50:57 +03:00
|
|
|
|
2007-04-29 21:35:43 +04:00
|
|
|
inline const WindowRules* Client::rules() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return &client_rules;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2013-05-02 21:04:43 +04:00
|
|
|
inline xcb_window_t Client::moveResizeGrabWindow() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2013-05-02 21:04:43 +04:00
|
|
|
return m_moveResizeGrabWindow;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
inline KShortcut Client::shortcut() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return _shortcut;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
inline void Client::removeRule(Rules* rule)
|
|
|
|
{
|
|
|
|
client_rules.remove(rule);
|
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2007-07-04 13:51:10 +04:00
|
|
|
inline bool Client::hiddenPreview() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2008-08-12 15:02:58 +04:00
|
|
|
return mapping_state == Kept;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-07-04 13:51:10 +04:00
|
|
|
|
2013-02-14 18:19:35 +04:00
|
|
|
template <typename T>
|
|
|
|
inline void Client::print(T &stream) const
|
|
|
|
{
|
|
|
|
stream << "\'ID:" << window() << ";WMCLASS:" << resourceClass() << ":"
|
|
|
|
<< resourceName() << ";Caption:" << caption() << "\'";
|
|
|
|
}
|
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
KWIN_COMPARE_PREDICATE(WrapperIdMatchPredicate, Client, Window, cl->wrapperId() == value);
|
2011-11-09 23:39:13 +04:00
|
|
|
KWIN_COMPARE_PREDICATE(InputIdMatchPredicate, Client, Window, cl->inputId() == value);
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
} // namespace
|
2012-01-01 17:16:07 +04:00
|
|
|
Q_DECLARE_METATYPE(KWin::Client*)
|
2012-01-01 18:01:54 +04:00
|
|
|
Q_DECLARE_METATYPE(QList<KWin::Client*>)
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
#endif
|