Adding transient (for) properties

TransientFor is a QObject property as we cannot declare Client as
a metatype.
This commit is contained in:
Martin Gräßlin 2011-12-22 17:00:08 +01:00
parent 138ff0a77b
commit 0976bdfb17
2 changed files with 12 additions and 4 deletions

View file

@ -123,10 +123,16 @@ class Client
Q_PROPERTY(bool shadeable READ isShadeable)
// TODO: proper setShade method and notifiy signal
Q_PROPERTY(bool shade READ isShade)
// TODO: notify signal
Q_PROPERTY(bool transient READ isTransient)
// TODO: notify signal, add meta type
Q_PROPERTY(Client *transientFor READ transientFor)
/**
* 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.
* Property uses a QObject. If the property is needed as a Client, perform a qobject_cast.
**/
Q_PROPERTY(QObject *transientFor READ transientFor NOTIFY transientChanged)
public:
Client(Workspace* ws);
Window wrapperId() const;
@ -542,6 +548,7 @@ signals:
void captionChanged();
void desktopChanged();
void fullScreenChanged();
void transientChanged();
private:
void exportMappingState(int s); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1

View file

@ -628,6 +628,7 @@ void Client::setTransient(Window new_transient_for_id)
checkGroup(NULL, true); // force, because transiency has changed
workspace()->updateClientLayer(this);
workspace()->resetUpdateToolWindowsTimer();
emit transientChanged();
}
}