mirror of
https://github.com/Bismuth-Forge/bismuth.git
synced 2024-09-11 00:15:37 +03:00
refactor: wrap currentActivity Property
This commit is contained in:
parent
eb9d989a3a
commit
91a277ea1e
@ -42,6 +42,7 @@ void Workspace::wrapSignals()
|
||||
};
|
||||
|
||||
wrapComplexSignal(SIGNAL(currentDesktopChanged(int, KWin::AbstractClient *)), SLOT(currentDesktopChangedTransformer(int, KWin::AbstractClient *)));
|
||||
wrapSimpleSignal(SIGNAL(currentActivityChanged(const QString &)));
|
||||
};
|
||||
|
||||
QRect Workspace::clientArea(ClientAreaOption option, int screen, int desktop)
|
||||
|
@ -38,6 +38,7 @@ public:
|
||||
Workspace(const Workspace &);
|
||||
|
||||
BI_PROPERTY(int, currentDesktop, setCurrentDesktop);
|
||||
BI_PROPERTY(QString, currentActivity, setCurrentActivity);
|
||||
|
||||
/**
|
||||
* Returns the geometry a Client can use with the specified option.
|
||||
@ -57,6 +58,12 @@ private Q_SLOTS:
|
||||
Q_SIGNALS:
|
||||
void currentDesktopChanged(int desktop, PlasmaApi::Client kwinClient);
|
||||
|
||||
/**
|
||||
* Signal emitted whenever the current activity changed.
|
||||
* @param id id of the new activity
|
||||
*/
|
||||
void currentActivityChanged(const QString &id);
|
||||
|
||||
private:
|
||||
void wrapSignals();
|
||||
|
||||
|
@ -67,7 +67,7 @@ export class DriverImpl implements Driver {
|
||||
this.kwinApi.workspace.activeClient
|
||||
? this.kwinApi.workspace.activeClient.screen
|
||||
: 0,
|
||||
this.kwinApi.workspace.currentActivity,
|
||||
this.proxy.workspace().currentActivity,
|
||||
this.proxy.workspace().currentDesktop,
|
||||
this.qml.activityInfo,
|
||||
this.kwinApi,
|
||||
@ -107,7 +107,7 @@ export class DriverImpl implements Driver {
|
||||
screensArr.push(
|
||||
new DriverSurfaceImpl(
|
||||
screen,
|
||||
this.kwinApi.workspace.currentActivity,
|
||||
this.proxy.workspace().currentActivity,
|
||||
this.proxy.workspace().currentDesktop,
|
||||
this.qml.activityInfo,
|
||||
this.kwinApi,
|
||||
@ -179,7 +179,7 @@ export class DriverImpl implements Driver {
|
||||
const onScreenResized = (screen: number): void => {
|
||||
const srf = new DriverSurfaceImpl(
|
||||
screen,
|
||||
this.kwinApi.workspace.currentActivity,
|
||||
this.proxy.workspace().currentActivity,
|
||||
this.proxy.workspace().currentDesktop,
|
||||
this.qml.activityInfo,
|
||||
this.kwinApi,
|
||||
|
@ -161,12 +161,12 @@ export class DriverWindowImpl implements DriverWindow {
|
||||
public get surface(): DriverSurface {
|
||||
let activity;
|
||||
if (this.client.activities.length === 0) {
|
||||
activity = this.kwinApi.workspace.currentActivity;
|
||||
activity = this.proxy.workspace().currentActivity;
|
||||
} else if (
|
||||
this.client.activities.indexOf(this.kwinApi.workspace.currentActivity) >=
|
||||
this.client.activities.indexOf(this.proxy.workspace().currentActivity) >=
|
||||
0
|
||||
) {
|
||||
activity = this.kwinApi.workspace.currentActivity;
|
||||
activity = this.proxy.workspace().currentActivity;
|
||||
} else {
|
||||
activity = this.client.activities[0];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user