From bc1b769d7fbf06663b2a0caf6d814b97b156b042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 22 Jun 2012 09:51:27 +0200 Subject: [PATCH] Export a getClient method to Scripting bindings Finds a Client by windowId. REVIEW: 105323 --- scripting/workspace_wrapper.cpp | 5 +++++ scripting/workspace_wrapper.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/scripting/workspace_wrapper.cpp b/scripting/workspace_wrapper.cpp index 8aef2eb48c..2879cd9b55 100644 --- a/scripting/workspace_wrapper.cpp +++ b/scripting/workspace_wrapper.cpp @@ -215,4 +215,9 @@ void WorkspaceWrapper::hideOutline() Workspace::self()->outline()->hide(); } +Client *WorkspaceWrapper::getClient(qulonglong windowId) +{ + return Workspace::self()->findClient(WindowMatchPredicate(windowId)); +} + } // KWin diff --git a/scripting/workspace_wrapper.h b/scripting/workspace_wrapper.h index a080d7809e..fecfaca712 100644 --- a/scripting/workspace_wrapper.h +++ b/scripting/workspace_wrapper.h @@ -196,6 +196,12 @@ void setter( rettype val ); * Provides support information about the currently running KWin instance. **/ Q_SCRIPTABLE QString supportInformation() const; + /** + * Finds the Client with the given @p windowId. + * @param windowId The window Id of the Client + * @return The found Client or @c null + **/ + Q_SCRIPTABLE KWin::Client *getClient(qulonglong windowId); public Q_SLOTS: // all the available key bindings