From 01633be601c6081a47a9561d34a23dd8ab518d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 22 Dec 2011 14:53:11 +0100 Subject: [PATCH] Add captionChanged signal Emitted during setCaption. The Q_PROPERTY has no setter as caption is provided through WM_NAME. --- client.cpp | 1 + client.h | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client.cpp b/client.cpp index 5cdbc56080..c688c0a2dd 100644 --- a/client.cpp +++ b/client.cpp @@ -1869,6 +1869,7 @@ void Client::setCaption(const QString& _s, bool force) client_group->updateItems(); decoration->captionChange(); } + emit captionChanged(); } } diff --git a/client.h b/client.h index e8e8f1a8a3..b8ff3ed86b 100644 --- a/client.h +++ b/client.h @@ -76,8 +76,11 @@ class Client * @see Workspace::activateClient **/ Q_PROPERTY(bool active READ isActive NOTIFY activeChanged) - // TODO: notify signal - Q_PROPERTY(QString caption READ caption) + /** + * The Caption of the Client. Read from WM_NAME property together with a suffix for hostname and shortcut. + * To read only the caption as provided by WM_NAME, use the getter with an additional @c false value. + **/ + Q_PROPERTY(QString caption READ caption NOTIFY captionChanged) // TODO: notify signal Q_PROPERTY(bool closeable READ isCloseable) // TODO: notify signal @@ -523,6 +526,7 @@ signals: void clientStepUserMovedResized(KWin::Client *, const QRect&); void clientFinishUserMovedResized(KWin::Client*); void activeChanged(); + void captionChanged(); private: void exportMappingState(int s); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1