Tiled: call World.do only if condition satisfied

This commit is contained in:
Peter Fajdiga
2023-09-17 08:00:32 +02:00
parent 14c006b5b1
commit b8b8900754

View File

@@ -98,19 +98,19 @@ namespace ClientState {
const newCenterY = newGeometry.y + newGeometry.height/2;
const dx = Math.round(newCenterX - oldCenterX);
const dy = Math.round(newCenterY - oldCenterY);
client.moveTransients(dx, dy);
if (dx !== 0 || dy !== 0) {
client.moveTransients(dx, dy);
}
world.do((clientManager, desktopManager) => {
if (kwinClient.resize) {
window.onUserResize(oldGeometry, !cursorChangedAfterResizeStart);
} else if (
!client.isManipulatingGeometry() &&
!Clients.isMaximizedGeometry(kwinClient) &&
!Clients.isFullScreenGeometry(kwinClient) // not using `kwinClient.fullScreen` because it may not be set yet at this point
) {
window.onFrameGeometryChanged();
}
});
if (kwinClient.resize) {
world.do(() => window.onUserResize(oldGeometry, !cursorChangedAfterResizeStart));
} else if (
!client.isManipulatingGeometry() &&
!Clients.isMaximizedGeometry(kwinClient) &&
!Clients.isFullScreenGeometry(kwinClient) // not using `kwinClient.fullScreen` because it may not be set yet at this point
) {
world.do(() => window.onFrameGeometryChanged());
}
});
manager.connect(kwinClient.fullScreenChanged, () => {