From 0976bdfb17d522d2479604790ab750901ccf61f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 22 Dec 2011 17:00:08 +0100 Subject: [PATCH] Adding transient (for) properties TransientFor is a QObject property as we cannot declare Client as a metatype. --- client.h | 15 +++++++++++---- group.cpp | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/client.h b/client.h index a000c10b61..011b21fdf5 100644 --- a/client.h +++ b/client.h @@ -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 diff --git a/group.cpp b/group.cpp index 0491dece76..902cc50dfb 100644 --- a/group.cpp +++ b/group.cpp @@ -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(); } }