Move window via setBounds is laggy on macOS

Hey there!

I’ve 2 windows. A main one and a “sticky” one (its position is relative to the main one). When I move the main one I want the other to move as well.

It works well on Windows and Linux. On macos, it “works” but the second window doesn’t move smoothly, it hops.

Here’s how i proceed :

this.mainWindow.on("move", () => {
	if (this.mainWindow.isMaximized()) return;

setDockPosition = (init = false) => {
	if (!this.dockWindow || (!this.dockWindow.isVisible() && !init) || (!init && !global["settings"].attachedDock))
	let x = this.mainWindow.getPosition()[0] - this.windowsConfig.dockWindow.width - 24;
	let y = this.mainWindow.getPosition()[1] + this.mainWindow.getSize()[1] / 2 - 207;
	(this.dockWindow as BrowserWindow).setBounds({
		x: Math.floor(x),
		y: Math.floor(y),
		width: this.windowsConfig.dockWindow.width,
		height: this.windowsConfig.dockWindow.height

What can I do to have a smooth sticky window like on Windows and Linux ?

Here is a simple repo to reproduce that behaviour :

Thank you!