refactor: port screenResized and currentActivityChanged signals

This commit is contained in:
Mikhail Zolotukhin 2022-03-26 14:17:32 +03:00 committed by Genda
parent e8cd561eee
commit 7b81428a79
2 changed files with 2 additions and 21 deletions

View File

@ -32,6 +32,8 @@ void Controller::bindEvents()
auto &workspace = m_plasmaApi.workspace();
connect(&workspace, &PlasmaApi::Workspace::currentDesktopChanged, this, &Controller::onCurrentSurfaceChanged);
connect(&workspace, &PlasmaApi::Workspace::numberScreensChanged, this, &Controller::onSurfaceUpdate);
connect(&workspace, &PlasmaApi::Workspace::screenResized, this, &Controller::onSurfaceUpdate);
connect(&workspace, &PlasmaApi::Workspace::currentActivityChanged, this, &Controller::onCurrentSurfaceChanged);
}
void Controller::registerAction(const Action &data)

View File

@ -167,22 +167,6 @@ export class DriverImpl implements Driver {
}
public bindEvents(): void {
const onScreenResized = (screen: number): void => {
const srf = new DriverSurfaceImpl(
screen,
this.proxy.workspace().currentActivity,
this.proxy.workspace().currentDesktop,
this.qml.activityInfo,
this.config,
this.proxy
);
this.controller.onSurfaceUpdate();
};
const onCurrentActivityChanged = (_activity: string): void => {
this.controller.onCurrentSurfaceChanged();
};
const onClientAdded = (client: KWin.Client): void => {
this.log.log(`Client added: ${client}`);
@ -238,11 +222,6 @@ export class DriverImpl implements Driver {
"unminimized"
);
this.connect(this.kwinApi.workspace.screenResized, onScreenResized);
this.connect(
this.kwinApi.workspace.currentActivityChanged,
onCurrentActivityChanged
);
this.connect(this.kwinApi.workspace.clientAdded, onClientAdded);
this.connect(this.kwinApi.workspace.clientRemoved, onClientRemoved);
this.connect(this.kwinApi.workspace.clientMaximizeSet, onClientMaximizeSet);