From d92eecad0363dd8feeaa014807b7327d35f650ad Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 30 Aug 2026 18:05:22 +0200 Subject: [PATCH] Remove speech dispatcher flag as it causes issues On some systems, the dispatcher thread can generate many coredumps if no backend is configured. Users should manually enable this if they want it This commit also removes an obsolete flag and refactors a bit of code to be compatible with older Electron versions. This will allow people to build it with older Electron versions that still support older OS versions. --- src/main/main.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/main.ts b/src/main/main.ts index ad2c78a..079bfc2 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -62,16 +62,11 @@ function init() { // work around chrome 66 disabling autoplay by default app.commandLine.appendSwitch("autoplay-policy", "no-user-gesture-required"); - // WinRetrieveSuggestionsOnlyOnDemand: Work around electron 13 bug w/ async spellchecking on Windows. - // HardwareMediaKeyHandling, MediaSessionService: Prevent Discord from registering as a media service. - disabledFeatures.add("WinRetrieveSuggestionsOnlyOnDemand"); + // Prevent Discord from registering as a media service. disabledFeatures.add("HardwareMediaKeyHandling"); disabledFeatures.add("MediaSessionService"); if (isLinux) { - // Support TTS on Linux using https://wiki.archlinux.org/title/Speech_dispatcher - app.commandLine.appendSwitch("enable-speech-dispatcher"); - // This is needed to fix washed out colours - https://github.com/electron/electron/issues/49566 // Supposed to be fixed already according to comments there, but it's just not lol, I can repro on Electron 43.0.0 // when moving the window from my main monitor (HDR - not sure if this is relevant lol) to second monitor (SDR) and back @@ -80,8 +75,8 @@ function init() { disabledFeatures.forEach(feat => enabledFeatures.delete(feat)); - const enabledFeaturesArray = enabledFeatures.values().filter(Boolean).toArray(); - const disabledFeaturesArray = disabledFeatures.values().filter(Boolean).toArray(); + const enabledFeaturesArray = [...enabledFeatures].filter(Boolean); + const disabledFeaturesArray = [...disabledFeatures].filter(Boolean); if (enabledFeaturesArray.length) { app.commandLine.appendSwitch("enable-features", enabledFeaturesArray.join(","));