20 fixes: mutex poisoning recovery, clickthrough shutdown, audio cleanup, config corruption, GIF aspect ratio, ffmpeg crash detection, cancel export, discard confirm, thumbnail cache, keyboard nav, right-click tracking, multi-monitor overlay, click injection fix, update script robustness, effect cleanup, concat guard, dead code removal

This commit is contained in:
2026-05-27 19:14:33 +03:00
parent f0775b8ff0
commit e4141f8be8
10 changed files with 310 additions and 140 deletions
+24 -29
View File
@@ -22,39 +22,34 @@
height = Math.round(sz.height / sf)
}
updateSize()
const rp = win.onResized(updateSize)
let cleanup: (() => void)[] = []
let rp2: Promise<() => void> | null = null
void (async () => {
rp2 = listen<{ phase: "idle"|"recording"|"paused"; fps: number }>(
"recording-state", (e) => {
fps = e.payload.fps
if (e.payload.phase === "recording") {
if (phase !== "recording") elapsed = 0
startTimer()
} else {
stopTimer()
}
if (e.payload.phase === "idle") { elapsed = 0; phase = "idle" }
phase = e.payload.phase
win.onResized(updateSize).then(fn => cleanup.push(fn))
listen<{ phase: "idle"|"recording"|"paused"; fps: number }>(
"recording-state", (e) => {
fps = e.payload.fps
if (e.payload.phase === "recording") {
if (phase !== "recording") elapsed = 0
startTimer()
} else {
stopTimer()
}
)
})()
if (e.payload.phase === "idle") { elapsed = 0; phase = "idle" }
phase = e.payload.phase
}
).then(fn => cleanup.push(fn))
let rp3: Promise<() => void> | null = null
void (async () => {
rp3 = listen<Rect>("picker-pick", async (e: { payload: Rect }) => {
try { await invoke("set_overlay_to_window", e.payload) } catch {}
try { await invoke("close_window_picker") } catch {}
})
})()
void (async () => {
await listen("picker-cancel", async () => {
try { await invoke("close_window_picker") } catch {}
})
})()
listen<Rect>("picker-pick", async (e: { payload: Rect }) => {
try { await invoke("set_overlay_to_window", e.payload) } catch {}
try { await invoke("close_window_picker") } catch {}
}).then(fn => cleanup.push(fn))
return () => { stopTimer(); void rp.then(fn => fn()); void rp2?.then(fn => fn()); void rp3?.then(fn => fn()) }
listen("picker-cancel", async () => {
try { await invoke("close_window_picker") } catch {}
}).then(fn => cleanup.push(fn))
return () => { stopTimer(); cleanup.forEach(fn => fn()) }
})
function startTimer() {