Move properties move and resize from Client to AbstractClient

Includes the public methods isMove() and isResize() and the signal
moveResizedChanged().
This commit is contained in:
Martin Gräßlin 2015-10-16 13:15:09 +02:00
parent 8a3be2bacd
commit c9dbd94812
2 changed files with 18 additions and 18 deletions

View file

@ -178,6 +178,16 @@ class KWIN_EXPORT AbstractClient : public Toplevel
* might be emitted at each resize step or only at the end of the resize operation.
**/
Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry)
/**
* 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)
public:
virtual ~AbstractClient();
@ -426,6 +436,13 @@ public:
QSize adjustedSize(const QSize&, Sizemode mode = SizemodeAny) const;
QSize adjustedSize() const;
bool isMove() const {
return isMoveResize() && moveResizePointerMode() == PositionCenter;
}
bool isResize() const {
return isMoveResize() && moveResizePointerMode() != PositionCenter;
}
virtual bool hasStrut() const;
void setModal(bool modal);
@ -473,6 +490,7 @@ Q_SIGNALS:
void transientChanged();
void modalChanged();
void quickTileModeChanged();
void moveResizedChanged();
protected:
AbstractClient();

View file

@ -111,16 +111,6 @@ class Client
* 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 .
@ -377,13 +367,6 @@ public:
*/
bool hasOffscreenXineramaStrut() const;
bool isMove() const {
return isMoveResize() && moveResizePointerMode() == PositionCenter;
}
bool isResize() const {
return isMoveResize() && moveResizePointerMode() != PositionCenter;
}
// Decorations <-> Effects
KDecoration2::Decoration *decoration() {
return m_decoration;
@ -502,7 +485,6 @@ Q_SIGNALS:
void clientStartUserMovedResized(KWin::Client*);
void clientStepUserMovedResized(KWin::Client *, const QRect&);
void clientFinishUserMovedResized(KWin::Client*);
void moveResizedChanged();
/**
* Emitted whenever the Client's TabGroup changed. That is whenever the Client is moved to