From 5c552f8e2e1c5ea80ff012ce1d856f7b4fc76b80 Mon Sep 17 00:00:00 2001 From: salman Date: Wed, 15 Apr 2026 16:25:42 +0200 Subject: [PATCH] Adjust Flatpak runtime launch settings --- forge.config.js | 1 + main.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/forge.config.js b/forge.config.js index 086e429..3e640be 100644 --- a/forge.config.js +++ b/forge.config.js @@ -53,6 +53,7 @@ module.exports = { categories: ['Science'], finishArgs: [ '--share=ipc', + '--share=network', '--socket=x11', '--socket=wayland', '--device=dri', diff --git a/main.js b/main.js index 1f8229c..cbfe6ff 100644 --- a/main.js +++ b/main.js @@ -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.