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(); }