Adjust Flatpak runtime launch settings
This commit is contained in:
@@ -53,6 +53,7 @@ module.exports = {
|
||||
categories: ['Science'],
|
||||
finishArgs: [
|
||||
'--share=ipc',
|
||||
'--share=network',
|
||||
'--socket=x11',
|
||||
'--socket=wayland',
|
||||
'--device=dri',
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user