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
|
|
|
|
|
2013-04-26 09:52:15 +00:00
|
|
|
// kwin
|
2007-04-29 17:35:43 +00:00
|
|
|
#include "options.h"
|
|
|
|
#include "rules.h"
|
2012-01-12 06:42:55 +00:00
|
|
|
#include "tabgroup.h"
|
2015-03-05 09:21:03 +00:00
|
|
|
#include "abstract_client.h"
|
2013-02-04 10:20:15 +00:00
|
|
|
#include "xcbutils.h"
|
2013-04-26 09:52:15 +00:00
|
|
|
// Qt
|
2014-11-28 13:50:21 +00:00
|
|
|
#include <QElapsedTimer>
|
2014-12-02 12:50:26 +00:00
|
|
|
#include <QFlags>
|
|
|
|
#include <QPointer>
|
2013-04-26 09:52:15 +00:00
|
|
|
#include <QPixmap>
|
2013-10-08 06:33:23 +00:00
|
|
|
#include <QWindow>
|
2013-04-26 09:52:15 +00:00
|
|
|
// X
|
2013-07-31 08:11:39 +00:00
|
|
|
#include <xcb/sync.h>
|
2007-06-25 08:51:44 +00:00
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
// TODO: Cleanup the order of things in this .h file
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
class QTimer;
|
|
|
|
class KStartupInfoData;
|
2013-04-26 09:52:15 +00:00
|
|
|
class KStartupInfoId;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
2009-09-13 11:36:45 +00:00
|
|
|
|
2014-03-20 08:19:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Defines Predicates on how to search for a Client.
|
|
|
|
*
|
|
|
|
* Used by Workspace::findClient.
|
|
|
|
*/
|
|
|
|
enum class Predicate {
|
|
|
|
WindowMatch,
|
|
|
|
WrapperIdMatch,
|
|
|
|
FrameIdMatch,
|
|
|
|
InputIdMatch
|
|
|
|
};
|
|
|
|
|
2016-04-11 15:24:08 +00:00
|
|
|
class KWIN_EXPORT Client
|
2015-03-05 09:21:03 +00:00
|
|
|
: public AbstractClient
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
Q_OBJECT
|
2011-12-29 09:19:36 +00: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)
|
2012-03-31 17:09:00 +00: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)
|
2014-07-01 13:44:02 +00:00
|
|
|
/**
|
|
|
|
* Whether the Client uses client side window decorations.
|
|
|
|
* Only GTK+ are detected.
|
|
|
|
**/
|
|
|
|
Q_PROPERTY(bool clientSideDecorated READ isClientSideDecorated NOTIFY clientSideDecoratedChanged)
|
2011-01-30 14:34:42 +00:00
|
|
|
public:
|
2013-05-08 11:39:06 +00:00
|
|
|
explicit Client();
|
2013-05-02 16:26:05 +00:00
|
|
|
xcb_window_t wrapperId() const;
|
2013-02-04 10:20:15 +00:00
|
|
|
xcb_window_t inputId() const { return m_decoInputExtent; }
|
2013-09-10 06:13:33 +00:00
|
|
|
virtual xcb_window_t frameId() const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-03-05 12:35:54 +00:00
|
|
|
bool isTransient() const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
bool groupTransient() const;
|
|
|
|
bool wasOriginallyGroupTransient() const;
|
2015-09-11 13:55:23 +00:00
|
|
|
QList<AbstractClient*> mainClients() const override; // Call once before loop , is not indirect
|
2015-09-11 12:14:21 +00:00
|
|
|
bool hasTransient(const AbstractClient* c, bool indirect) const override;
|
2013-05-03 06:53:35 +00:00
|
|
|
void checkTransient(xcb_window_t w);
|
2015-03-05 12:59:18 +00:00
|
|
|
AbstractClient* findModal(bool allow_itself = false) override;
|
2011-01-30 14:34:42 +00:00
|
|
|
const Group* group() const;
|
|
|
|
Group* group();
|
|
|
|
void checkGroup(Group* gr = NULL, bool force = false);
|
|
|
|
void changeClientLeaderGroup(Group* gr);
|
2015-03-12 14:35:36 +00:00
|
|
|
void updateWindowRules(Rules::Types selection) override;
|
2011-01-30 14:34:42 +00:00
|
|
|
void updateFullscreenMonitors(NETFullscreenMonitors topology);
|
|
|
|
|
|
|
|
bool hasNETSupport() const;
|
|
|
|
|
2015-05-27 11:21:56 +00:00
|
|
|
QSize minSize() const override;
|
|
|
|
QSize maxSize() const override;
|
2011-11-02 22:05:03 +00:00
|
|
|
QSize basicUnit() const;
|
2011-01-30 14:34:42 +00:00
|
|
|
virtual QSize clientSize() const;
|
2011-11-09 19:39:13 +00:00
|
|
|
QPoint inputPos() const { return input_offset; } // Inside of geometry()
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2013-07-26 08:32:48 +00:00
|
|
|
bool windowEvent(xcb_generic_event_t *e);
|
2012-09-06 07:09:31 +00:00
|
|
|
NET::WindowType windowType(bool direct = false, int supported_types = 0) const;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2013-05-03 08:20:05 +00:00
|
|
|
bool manage(xcb_window_t w, bool isMapped);
|
2011-01-30 14:34:42 +00:00
|
|
|
void releaseWindow(bool on_shutdown = false);
|
|
|
|
void destroyClient();
|
|
|
|
|
|
|
|
virtual QStringList activities() const;
|
|
|
|
void setOnActivity(const QString &activity, bool enable);
|
2015-03-06 10:33:51 +00:00
|
|
|
void setOnAllActivities(bool set) override;
|
2017-10-01 14:38:57 +00:00
|
|
|
void setOnActivities(QStringList newActivitiesList) override;
|
2011-01-30 14:34:42 +00:00
|
|
|
void updateActivities(bool includeTransients);
|
2015-03-06 10:33:51 +00:00
|
|
|
void blockActivityUpdates(bool b = true) override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
/// Is not minimized and not hidden. I.e. normally visible on some virtual desktop.
|
2015-03-05 09:21:03 +00:00
|
|
|
bool isShown(bool shaded_is_shown) const override;
|
2016-07-04 13:06:20 +00:00
|
|
|
bool isHiddenInternal() const override; // For compositing
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-03-06 10:33:51 +00:00
|
|
|
ShadeMode shadeMode() const override; // Prefer isShade()
|
|
|
|
void setShade(ShadeMode mode) override;
|
|
|
|
bool isShadeable() const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-03-06 10:33:51 +00:00
|
|
|
bool isMaximizable() const override;
|
2015-10-12 08:17:38 +00:00
|
|
|
QRect geometryRestore() const override;
|
2015-03-06 09:05:40 +00:00
|
|
|
MaximizeMode maximizeMode() const override;
|
2014-12-02 09:52:16 +00:00
|
|
|
|
2015-03-06 10:33:51 +00:00
|
|
|
bool isMinimizable() const override;
|
2015-11-05 10:30:02 +00:00
|
|
|
QRect iconGeometry() const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-03-06 09:05:40 +00:00
|
|
|
void setFullScreen(bool set, bool user = true) override;
|
2015-03-05 09:21:03 +00:00
|
|
|
bool isFullScreen() const override;
|
2015-03-06 10:33:51 +00:00
|
|
|
bool userCanSetFullScreen() const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
QRect geometryFSRestore() const {
|
|
|
|
return geom_fs_restore; // Only for session saving
|
|
|
|
}
|
|
|
|
int fullScreenMode() const {
|
|
|
|
return fullscreen_mode; // only for session saving
|
|
|
|
}
|
|
|
|
|
2015-03-06 09:05:40 +00:00
|
|
|
bool noBorder() const override;
|
|
|
|
void setNoBorder(bool set) override;
|
2015-03-06 10:33:51 +00:00
|
|
|
bool userCanSetNoBorder() const override;
|
2017-10-01 19:48:57 +00:00
|
|
|
void checkNoBorder() override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
int sessionStackingOrder() const;
|
|
|
|
|
|
|
|
// Auxiliary functions, depend on the windowType
|
2015-03-06 14:04:59 +00:00
|
|
|
bool wantsInput() const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-03-06 10:33:51 +00:00
|
|
|
bool isResizable() const override;
|
|
|
|
bool isMovable() const override;
|
|
|
|
bool isMovableAcrossScreens() const override;
|
2015-03-05 09:21:03 +00:00
|
|
|
bool isCloseable() const override; ///< May be closed by the user (May have a close button)
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-03-06 14:04:59 +00:00
|
|
|
void takeFocus() override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-12-17 14:47:36 +00:00
|
|
|
void updateDecoration(bool check_workspace_pos, bool force = false) override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
void updateShape();
|
|
|
|
|
2015-10-13 08:52:01 +00:00
|
|
|
using AbstractClient::setGeometry;
|
|
|
|
void setGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override;
|
2011-01-30 14:34:42 +00:00
|
|
|
/// plainResize() simply resizes
|
2011-12-22 18:38:52 +00:00
|
|
|
void plainResize(int w, int h, ForceGeometry_t force = NormalGeometrySet);
|
|
|
|
void plainResize(const QSize& s, ForceGeometry_t force = NormalGeometrySet);
|
2011-01-30 14:34:42 +00:00
|
|
|
/// resizeWithChecks() resizes according to gravity, and checks workarea position
|
2015-05-27 09:48:33 +00:00
|
|
|
using AbstractClient::resizeWithChecks;
|
|
|
|
void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override;
|
|
|
|
void resizeWithChecks(int w, int h, xcb_gravity_t gravity, ForceGeometry_t force = NormalGeometrySet);
|
|
|
|
void resizeWithChecks(const QSize& s, xcb_gravity_t gravity, ForceGeometry_t force = NormalGeometrySet);
|
2015-10-13 07:49:31 +00:00
|
|
|
QSize sizeForClientSize(const QSize&, Sizemode mode = SizemodeAny, bool noframe = false) const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-12-03 16:11:14 +00:00
|
|
|
bool providesContextHelp() const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2014-12-02 09:39:38 +00:00
|
|
|
Options::WindowOperation mouseButtonToWindowOperation(Qt::MouseButtons button);
|
2015-03-06 09:05:40 +00:00
|
|
|
bool performMouseCommand(Options::MouseCommand, const QPoint& globalPos) override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
QRect adjustedClientArea(const QRect& desktop, const QRect& area) const;
|
|
|
|
|
2013-05-03 09:46:18 +00:00
|
|
|
xcb_colormap_t colormap() const;
|
2011-01-30 14:34:42 +00: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
|
2015-05-23 07:02:11 +00:00
|
|
|
void hideClient(bool hide) override;
|
2011-01-30 14:34:42 +00:00
|
|
|
bool hiddenPreview() const; ///< Window is mapped in order to get a window pixmap
|
|
|
|
|
2012-04-28 07:39:39 +00:00
|
|
|
virtual bool setupCompositing();
|
2014-04-07 14:23:17 +00:00
|
|
|
void finishCompositing(ReleaseReason releaseReason = ReleaseReason::Release) override;
|
2012-03-31 17:09:00 +00:00
|
|
|
void setBlockingCompositing(bool block);
|
2011-03-20 14:42:05 +00:00
|
|
|
inline bool isBlockingCompositing() { return blocks_compositing; }
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2017-08-20 06:56:13 +00:00
|
|
|
QString captionNormal() const override {
|
|
|
|
return cap_normal;
|
|
|
|
}
|
|
|
|
QString captionSuffix() const override {
|
|
|
|
return cap_suffix;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-10-23 13:32:10 +00:00
|
|
|
using AbstractClient::keyPressEvent;
|
|
|
|
void keyPressEvent(uint key_code, xcb_timestamp_t time); // FRAME ??
|
2015-03-05 09:21:03 +00:00
|
|
|
void updateMouseGrab() override;
|
2013-05-02 17:04:43 +00:00
|
|
|
xcb_window_t moveResizeGrabWindow() const;
|
2011-01-30 14:34:42 +00: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 08:27:04 +00:00
|
|
|
void restackWindow(xcb_window_t above, int detail, NET::RequestSource source, xcb_timestamp_t timestamp,
|
2011-01-30 14:34:42 +00:00
|
|
|
bool send_event = false);
|
|
|
|
|
2013-05-03 09:35:46 +00:00
|
|
|
void gotPing(xcb_timestamp_t timestamp);
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2013-05-03 09:29:50 +00:00
|
|
|
void updateUserTime(xcb_timestamp_t time = XCB_TIME_CURRENT_TIME);
|
2015-03-12 10:24:27 +00:00
|
|
|
xcb_timestamp_t userTime() const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
bool hasUserTimeSupport() const;
|
|
|
|
|
|
|
|
/// Does 'delete c;'
|
2013-04-26 07:47:45 +00:00
|
|
|
static void deleteClient(Client* c);
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2017-11-05 09:10:17 +00:00
|
|
|
static bool belongToSameApplication(const Client* c1, const Client* c2, SameApplicationChecks checks = SameApplicationChecks());
|
2011-01-30 14:34:42 +00:00
|
|
|
static bool sameAppWindowRoleMatch(const Client* c1, const Client* c2, bool active_hack);
|
|
|
|
|
2016-11-15 15:48:20 +00:00
|
|
|
void killWindow() override;
|
2011-01-30 14:34:42 +00:00
|
|
|
void toggleShade();
|
2015-12-03 16:11:14 +00:00
|
|
|
void showContextHelp() override;
|
2011-01-30 14:34:42 +00:00
|
|
|
void cancelShadeHoverTimer();
|
|
|
|
void checkActiveModal();
|
|
|
|
StrutRect strutRect(StrutArea area) const;
|
|
|
|
StrutRects strutRects() const;
|
2015-06-19 22:14:15 +00:00
|
|
|
bool hasStrut() const override;
|
2011-01-30 14:34:42 +00: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.
|
|
|
|
*/
|
2018-05-05 10:06:24 +00:00
|
|
|
void setClientShown(bool shown) override;
|
2011-01-30 14:34: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;
|
|
|
|
|
|
|
|
// Decorations <-> Effects
|
2011-04-10 19:24:27 +00:00
|
|
|
QRect decorationRect() const;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
QRect transparentRect() const;
|
|
|
|
|
2014-07-01 13:44:02 +00:00
|
|
|
bool isClientSideDecorated() const;
|
2014-07-24 06:55:57 +00:00
|
|
|
bool wantsShadowToBeRendered() const override;
|
2012-10-12 09:34:05 +00:00
|
|
|
|
2015-12-03 12:48:54 +00:00
|
|
|
void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-01-15 15:14:28 +00:00
|
|
|
Xcb::Property fetchFirstInTabBox() const;
|
|
|
|
void readFirstInTabBox(Xcb::Property &property);
|
2011-12-01 12:15:11 +00:00
|
|
|
void updateFirstInTabBox();
|
2015-01-15 15:09:05 +00:00
|
|
|
Xcb::StringProperty fetchColorScheme() const;
|
|
|
|
void readColorScheme(Xcb::StringProperty &property);
|
2017-10-01 14:38:57 +00:00
|
|
|
void updateColorScheme() override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2017-04-27 10:18:41 +00:00
|
|
|
//sets whether the client should be faked as being on all activities (and be shown during session save)
|
|
|
|
void setSessionActivityOverride(bool needed);
|
2012-01-15 09:51:09 +00:00
|
|
|
virtual bool isClient() const;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2013-02-14 14:19:35 +00:00
|
|
|
template <typename T>
|
|
|
|
void print(T &stream) const;
|
|
|
|
|
2013-08-05 07:48:14 +00:00
|
|
|
void cancelFocusOutTimer();
|
|
|
|
|
2014-02-20 11:39:23 +00:00
|
|
|
/**
|
|
|
|
* Restores the Client after it had been hidden due to show on screen edge functionality.
|
|
|
|
* In addition the property gets deleted so that the Client knows that it is visible again.
|
|
|
|
**/
|
2016-09-15 19:03:40 +00:00
|
|
|
void showOnScreenEdge() override;
|
2014-02-20 11:39:23 +00:00
|
|
|
|
2017-01-11 09:21:03 +00:00
|
|
|
Xcb::StringProperty fetchApplicationMenuServiceName() const;
|
|
|
|
void readApplicationMenuServiceName(Xcb::StringProperty &property);
|
|
|
|
void checkApplicationMenuServiceName();
|
|
|
|
|
|
|
|
Xcb::StringProperty fetchApplicationMenuObjectPath() const;
|
|
|
|
void readApplicationMenuObjectPath(Xcb::StringProperty &property);
|
|
|
|
void checkApplicationMenuObjectPath();
|
|
|
|
|
2017-09-22 18:35:50 +00:00
|
|
|
struct SyncRequest {
|
|
|
|
xcb_sync_counter_t counter;
|
|
|
|
xcb_sync_int64_t value;
|
|
|
|
xcb_sync_alarm_t alarm;
|
|
|
|
xcb_timestamp_t lastTimestamp;
|
|
|
|
QTimer *timeout, *failsafeTimeout;
|
|
|
|
bool isPending;
|
|
|
|
};
|
|
|
|
const SyncRequest &getSyncRequest() const {
|
|
|
|
return syncRequest;
|
|
|
|
}
|
|
|
|
void handleSync();
|
|
|
|
|
2016-05-09 14:01:49 +00:00
|
|
|
static void cleanupX11();
|
|
|
|
|
2013-07-22 14:07:39 +00:00
|
|
|
public Q_SLOTS:
|
2015-03-05 09:21:03 +00:00
|
|
|
void closeWindow() override;
|
2017-08-03 05:11:40 +00:00
|
|
|
void updateCaption() override;
|
2012-01-03 17:32:05 +00:00
|
|
|
|
2013-07-22 14:07:39 +00:00
|
|
|
private Q_SLOTS:
|
2011-01-30 14:34:42 +00:00
|
|
|
void shadeHover();
|
|
|
|
void shadeUnhover();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Use Workspace::createClient()
|
|
|
|
virtual ~Client(); ///< Use destroyClient() or releaseWindow()
|
|
|
|
|
|
|
|
// Handlers for X11 events
|
2013-07-26 11:46:06 +00:00
|
|
|
bool mapRequestEvent(xcb_map_request_event_t *e);
|
2013-07-26 11:34:54 +00:00
|
|
|
void unmapNotifyEvent(xcb_unmap_notify_event_t *e);
|
2013-07-26 11:40:43 +00:00
|
|
|
void destroyNotifyEvent(xcb_destroy_notify_event_t *e);
|
2013-07-26 11:56:16 +00:00
|
|
|
void configureRequestEvent(xcb_configure_request_event_t *e);
|
2013-07-26 11:17:23 +00:00
|
|
|
virtual void propertyNotifyEvent(xcb_property_notify_event_t *e) override;
|
2015-01-09 10:16:57 +00:00
|
|
|
void clientMessageEvent(xcb_client_message_event_t *e) override;
|
2013-07-26 12:22:43 +00:00
|
|
|
void enterNotifyEvent(xcb_enter_notify_event_t *e);
|
2013-07-26 12:29:47 +00:00
|
|
|
void leaveNotifyEvent(xcb_leave_notify_event_t *e);
|
2013-07-26 12:35:28 +00:00
|
|
|
void focusInEvent(xcb_focus_in_event_t *e);
|
2013-07-26 12:51:56 +00:00
|
|
|
void focusOutEvent(xcb_focus_out_event_t *e);
|
2013-04-26 09:00:08 +00:00
|
|
|
virtual void damageNotifyEvent();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2014-06-01 15:57:51 +00:00
|
|
|
bool buttonPressEvent(xcb_window_t w, int button, int state, int x, int y, int x_root, int y_root, xcb_timestamp_t time = XCB_CURRENT_TIME);
|
2013-05-03 08:32:18 +00:00
|
|
|
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 14:34:42 +00:00
|
|
|
|
2012-01-12 06:42:55 +00:00
|
|
|
Client* findAutogroupCandidate() const;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void debug(QDebug& stream) const;
|
2015-02-24 09:54:28 +00:00
|
|
|
void addDamage(const QRegion &damage) override;
|
2017-11-05 09:10:17 +00:00
|
|
|
bool belongsToSameApplication(const AbstractClient *other, SameApplicationChecks checks) const override;
|
2015-03-12 15:08:19 +00:00
|
|
|
void doSetActive() override;
|
2015-03-13 08:36:43 +00:00
|
|
|
void doSetKeepAbove() override;
|
|
|
|
void doSetKeepBelow() override;
|
2015-03-13 11:54:11 +00:00
|
|
|
void doSetDesktop(int desktop, int was_desk) override;
|
2015-03-13 13:45:21 +00:00
|
|
|
void doMinimize() override;
|
2015-06-06 19:17:23 +00:00
|
|
|
void doSetSkipPager() override;
|
2015-06-06 20:08:12 +00:00
|
|
|
void doSetSkipTaskbar() override;
|
2018-05-24 04:33:39 +00:00
|
|
|
void doSetSkipSwitcher() override;
|
2015-09-17 09:06:59 +00:00
|
|
|
bool belongsToDesktop() const override;
|
2015-10-13 11:52:03 +00:00
|
|
|
void setGeometryRestore(const QRect &geo) override;
|
2015-10-15 11:39:49 +00:00
|
|
|
void updateTabGroupStates(TabGroup::States states) override;
|
2015-10-15 13:28:01 +00:00
|
|
|
void doMove(int x, int y) override;
|
2015-10-22 16:16:21 +00:00
|
|
|
bool doStartMoveResize() override;
|
2015-10-23 11:05:55 +00:00
|
|
|
void doPerformMoveResize() override;
|
2015-10-23 11:33:18 +00:00
|
|
|
bool isWaitingForMoveResizeSync() const override;
|
|
|
|
void doResizeSync() override;
|
2015-10-26 14:49:03 +00:00
|
|
|
QSize resizeIncrements() const override;
|
2015-12-07 15:18:30 +00:00
|
|
|
bool acceptsFocus() const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2010-09-21 14:31:40 +00:00
|
|
|
//Signals for the scripting interface
|
2011-01-01 09:39:02 +00:00
|
|
|
//Signals make an excellent way for communication
|
2010-09-21 14:31:40 +00:00
|
|
|
//in between objects as compared to simple function
|
|
|
|
//calls
|
2013-07-22 14:07:39 +00:00
|
|
|
Q_SIGNALS:
|
2011-01-30 14:34:42 +00:00
|
|
|
void clientManaging(KWin::Client*);
|
2012-01-21 09:51:22 +00:00
|
|
|
void clientFullScreenSet(KWin::Client*, bool, bool);
|
2015-01-08 11:45:40 +00:00
|
|
|
|
2012-11-09 12:44:50 +00: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-31 17:09:00 +00:00
|
|
|
/**
|
|
|
|
* Emitted whenever the Client's block compositing state changes.
|
|
|
|
**/
|
2012-08-23 11:42:59 +00:00
|
|
|
void blockingCompositingChanged(KWin::Client *client);
|
2014-07-01 13:44:02 +00:00
|
|
|
void clientSideDecoratedChanged();
|
2011-01-30 14:34:42 +00: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;
|
2015-10-13 08:22:18 +00:00
|
|
|
void changeMaximize(bool horizontal, bool vertical, bool adjust) override;
|
2011-01-30 14:34:42 +00:00
|
|
|
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;
|
2017-07-21 18:22:56 +00:00
|
|
|
void setShortcutInternal() override;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
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 getSyncCounter();
|
|
|
|
void sendSyncRequest();
|
2015-10-22 13:58:24 +00:00
|
|
|
void leaveMoveResize() override;
|
2015-10-23 10:27:06 +00:00
|
|
|
void positionGeometryTip() override;
|
2011-01-30 14:34:42 +00:00
|
|
|
void grabButton(int mod);
|
|
|
|
void ungrabButton(int mod);
|
2014-07-25 11:14:53 +00:00
|
|
|
void resizeDecoration();
|
2013-05-07 07:46:40 +00:00
|
|
|
void createDecoration(const QRect &oldgeom);
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
void pingWindow();
|
2013-05-03 09:02:06 +00:00
|
|
|
void killProcess(bool ask, xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME);
|
2011-01-30 14:34:42 +00:00
|
|
|
void updateUrgency();
|
2013-05-03 08:55:37 +00:00
|
|
|
static void sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol,
|
2016-01-15 11:18:24 +00:00
|
|
|
uint32_t data1 = 0, uint32_t data2 = 0, uint32_t data3 = 0,
|
|
|
|
xcb_timestamp_t timestamp = xTime());
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2014-04-25 11:42:52 +00:00
|
|
|
void embedClient(xcb_window_t w, xcb_visualid_t visualid, xcb_colormap_t colormap, uint8_t depth);
|
2011-01-30 14:34:42 +00:00
|
|
|
void detectNoBorder();
|
2015-01-15 14:38:21 +00:00
|
|
|
Xcb::Property fetchGtkFrameExtents() const;
|
|
|
|
void readGtkFrameExtents(Xcb::Property &prop);
|
2014-07-01 13:44:02 +00:00
|
|
|
void detectGtkFrameExtents();
|
2015-12-03 12:24:44 +00:00
|
|
|
void destroyDecoration() override;
|
2011-01-30 14:34:42 +00:00
|
|
|
void updateFrameExtents();
|
|
|
|
|
2013-04-26 07:47:45 +00:00
|
|
|
void internalShow();
|
|
|
|
void internalHide();
|
|
|
|
void internalKeep();
|
|
|
|
void map();
|
|
|
|
void unmap();
|
2011-01-30 14:34:42 +00:00
|
|
|
void updateHiddenPreview();
|
|
|
|
|
|
|
|
void updateInputShape();
|
|
|
|
|
2013-05-03 09:29:50 +00:00
|
|
|
xcb_timestamp_t readUserTimeMapTimestamp(const KStartupInfoId* asn_id, const KStartupInfoData* asn_data,
|
2011-01-30 14:34:42 +00:00
|
|
|
bool session) const;
|
2013-05-03 09:29:50 +00:00
|
|
|
xcb_timestamp_t readUserCreationTime() const;
|
2011-01-30 14:34:42 +00:00
|
|
|
void startupIdChanged();
|
|
|
|
|
2011-11-09 19:39:13 +00:00
|
|
|
void updateInputWindow();
|
|
|
|
|
2015-01-15 14:51:21 +00:00
|
|
|
Xcb::Property fetchShowOnScreenEdge() const;
|
|
|
|
void readShowOnScreenEdge(Xcb::Property &property);
|
2014-02-20 11:39:23 +00:00
|
|
|
/**
|
|
|
|
* Reads the property and creates/destroys the screen edge if required
|
|
|
|
* and shows/hides the client.
|
|
|
|
**/
|
|
|
|
void updateShowOnScreenEdge();
|
|
|
|
|
2013-09-10 05:27:39 +00:00
|
|
|
Xcb::Window m_client;
|
2013-05-02 16:26:05 +00:00
|
|
|
Xcb::Window m_wrapper;
|
2013-09-10 06:13:33 +00:00
|
|
|
Xcb::Window m_frame;
|
2011-01-30 14:34:42 +00:00
|
|
|
QStringList activityList;
|
2013-03-24 20:57:26 +00:00
|
|
|
int m_activityUpdatesBlocked;
|
|
|
|
bool m_blockedActivityUpdatesRequireTransients;
|
2013-05-02 17:04:43 +00:00
|
|
|
Xcb::Window m_moveResizeGrabWindow;
|
2011-01-30 14:34:42 +00:00
|
|
|
bool move_resize_has_keyboard_grab;
|
2012-06-19 21:12:37 +00:00
|
|
|
bool m_managed;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
2015-01-21 15:05:29 +00:00
|
|
|
Xcb::GeometryHints m_geometryHints;
|
2011-01-30 14:34:42 +00:00
|
|
|
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;
|
|
|
|
|
2015-01-15 15:23:29 +00:00
|
|
|
Xcb::TransientFor fetchTransient() const;
|
|
|
|
void readTransientProperty(Xcb::TransientFor &transientFor);
|
2011-01-30 14:34:42 +00:00
|
|
|
void readTransient();
|
2013-05-03 06:53:35 +00:00
|
|
|
xcb_window_t verifyTransientFor(xcb_window_t transient_for, bool set);
|
2015-09-14 08:55:27 +00:00
|
|
|
void addTransient(AbstractClient* cl) override;
|
|
|
|
void removeTransient(AbstractClient* cl) override;
|
2011-01-30 14:34:42 +00:00
|
|
|
void removeFromMainClients();
|
|
|
|
void cleanGrouping();
|
|
|
|
void checkGroupTransients();
|
2013-05-03 06:53:35 +00:00
|
|
|
void setTransient(xcb_window_t new_transient_for_id);
|
|
|
|
xcb_window_t m_transientForId;
|
|
|
|
xcb_window_t m_originalTransientForId;
|
2011-01-30 14:34:42 +00:00
|
|
|
ShadeMode shade_mode;
|
2012-03-14 08:59:41 +00:00
|
|
|
Client *shade_below;
|
2011-01-30 14:34:42 +00:00
|
|
|
uint deleting : 1; ///< True when doing cleanup and destroying the client
|
2015-02-02 13:56:21 +00:00
|
|
|
Xcb::MotifHints m_motif;
|
2011-01-30 14:34:42 +00:00
|
|
|
uint hidden : 1; ///< Forcibly hidden by calling hide()
|
|
|
|
uint noborder : 1;
|
|
|
|
uint app_noborder : 1; ///< App requested no border via window type, shape extension, etc.
|
|
|
|
uint ignore_focus_stealing : 1; ///< Don't apply focus stealing prevention to this client
|
2011-03-20 14:42:05 +00:00
|
|
|
bool blocks_compositing;
|
2011-01-30 14:34:42 +00: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* shadeHoverTimer;
|
2013-05-03 09:46:18 +00:00
|
|
|
xcb_colormap_t m_colormap;
|
2017-08-02 16:41:38 +00:00
|
|
|
QString cap_normal, cap_iconic, cap_suffix;
|
2011-01-30 14:34:42 +00:00
|
|
|
Group* in_group;
|
|
|
|
QTimer* ping_timer;
|
2012-04-16 21:52:13 +00:00
|
|
|
qint64 m_killHelperPID;
|
2013-05-03 09:35:46 +00:00
|
|
|
xcb_timestamp_t m_pingTimestamp;
|
2013-05-03 09:29:50 +00:00
|
|
|
xcb_timestamp_t m_userTime;
|
2014-02-03 08:37:08 +00:00
|
|
|
NET::Actions allowed_actions;
|
2011-01-30 14:34:42 +00:00
|
|
|
QSize client_size;
|
|
|
|
bool shade_geometry_change;
|
2017-09-22 18:35:50 +00:00
|
|
|
SyncRequest syncRequest;
|
2011-01-30 14:34:42 +00:00
|
|
|
static bool check_active_modal; ///< \see Client::checkActiveModal()
|
|
|
|
int sm_stacking_order;
|
|
|
|
friend struct ResetupRulesProcedure;
|
|
|
|
|
|
|
|
friend bool performTransiencyCheck();
|
|
|
|
|
2015-01-15 15:31:20 +00:00
|
|
|
Xcb::StringProperty fetchActivities() const;
|
|
|
|
void readActivities(Xcb::StringProperty &property);
|
2011-01-30 14:34:42 +00:00
|
|
|
void checkActivities();
|
|
|
|
bool activitiesDefined; //whether the x property was actually set
|
|
|
|
|
2017-04-27 10:18:41 +00:00
|
|
|
bool sessionActivityOverride;
|
2012-11-07 23:54:05 +00:00
|
|
|
bool needsXWindowMove;
|
2011-11-09 19:39:13 +00:00
|
|
|
|
2013-02-04 10:20:15 +00:00
|
|
|
Xcb::Window m_decoInputExtent;
|
2011-11-09 19:39:13 +00:00
|
|
|
QPoint input_offset;
|
2013-08-05 07:48:14 +00:00
|
|
|
|
|
|
|
QTimer *m_focusOutTimer;
|
2013-10-14 05:17:07 +00:00
|
|
|
|
2014-02-26 10:26:00 +00:00
|
|
|
QList<QMetaObject::Connection> m_connections;
|
2014-07-01 13:44:02 +00:00
|
|
|
bool m_clientSideDecorated;
|
2015-10-11 20:48:29 +00:00
|
|
|
|
|
|
|
QMetaObject::Connection m_edgeRemoveConnection;
|
2017-03-08 22:54:58 +00:00
|
|
|
QMetaObject::Connection m_edgeGeometryTrackingConnection;
|
2011-01-30 14:34:42 +00:00
|
|
|
};
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2013-05-02 16:26:05 +00:00
|
|
|
inline xcb_window_t Client::wrapperId() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2013-05-02 16:26:05 +00:00
|
|
|
return m_wrapper;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2014-07-01 13:44:02 +00:00
|
|
|
inline bool Client::isClientSideDecorated() const
|
|
|
|
{
|
|
|
|
return m_clientSideDecorated;
|
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
inline bool Client::groupTransient() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2013-05-03 06:53:35 +00:00
|
|
|
return m_transientForId == rootWindow();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
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
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2013-05-03 06:53:35 +00:00
|
|
|
return m_originalTransientForId == rootWindow();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
inline bool Client::isTransient() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2013-05-03 06:53:35 +00:00
|
|
|
return m_transientForId != XCB_WINDOW_NONE;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
inline const Group* Client::group() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
return in_group;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
inline Group* Client::group()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
return in_group;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
inline bool Client::isShown(bool shaded_is_shown) const
|
|
|
|
{
|
|
|
|
return !isMinimized() && (!isShade() || shaded_is_shown) && !hidden &&
|
2012-01-12 06:42:55 +00:00
|
|
|
(!tabGroup() || tabGroup()->current() == this);
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
inline bool Client::isHiddenInternal() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2008-02-23 13:41:53 +00:00
|
|
|
return hidden;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2008-02-23 13:41:53 +00:00
|
|
|
|
2008-12-18 13:50:57 +00:00
|
|
|
inline ShadeMode Client::shadeMode() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
return shade_mode;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
inline QRect Client::geometryRestore() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
return geom_restore;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2015-10-13 11:52:03 +00:00
|
|
|
inline void Client::setGeometryRestore(const QRect &geo)
|
|
|
|
{
|
|
|
|
geom_restore = geo;
|
|
|
|
}
|
|
|
|
|
2014-12-02 12:49:08 +00:00
|
|
|
inline MaximizeMode Client::maximizeMode() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
return max_mode;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
inline bool Client::isFullScreen() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
return fullscreen_mode != FullScreenNone;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
inline bool Client::hasNETSupport() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
return info->hasNETSupport();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2013-05-03 09:46:18 +00:00
|
|
|
inline xcb_colormap_t Client::colormap() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2013-05-03 09:46:18 +00:00
|
|
|
return m_colormap;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
inline int Client::sessionStackingOrder() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
return sm_stacking_order;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
inline bool Client::isManaged() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2012-06-19 21:12:37 +00:00
|
|
|
return m_managed;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
inline QSize Client::clientSize() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
return client_size;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2011-12-22 18:38:52 +00:00
|
|
|
inline void Client::plainResize(const QSize& s, ForceGeometry_t force)
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2011-12-22 18:38:52 +00:00
|
|
|
plainResize(s.width(), s.height(), force);
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2015-05-27 09:48:33 +00:00
|
|
|
inline void Client::resizeWithChecks(int w, int h, AbstractClient::ForceGeometry_t force)
|
|
|
|
{
|
|
|
|
resizeWithChecks(w, h, XCB_GRAVITY_BIT_FORGET, force);
|
|
|
|
}
|
|
|
|
|
2015-01-21 15:05:29 +00:00
|
|
|
inline void Client::resizeWithChecks(const QSize& s, xcb_gravity_t gravity, ForceGeometry_t force)
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2015-01-21 15:05:29 +00:00
|
|
|
resizeWithChecks(s.width(), s.height(), gravity, force);
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
inline bool Client::hasUserTimeSupport() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
return info->userTime() != -1U;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2008-12-18 13:50:57 +00:00
|
|
|
|
2013-05-02 17:04:43 +00:00
|
|
|
inline xcb_window_t Client::moveResizeGrabWindow() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2013-05-02 17:04:43 +00:00
|
|
|
return m_moveResizeGrabWindow;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2007-07-04 09:51:10 +00:00
|
|
|
inline bool Client::hiddenPreview() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2008-08-12 11:02:58 +00:00
|
|
|
return mapping_state == Kept;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-07-04 09:51:10 +00:00
|
|
|
|
2013-02-14 14:19:35 +00:00
|
|
|
template <typename T>
|
|
|
|
inline void Client::print(T &stream) const
|
|
|
|
{
|
|
|
|
stream << "\'ID:" << window() << ";WMCLASS:" << resourceClass() << ":"
|
|
|
|
<< resourceName() << ";Caption:" << caption() << "\'";
|
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
} // namespace
|
2012-01-01 13:16:07 +00:00
|
|
|
Q_DECLARE_METATYPE(KWin::Client*)
|
2012-01-01 14:01:54 +00:00
|
|
|
Q_DECLARE_METATYPE(QList<KWin::Client*>)
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
#endif
|