Skip to content

Build your personal knowledge base with Trilium Notes

fix(electron): crash on some Linux distributions

Elian Doran1a2bb1e407a6
diff --git a/apps/desktop/src/electron-main.ts b/apps/desktop/src/electron-main.ts
index 8a9ebae032..c8c28ac779 100644
--- a/apps/desktop/src/electron-main.ts
+++ b/apps/desktop/src/electron-main.ts
@@ -22,6 +22,12 @@ async function main() {
electron.app.commandLine.appendSwitch("enable-experimental-web-platform-features");
electron.app.commandLine.appendSwitch("lang", options.getOptionOrNull("formattingLocale") ?? "en");
+ // Electron 36 crashes with "Using GTK 2/3 and GTK 4 in the same process is not supported" on some distributions.
+ // See https://github.com/electron/electron/issues/46538 for more info.
+ if (process.platform === "linux") {
+ electron.app.commandLine.appendSwitch("gtk-version", "3");
+ }
+
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.