Skip to content

Build your personal knowledge base with Trilium Notes

fix(flatpak): global shortcuts not working (closes #7563)

Elian Dorana45b1474624d
diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts
index a94709107f..57e0492f2c 100644
--- a/apps/desktop/src/main.ts
+++ b/apps/desktop/src/main.ts
@@ -39,11 +39,16 @@ async function main() {
app.commandLine.appendSwitch("disable-smooth-scrolling");
}
- // 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") {
app.setName(PRODUCT_NAME);
+
+ // 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.
app.commandLine.appendSwitch("gtk-version", "3");
+
+ // Enable global shortcuts in Flatpak
+ // the app runs in a Wayland session.
+ app.commandLine.appendSwitch("enable-features", "GlobalShortcutsPortal");
}
// Quit when all windows are closed, except on macOS. There, it's common