From b5e29933d1337991a341e40f0f368bbdc15e499f Mon Sep 17 00:00:00 2001 From: Mikhail Zolotukhin Date: Fri, 25 Mar 2022 16:05:52 +0300 Subject: [PATCH] refactor: port activeScreens property --- src/core/plasma-api/workspace.hpp | 3 ++- src/kwinscript/driver/index.ts | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/plasma-api/workspace.hpp b/src/core/plasma-api/workspace.hpp index da2332ba..fd1168f1 100644 --- a/src/core/plasma-api/workspace.hpp +++ b/src/core/plasma-api/workspace.hpp @@ -37,10 +37,11 @@ public: Workspace(QQmlEngine *engine); Workspace(const Workspace &); + BI_READONLY_PROPERTY(int, numScreens); + BI_READONLY_PROPERTY(int, activeScreen); BI_PROPERTY(int, currentDesktop, setCurrentDesktop); BI_PROPERTY(QString, currentActivity, setCurrentActivity); BI_PROPERTY(int, desktops, setDesktops); - BI_READONLY_PROPERTY(int, numScreens); /** * Returns the geometry a Client can use with the specified option. diff --git a/src/kwinscript/driver/index.ts b/src/kwinscript/driver/index.ts index 1856328d..67d8af3c 100644 --- a/src/kwinscript/driver/index.ts +++ b/src/kwinscript/driver/index.ts @@ -64,9 +64,7 @@ export interface Driver { export class DriverImpl implements Driver { public get currentSurface(): DriverSurface { return new DriverSurfaceImpl( - this.kwinApi.workspace.activeClient - ? this.kwinApi.workspace.activeClient.screen - : 0, + this.proxy.workspace().activeScreen, this.proxy.workspace().currentActivity, this.proxy.workspace().currentDesktop, this.qml.activityInfo,