From 7aaeffefcb4b97017091ccc3b9b378abec3ecde7 Mon Sep 17 00:00:00 2001 From: Jonathan Martins Date: Wed, 16 Sep 2026 09:31:23 -0300 Subject: [PATCH] Fix export hanging forever at "preparing" and black preview after long minimize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Export hang: ModernVideoExporter.export() awaits collectRuntimeDiagnostics() as its very first step, before any progress is reported. That function calls window.electronAPI.getExportHardwareInfo(), whose main-process handler awaits app.getGPUInfo("complete") with no timeout. That Electron API can hang indefinitely (never resolve or reject) when the GPU process is crashed, disabled, or blocklisted, which silently stalls the entire export pipeline at the "preparing" phase forever with no error ever surfaced. Race it against a 3s timeout in the main process, and add a defense-in-depth timeout around both diagnostics IPC calls on the renderer side. Black preview after minimizing: the editor's live preview renders through a PixiJS WebGL/WebGPU canvas (VideoPlayback.tsx). Windows can reclaim GPU resources from a window minimized/occluded for a long time, silently killing the WebGL context with no recovery — nothing listened for `webglcontextlost`/`contextrestored` or `visibilitychange` anywhere in the app, so the canvas stayed permanently black until a full app relaunch. Add a `webglcontextlost` listener that forces a full teardown/recreate of the Pixi renderer (via a `rendererGeneration` counter), plus a `visibilitychange` safety net that does the same after the window was hidden for over a minute, to also cover the WebGPU backend (which doesn't fire that event) and stalled hidden-