From 76297196e898c838ed89d21f44e8a8560cd7391f Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 29 Jan 2020 15:39:14 +0200 Subject: [PATCH] [scripting] Expose Workspace::sendClientToDesktop() Summary: BUG: 416093 FIXED-IN: 5.18.0 Test Plan: Only compile-time check. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D26988 --- scripting/workspace_wrapper.cpp | 8 ++++++++ scripting/workspace_wrapper.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/scripting/workspace_wrapper.cpp b/scripting/workspace_wrapper.cpp index 9a40a0ec5e..79f133e426 100644 --- a/scripting/workspace_wrapper.cpp +++ b/scripting/workspace_wrapper.cpp @@ -347,6 +347,14 @@ QSize WorkspaceWrapper::virtualScreenSize() const return screens()->size(); } +void WorkspaceWrapper::sendClientToScreen(AbstractClient *client, int screen) +{ + if (screen < 0 || screen >= screens()->count()) { + return; + } + workspace()->sendClientToScreen(client, screen); +} + QtScriptWorkspaceWrapper::QtScriptWorkspaceWrapper(QObject* parent) : WorkspaceWrapper(parent) {} diff --git a/scripting/workspace_wrapper.h b/scripting/workspace_wrapper.h index c4024c215f..b3c40affee 100644 --- a/scripting/workspace_wrapper.h +++ b/scripting/workspace_wrapper.h @@ -330,6 +330,11 @@ public Q_SLOTS: void slotWindowToDesktopUp(); void slotWindowToDesktopDown(); + /** + * Sends the AbstractClient to the given @p screen. + */ + void sendClientToScreen(KWin::AbstractClient *client, int screen); + /** * Shows an outline at the specified @p geometry. * If an outline is already shown the outline is moved to the new position.