From d4a7c863e80058f1a8565fe0b55f7c6799446cd4 Mon Sep 17 00:00:00 2001 From: webadderall <131426131+webadderall@users.noreply.github.com> Date: Sat, 18 Apr 2026 21:30:57 +1000 Subject: [PATCH 1/2] fix: Linux GPU fallback and HUD window show safety net - Add Linux GPU config: use EGL (better Wayland compat), disable VAAPI video decoder/encoder (many distros ship broken drivers causing 'vaInitialize failed' and preventing renderer from loading) - Add ready-to-show fallback for HUD window: if did-finish-load never fires (GPU failure), show the window after 500ms via ready-to-show Ref #261 --- electron/main.ts | 9 +++++++++ electron/windows.ts | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/electron/main.ts b/electron/main.ts index 4a572ac4..e47c1b82 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -68,6 +68,15 @@ function configureGpuAccelerationSwitches() { app.commandLine.appendSwitch("use-angle", "d3d11"); return; } + + // Linux: prefer EGL over GLX for better Wayland compatibility. + // Disable VAAPI — many distros ship broken drivers that cause + // "vaInitialize failed" and prevent the renderer from loading. + if (process.platform === "linux") { + app.commandLine.appendSwitch("use-gl", "egl"); + app.commandLine.appendSwitch("disable-features", "VaapiVideoDecoder,VaapiVideoEncoder"); + return; + } } async function logSmokeExportGpuDiagnostics() { diff --git a/electron/windows.ts b/electron/windows.ts index f8466915..7439f716 100644 --- a/electron/windows.ts +++ b/electron/windows.ts @@ -498,6 +498,17 @@ export function createHudOverlayWindow(): BrowserWindow { }, 100); }); + // Safety net: on Linux the renderer may fail to fire did-finish-load + // (e.g. GPU/VAAPI errors). Show the window after ready-to-show as fallback. + win.once("ready-to-show", () => { + setTimeout(() => { + if (!win.isDestroyed() && !win.isVisible()) { + win.show(); + win.moveTop(); + } + }, 500); + }); + hudOverlayWindow = win; // Reset the user's saved HUD position when displays change so the bar From 41249a9a19e59d0260bbb6666d4524bc34bfa0c9 Mon Sep 17 00:00:00 2001 From: webadderall <131426131+webadderall@users.noreply.github.com> Date: Sat, 18 Apr 2026 22:05:05 +1000 Subject: [PATCH 2/2] refactor: remove redundant Linux platform guard in GPU config --- electron/main.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/electron/main.ts b/electron/main.ts index e47c1b82..4adcc99c 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -69,14 +69,11 @@ function configureGpuAccelerationSwitches() { return; } - // Linux: prefer EGL over GLX for better Wayland compatibility. + // Linux (and other Unix): prefer EGL over GLX for better Wayland compatibility. // Disable VAAPI — many distros ship broken drivers that cause // "vaInitialize failed" and prevent the renderer from loading. - if (process.platform === "linux") { - app.commandLine.appendSwitch("use-gl", "egl"); - app.commandLine.appendSwitch("disable-features", "VaapiVideoDecoder,VaapiVideoEncoder"); - return; - } + app.commandLine.appendSwitch("use-gl", "egl"); + app.commandLine.appendSwitch("disable-features", "VaapiVideoDecoder,VaapiVideoEncoder"); } async function logSmokeExportGpuDiagnostics() {