From 9105593dc916d93585dcc042074e90e371e8b9a9 Mon Sep 17 00:00:00 2001 From: salman Date: Mon, 19 Oct 2026 14:57:12 +0200 Subject: [PATCH] Harden packaged Electron startup for remote/Xwayland sessions Disable GPU/accelerated features and set safe defaults for packaged builds to avoid crashes in Xwayland/remote environments (prevents GPU/VAAPI errors). File dialog behavior and the new shared folder memory remain unchanged. --- main.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main.js b/main.js index 9abb208..4ca9e32 100644 --- a/main.js +++ b/main.js @@ -179,6 +179,20 @@ if (process.platform === 'linux') { app.commandLine.appendSwitch('xdg-portal-required-version', '999'); } +// Add more robust flags for packaged builds in remote/Xwayland environments +if (app.isPackaged) { + try { + app.commandLine.appendSwitch('disable-gpu'); + app.commandLine.appendSwitch('disable-gpu-compositing'); + app.commandLine.appendSwitch('disable-accelerated-2d-canvas'); + app.commandLine.appendSwitch('disable-accelerated-video-decode'); + app.commandLine.appendSwitch('disable-dev-shm-usage'); + app.commandLine.appendSwitch('disable-features', 'VaapiVideoDecoder,VaapiVideoEncoder,VizDisplayCompositor'); + } catch (e) { + console.log('could not append packaged startup switches:', e); + } +} + function getDefaultDialogPath() { return currentWorkPath || process.cwd(); }