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.
This commit is contained in:
Vendicated
2026-08-30 18:06:28 +02:00
parent e35e0dc5f7
commit d92eecad03
+3 -8
View File
@@ -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(","));