mirror of
https://github.com/Bismuth-Forge/bismuth.git
synced 2024-09-19 04:27:09 +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 *)));
|
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)
|
QRect Workspace::clientArea(ClientAreaOption option, int screen, int desktop)
|
||||||
|
@ -38,6 +38,7 @@ public:
|
|||||||
Workspace(const Workspace &);
|
Workspace(const Workspace &);
|
||||||
|
|
||||||
BI_PROPERTY(int, currentDesktop, setCurrentDesktop);
|
BI_PROPERTY(int, currentDesktop, setCurrentDesktop);
|
||||||
|
BI_PROPERTY(QString, currentActivity, setCurrentActivity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the geometry a Client can use with the specified option.
|
* Returns the geometry a Client can use with the specified option.
|
||||||
@ -57,6 +58,12 @@ private Q_SLOTS:
|
|||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void currentDesktopChanged(int desktop, PlasmaApi::Client kwinClient);
|
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:
|
private:
|
||||||
void wrapSignals();
|
void wrapSignals();
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ export class DriverImpl implements Driver {
|
|||||||
this.kwinApi.workspace.activeClient
|
this.kwinApi.workspace.activeClient
|
||||||
? this.kwinApi.workspace.activeClient.screen
|
? this.kwinApi.workspace.activeClient.screen
|
||||||
: 0,
|
: 0,
|
||||||
this.kwinApi.workspace.currentActivity,
|
this.proxy.workspace().currentActivity,
|
||||||
this.proxy.workspace().currentDesktop,
|
this.proxy.workspace().currentDesktop,
|
||||||
this.qml.activityInfo,
|
this.qml.activityInfo,
|
||||||
this.kwinApi,
|
this.kwinApi,
|
||||||
@ -107,7 +107,7 @@ export class DriverImpl implements Driver {
|
|||||||
screensArr.push(
|
screensArr.push(
|
||||||
new DriverSurfaceImpl(
|
new DriverSurfaceImpl(
|
||||||
screen,
|
screen,
|
||||||
this.kwinApi.workspace.currentActivity,
|
this.proxy.workspace().currentActivity,
|
||||||
this.proxy.workspace().currentDesktop,
|
this.proxy.workspace().currentDesktop,
|
||||||
this.qml.activityInfo,
|
this.qml.activityInfo,
|
||||||
this.kwinApi,
|
this.kwinApi,
|
||||||
@ -179,7 +179,7 @@ export class DriverImpl implements Driver {
|
|||||||
const onScreenResized = (screen: number): void => {
|
const onScreenResized = (screen: number): void => {
|
||||||
const srf = new DriverSurfaceImpl(
|
const srf = new DriverSurfaceImpl(
|
||||||
screen,
|
screen,
|
||||||
this.kwinApi.workspace.currentActivity,
|
this.proxy.workspace().currentActivity,
|
||||||
this.proxy.workspace().currentDesktop,
|
this.proxy.workspace().currentDesktop,
|
||||||
this.qml.activityInfo,
|
this.qml.activityInfo,
|
||||||
this.kwinApi,
|
this.kwinApi,
|
||||||
|
@ -161,12 +161,12 @@ export class DriverWindowImpl implements DriverWindow {
|
|||||||
public get surface(): DriverSurface {
|
public get surface(): DriverSurface {
|
||||||
let activity;
|
let activity;
|
||||||
if (this.client.activities.length === 0) {
|
if (this.client.activities.length === 0) {
|
||||||
activity = this.kwinApi.workspace.currentActivity;
|
activity = this.proxy.workspace().currentActivity;
|
||||||
} else if (
|
} else if (
|
||||||
this.client.activities.indexOf(this.kwinApi.workspace.currentActivity) >=
|
this.client.activities.indexOf(this.proxy.workspace().currentActivity) >=
|
||||||
0
|
0
|
||||||
) {
|
) {
|
||||||
activity = this.kwinApi.workspace.currentActivity;
|
activity = this.proxy.workspace().currentActivity;
|
||||||
} else {
|
} else {
|
||||||
activity = this.client.activities[0];
|
activity = this.client.activities[0];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user