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.
This commit is contained in:
salman committed 2026-10-19 14:57:12 +02:00
1 parent af241b4237
commit 9105593dc9
1 file changed
+14
+14
View File
@@ -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();
}