fix(app): avoid a white flash when the pin board folds back into the wordmark (#57625)

This commit is contained in:
Luke Parker
2026-10-21 14:03:18 +10:00
committed by GitHub
Unverified
parent 34d69cbe81
commit 25d8e19a52
+6 -2
View File
@@ -102,8 +102,12 @@ export function createQuads(canvas: HTMLCanvasElement, restored: () => void) {
drawCanvas(surface.current.ctx, region, scale)
},
dispose() {
if (surface.current && "gl" in surface.current)
surface.current.gl.getExtension("WEBGL_lose_context")?.loseContext()
const current = surface.current
if (!current || !("gl" in current)) return
// Losing the context in the frame the canvas leaves the page lets the compositor redraw the last
// frame from a released buffer, which some GPUs show as a one-frame white flash. Drop it once the
// canvas is gone instead.
setTimeout(() => current.gl.getExtension("WEBGL_lose_context")?.loseContext(), 250)
},
}