Commit 45c6e4b8 authored by Tiago Corrêa's avatar Tiago Corrêa Committed by Vlad Zahorodnii

scripting: Introduce ClientModelByScreenAndActivity

Summary: Provide for KWin scripts the possibility to work with a activities aware ClientModel. In the same way that the ClientModelByScreenAndDesktop works with virtual desktops.

Reviewers: #kwin, mart, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29284
parent d5033078
......@@ -709,6 +709,7 @@ void KWin::Scripting::init()
qmlRegisterType<KWin::ScriptingClientModel::SimpleClientModel>("org.kde.kwin", 2, 0, "ClientModel");
qmlRegisterType<KWin::ScriptingClientModel::ClientModelByScreen>("org.kde.kwin", 2, 0, "ClientModelByScreen");
qmlRegisterType<KWin::ScriptingClientModel::ClientModelByScreenAndDesktop>("org.kde.kwin", 2, 0, "ClientModelByScreenAndDesktop");
qmlRegisterType<KWin::ScriptingClientModel::ClientModelByScreenAndActivity>("org.kde.kwin", 2, 1, "ClientModelByScreenAndActivity");
qmlRegisterType<KWin::ScriptingClientModel::ClientFilterModel>("org.kde.kwin", 2, 0, "ClientFilterModel");
qmlRegisterType<KWin::AbstractClient>();
qmlRegisterType<KWin::X11Client>();
......
......@@ -847,6 +847,7 @@ name::~name() {}
CLIENT_MODEL_WRAPPER(SimpleClientModel, QList<LevelRestriction>())
CLIENT_MODEL_WRAPPER(ClientModelByScreen, QList<LevelRestriction>() << ScreenRestriction)
CLIENT_MODEL_WRAPPER(ClientModelByScreenAndDesktop, QList<LevelRestriction>() << ScreenRestriction << VirtualDesktopRestriction)
CLIENT_MODEL_WRAPPER(ClientModelByScreenAndActivity, QList<LevelRestriction>() << ScreenRestriction << ActivityRestriction)
#undef CLIENT_MODEL_WRAPPER
ClientFilterModel::ClientFilterModel(QObject *parent)
......
......@@ -268,6 +268,14 @@ public:
~ClientModelByScreenAndDesktop() override;
};
class ClientModelByScreenAndActivity : public ClientModel
{
Q_OBJECT
public:
ClientModelByScreenAndActivity(QObject *parent = nullptr);
~ClientModelByScreenAndActivity() override;
};
/**
* @brief Custom QSortFilterProxyModel to filter on Client caption, role and class.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment