refactor: port numScreens property

This commit is contained in:
Mikhail Zolotukhin 2022-03-25 14:25:56 +03:00 committed by Genda
parent c06c840b29
commit 2a3be3a901
3 changed files with 10 additions and 1 deletions

View File

@ -18,6 +18,14 @@
m_kwinImpl->setProperty(#NAME, QVariant::fromValue(value)); \
}
#define BI_READONLY_PROPERTY(TYPE, NAME) \
Q_PROPERTY(TYPE NAME READ NAME); \
\
TYPE NAME() const \
{ \
return m_kwinImpl->property(#NAME).value<TYPE>(); \
}
/**
* Wrap QML API method
*

View File

@ -40,6 +40,7 @@ public:
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.

View File

@ -102,7 +102,7 @@ export class DriverImpl implements Driver {
public get screens(): DriverSurface[] {
const screensArr = [];
for (let screen = 0; screen < this.kwinApi.workspace.numScreens; screen++) {
for (let screen = 0; screen < this.proxy.workspace().numScreens; screen++) {
screensArr.push(
new DriverSurfaceImpl(
screen,