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);