refactor: port desktops workspace function

This commit is contained in:
Mikhail Zolotukhin 2022-03-24 23:25:53 +03:00 committed by Genda
parent aa4504e32a
commit c06c840b29
4 changed files with 2 additions and 10 deletions

View File

@ -39,6 +39,7 @@ public:
BI_PROPERTY(int, currentDesktop, setCurrentDesktop);
BI_PROPERTY(QString, currentActivity, setCurrentActivity);
BI_PROPERTY(int, desktops, setDesktops);
/**
* Returns the geometry a Client can use with the specified option.

View File

@ -70,7 +70,6 @@ export class DriverImpl implements Driver {
this.proxy.workspace().currentActivity,
this.proxy.workspace().currentDesktop,
this.qml.activityInfo,
this.kwinApi,
this.config,
this.proxy
);
@ -110,7 +109,6 @@ export class DriverImpl implements Driver {
this.proxy.workspace().currentActivity,
this.proxy.workspace().currentDesktop,
this.qml.activityInfo,
this.kwinApi,
this.config,
this.proxy
)
@ -157,7 +155,6 @@ export class DriverImpl implements Driver {
new DriverWindowImpl(
client,
this.qml,
this.kwinApi,
this.config,
this.log,
this.proxy
@ -182,7 +179,6 @@ export class DriverImpl implements Driver {
this.proxy.workspace().currentActivity,
this.proxy.workspace().currentDesktop,
this.qml.activityInfo,
this.kwinApi,
this.config,
this.proxy
);

View File

@ -44,7 +44,6 @@ export class DriverSurfaceImpl implements DriverSurface {
public readonly activity: string,
public readonly desktop: number,
private activityInfo: Plasma.TaskManager.ActivityInfo,
private kwinApi: KWin.Api,
private config: Config,
private proxy: TSProxy
) {
@ -66,7 +65,7 @@ export class DriverSurfaceImpl implements DriverSurface {
public next(): DriverSurface | null {
// This is the last virtual desktop
if (this.desktop === this.kwinApi.workspace.desktops) {
if (this.desktop === this.proxy.workspace().desktops) {
return null;
}
@ -75,7 +74,6 @@ export class DriverSurfaceImpl implements DriverSurface {
this.activity,
this.desktop + 1,
this.activityInfo,
this.kwinApi,
this.config,
this.proxy
);

View File

@ -181,7 +181,6 @@ export class DriverWindowImpl implements DriverWindow {
activity,
desktop,
this.qml.activityInfo,
this.kwinApi,
this.config,
this.proxy
);
@ -205,14 +204,12 @@ export class DriverWindowImpl implements DriverWindow {
*
* @param client the client the window represents
* @param qml root qml object of the script
* @param kwinApi
* @param config
* @param log
*/
constructor(
public readonly client: KWin.Client,
private qml: Bismuth.Qml.Main,
private kwinApi: KWin.Api,
private config: Config,
private log: Log,
private proxy: TSProxy