diff --git a/src/main/main.js b/src/main/main.js index 4c17e3a..42186bc 100644 --- a/src/main/main.js +++ b/src/main/main.js @@ -17,7 +17,12 @@ const store = new Store(); // Die Wahl wird unverschlüsselt in launch.json gespeichert, weil sie vor dem Start des Fensters gebraucht wird. const launchFile = path.join(app.getPath('userData'), 'launch.json'); function readLaunch() { try { return JSON.parse(fs.readFileSync(launchFile, 'utf8')); } catch { return {}; } } -if (process.platform === 'linux' && readLaunch().x11 !== false) app.commandLine.appendSwitch('ozone-platform', 'x11'); +// appendSwitch kommt für ozone-platform zu spät (Browser läuft schon unter Wayland, GPU-Prozess stürzt ab), +// daher einmalig mit dem Schalter auf der Kommandozeile neu starten. +if (process.platform === 'linux' && readLaunch().x11 !== false && !process.argv.some(a => a.startsWith('--ozone-platform'))) { + app.relaunch({ args: process.argv.slice(1).concat('--ozone-platform=x11') }); + app.exit(0); +} const pendingSecrets = new Map(); function send(channel, ...args) {