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

scripting: Make workspace.currentActivity writable

Summary: Allows KWin scripts to change the value of workspace.currentActivity property.

Reviewers: #kwin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29458
parent 471554b7
......@@ -113,6 +113,17 @@ QString WorkspaceWrapper::currentActivity() const
#endif
}
void WorkspaceWrapper::setCurrentActivity(QString activity)
{
#ifdef KWIN_BUILD_ACTIVITIES
if (Activities::self()) {
Activities::self()->setCurrent(activity);
}
#else
Q_UNUSED(activity)
#endif
}
QStringList WorkspaceWrapper::activityList() const
{
#ifdef KWIN_BUILD_ACTIVITIES
......
......@@ -70,7 +70,7 @@ class WorkspaceWrapper : public QObject
Q_PROPERTY(int displayHeight READ displayHeight)
Q_PROPERTY(int activeScreen READ activeScreen)
Q_PROPERTY(int numScreens READ numScreens NOTIFY numberScreensChanged)
Q_PROPERTY(QString currentActivity READ currentActivity NOTIFY currentActivityChanged)
Q_PROPERTY(QString currentActivity READ currentActivity WRITE setCurrentActivity NOTIFY currentActivityChanged)
Q_PROPERTY(QStringList activities READ activityList NOTIFY activitiesChanged)
/**
* The bounding size of all screens combined. Overlapping areas
......@@ -208,6 +208,7 @@ rettype getter() const; \
void setter( rettype val );
GETTERSETTERDEF(int, numberOfDesktops, setNumberOfDesktops)
GETTERSETTERDEF(int, currentDesktop, setCurrentDesktop)
GETTERSETTERDEF(QString, currentActivity, setCurrentActivity)
GETTERSETTERDEF(KWin::AbstractClient*, activeClient, setActiveClient)
#undef GETTERSETTERDEF
QSize desktopGridSize() const;
......@@ -221,7 +222,6 @@ void setter( rettype val );
QSize displaySize() const;
int activeScreen() const;
int numScreens() const;
QString currentActivity() const;
QStringList activityList() const;
QSize virtualScreenSize() const;
QRect virtualScreenGeometry() const;
......
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