30ms debounce on aspect ratio enforcement to break SetWindowPos resize loop
This commit is contained in:
@@ -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
|
||||
// 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 }>(
|
||||
|
||||
Reference in New Issue
Block a user