Move Q_PROPERTY definitions from Client to AbstractClient

The properties:
 * maximizable
 * moveable
 * moveableAcrossScreens
 * resizeable

Were only defined on Client instead of AbstractClient. This resulted
in the EffectWindow having those properties evaluate always to false
for a ShellClient and breaking some effects.

BUG: 355947
This commit is contained in:
Martin Gräßlin 2016-08-29 07:53:26 +02:00
parent 1c1dca6da4
commit 42e82f09be
3 changed files with 32 additions and 24 deletions

View file

@ -220,6 +220,30 @@ class KWIN_EXPORT AbstractClient : public Toplevel
* show the help button or not.
**/
Q_PROPERTY(bool providesContextHelp READ providesContextHelp CONSTANT)
/**
* 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.
**/
Q_PROPERTY(bool maximizable READ isMaximizable)
/**
* 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
**/
Q_PROPERTY(bool moveable READ isMovable)
/**
* 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
**/
Q_PROPERTY(bool moveableAcrossScreens READ isMovableAcrossScreens)
/**
* Whether the Client can be resized. The property is evaluated each time it is invoked.
* Because of that there is no notify signal.
**/
Q_PROPERTY(bool resizeable READ isResizable)
public:
virtual ~AbstractClient();

View file

@ -121,6 +121,14 @@ void TestShellClient::testMapUnmapMap()
QVERIFY(client->hasAlpha());
QCOMPARE(workspace()->activeClient(), client);
QVERIFY(effectsWindowShownSpy.isEmpty());
QVERIFY(client->isMaximizable());
QVERIFY(client->isMovable());
QVERIFY(client->isMovableAcrossScreens());
QVERIFY(client->isResizable());
QVERIFY(client->property("maximizable").toBool());
QVERIFY(client->property("moveable").toBool());
QVERIFY(client->property("moveableAcrossScreens").toBool());
QVERIFY(client->property("resizeable").toBool());
// now unmap
QSignalSpy hiddenSpy(client, &ShellClient::windowHidden);

View file

@ -65,30 +65,6 @@ class KWIN_EXPORT Client
: public AbstractClient
{
Q_OBJECT
/**
* 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.
**/
Q_PROPERTY(bool maximizable READ isMaximizable)
/**
* 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
**/
Q_PROPERTY(bool moveable READ isMovable)
/**
* 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
**/
Q_PROPERTY(bool moveableAcrossScreens READ isMovableAcrossScreens)
/**
* Whether the Client can be resized. The property is evaluated each time it is invoked.
* Because of that there is no notify signal.
**/
Q_PROPERTY(bool resizeable READ isResizable)
/**
* 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.