From c991ce3765fc429f6663843a1ba503ced2a803ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sat, 23 Jun 2018 12:11:02 +0200 Subject: [PATCH] centerWindowHorizontally: Animate and use whole pixels --- tiling.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tiling.js b/tiling.js index 2c99372..10e39a9 100644 --- a/tiling.js +++ b/tiling.js @@ -1453,11 +1453,11 @@ function centerWindowHorizontally(metaWindow) { const frame = metaWindow.get_frame_rect(); const space = spaces.spaceOfWindow(metaWindow); const monitor = space.monitor; - const targetX = (monitor.width/2 - frame.width/2) + const targetX = Math.round(monitor.width/2 - frame.width/2); const dx = (targetX + monitor.x) - frame.x; utils.warpPointerRelative(dx, 0); - move_to(space, metaWindow, { x: targetX, y: frame.y }); - space.emit('move-done'); + move_to(space, metaWindow, { x: targetX, y: frame.y, + onComplete: () => space.emit('move-done')}); Tweener.removeTweens(space.selection); space.selection.width = frame.width + prefs.window_gap; space.selection.x = targetX + monitor.x - Math.round(prefs.window_gap/2);