diff --git a/src/lib/Overlay.svelte b/src/lib/Overlay.svelte index 689dcae..48b332c 100644 --- a/src/lib/Overlay.svelte +++ b/src/lib/Overlay.svelte @@ -36,13 +36,15 @@ win.onResized(async () => { if (enforcing) return await updateSize() - await syncRatio() if (lockedRatio === null) return - // Enforce ratio on every resize frame - no debounce - enforcing = true - try { await invoke("enforce_overlay_aspect") } catch {} - await updateSize() - enforcing = false + // Small debounce to break the SetWindowPos → onResized loop + if (resizeDebounce !== null) clearTimeout(resizeDebounce) + resizeDebounce = window.setTimeout(async () => { + enforcing = true + try { await invoke("enforce_overlay_aspect") } catch {} + await updateSize() + enforcing = false + }, 30) }).then(fn => cleanup.push(fn)) listen<{ phase: "idle"|"recording"|"paused"; fps: number }>(