From 08ad6c953fd43c34d148269cf51d7f514ab6b2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 22 Dec 2011 14:39:55 +0100 Subject: [PATCH] Active Property Emit proper signal when the Client's active status changes. --- activation.cpp | 4 +--- client.cpp | 5 ----- client.h | 14 ++++++-------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/activation.cpp b/activation.cpp index 0ed6d62ce8..bee9246682 100644 --- a/activation.cpp +++ b/activation.cpp @@ -257,9 +257,6 @@ void Workspace::setActiveClient(Client* c, allowed_t) updateColormap(); emit clientActivated(active_client); - if (active_client) { - active_client->sl_activated(); - } --set_active_client_recursion; } @@ -861,6 +858,7 @@ void Client::setActive(bool act) workspace()->updateClientLayer(*it); if (decoration != NULL) decoration->activeChange(); + emit activeChanged(); updateMouseGrab(); updateUrgency(); // demand attention again if it's still urgent workspace()->checkUnredirect(); diff --git a/client.cpp b/client.cpp index 0b32fa396a..5cdbc56080 100644 --- a/client.cpp +++ b/client.cpp @@ -1968,11 +1968,6 @@ void Client::getWMHints() updateAllowedActions(); // Group affects isMinimizable() } -void Client::sl_activated() -{ - emit s_activated(); -} - void Client::getMotifHints() { bool mgot_noborder, mnoborder, mresize, mmove, mminimize, mmaximize, mclose; diff --git a/client.h b/client.h index a087a6d975..e8e8f1a8a3 100644 --- a/client.h +++ b/client.h @@ -71,8 +71,11 @@ class Client : public Toplevel { Q_OBJECT - // TODO: notify signal - Q_PROPERTY(bool active READ isActive) + /** + * Whether this Client is active or not. Use Workspace::activateClient() to activate a Client. + * @see Workspace::activateClient + **/ + Q_PROPERTY(bool active READ isActive NOTIFY activeChanged) // TODO: notify signal Q_PROPERTY(QString caption READ caption) // TODO: notify signal @@ -512,7 +515,6 @@ signals: void s_minimized(); void s_unminimized(); void maximizeSet(QPair); - void s_activated(); void s_fullScreenSet(bool, bool); void clientMaximizedStateChanged(KWin::Client*, KDecorationDefines::MaximizeMode); void clientMinimized(KWin::Client* client, bool animate); @@ -520,11 +522,7 @@ signals: void clientStartUserMovedResized(KWin::Client*); void clientStepUserMovedResized(KWin::Client *, const QRect&); void clientFinishUserMovedResized(KWin::Client*); - - // To make workspace-client calls, a few slots are also - // required -public slots: - void sl_activated(); + void activeChanged(); private: void exportMappingState(int s); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1