Adjust Flatpak runtime launch settings

This commit is contained in:
2026-04-15 16:25:42 +02:00
parent 5a0c2d9970
commit 5c552f8e2e
2 changed files with 16 additions and 0 deletions
+1
View File
@@ -53,6 +53,7 @@ module.exports = {
categories: ['Science'],
finishArgs: [
'--share=ipc',
'--share=network',
'--socket=x11',
'--socket=wayland',
'--device=dri',
+15
View File
@@ -1,9 +1,24 @@
const fsNode = require('fs');
const { app, BrowserWindow, Menu, dialog, ipcMain, fs } = require('electron');
function isFlatpakRuntime() {
return process.platform === 'linux' && (
!!process.env.FLATPAK_ID ||
process.env.container === 'flatpak' ||
fsNode.existsSync('/.flatpak-info')
);
}
// Some Linux/remote desktop setups expose a broken GPU context to Electron.
// Fall back to software rendering instead of crashing on startup.
app.disableHardwareAcceleration();
if (isFlatpakRuntime()) {
// The packaged Flatpak currently runs without chrome-sandbox, so Chromium
// needs the explicit no-sandbox flag at startup.
app.commandLine.appendSwitch('no-sandbox');
}
if (process.platform === 'linux') {
// The XDG portal dialog backend ignores defaultPath on some systems and
// may cancel folder selection entirely in X11/SSH sessions.