fix(kwinscript): arrange after kwin moves a window between screens

...instead of forcing it back where it was. KWin changes a window's
size before moving it between screens, so we can't react to a
geometry change by always changing it back.
This commit is contained in:
Thomas Stilwell 2022-06-21 04:44:04 -05:00 committed by Mikhail Zolotukhin
parent 73f43477ec
commit 3c6b367a3a
2 changed files with 14 additions and 4 deletions

View File

@ -77,6 +77,12 @@ export interface Controller {
*/
onWindowResizeStart(window: EngineWindow): void;
/**
* React to window changing screens
* @param window the window whose screen has changed
*/
onWindowScreenChanged(window: EngineWindow): void;
/**
* React to window resize operation end. The window
* resize operation ends, when the users drops
@ -336,7 +342,11 @@ export class ControllerImpl implements Controller {
public onWindowGeometryChanged(window: EngineWindow): void {
this.log.log(["onWindowGeometryChanged", { window }]);
this.engine.enforceSize(window);
}
public onWindowScreenChanged(_window: EngineWindow): void {
//TODO only arrange the surface the window came from and went to
this.engine.arrange();
}
// NOTE: accepts `null` to simplify caller. This event is a catch-all hack

View File

@ -370,9 +370,9 @@ export class DriverImpl implements Driver {
}
});
this.connect(client.screenChanged, () =>
this.controller.onWindowChanged(window, `screen=${client.screen}`)
);
this.connect(client.screenChanged, () => {
this.controller.onWindowScreenChanged(window);
});
this.connect(client.activitiesChanged, () =>
this.controller.onWindowChanged(