implement global shortcuts with electron api

This commit is contained in:
Vendicated
2026-04-04 23:10:11 +02:00
parent c32e16e740
commit d179b621a7
12 changed files with 454 additions and 27 deletions
+5
View File
@@ -14,6 +14,7 @@ import { app, BrowserWindow, nativeTheme } from "electron";
import { DATA_DIR } from "./constants";
import { createFirstLaunchTour } from "./firstLaunch";
import { registerKeyBinds } from "./keyBinds";
import { createWindows, mainWin } from "./mainWindow";
import { registerMediaPermissionsHandler } from "./mediaPermissions";
import { registerScreenShareHandler } from "./screenShare";
@@ -59,6 +60,9 @@ function init() {
app.commandLine.appendSwitch("disable-smooth-scrolling");
}
// Enable Wayland Portal for global shortcuts
enabledFeatures.add("GlobalShortcutsPortal");
// disable renderer backgrounding to prevent the app from unloading when in the background
// https://github.com/electron/electron/issues/2822
// https://github.com/GoogleChrome/chrome-launcher/blob/5a27dd574d47a75fec0fb50f7b774ebf8a9791ba/docs/chrome-flags-for-tools.md#task-throttling
@@ -115,6 +119,7 @@ function init() {
registerScreenShareHandler();
registerMediaPermissionsHandler();
registerKeyBinds();
bootstrap();