From b8b8900754219780164bb409cbf1cba77ddc49e0 Mon Sep 17 00:00:00 2001 From: Peter Fajdiga Date: Sun, 17 Sep 2023 08:00:32 +0200 Subject: [PATCH] Tiled: call `World.do` only if condition satisfied --- src/world/clientState/Tiled.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/world/clientState/Tiled.ts b/src/world/clientState/Tiled.ts index 2b23353..77a20b0 100644 --- a/src/world/clientState/Tiled.ts +++ b/src/world/clientState/Tiled.ts @@ -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, () => {