From b94379f5bdbba55302de5975963c5259102d269d Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 20 Sep 2024 20:16:06 +0200 Subject: [PATCH] workaround electron/electron#43367 --- src/main/mainWindow.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/mainWindow.ts b/src/main/mainWindow.ts index d860b37..1292449 100644 --- a/src/main/mainWindow.ts +++ b/src/main/mainWindow.ts @@ -499,5 +499,17 @@ export async function createWindows() { }); }); + // evil hack to fix electron 32 regression that makes devtools always light theme + // https://github.com/electron/electron/issues/43367 + // TODO: remove once fixed + mainWin.webContents.on("devtools-opened", () => { + if (!nativeTheme.shouldUseDarkColors) return; + + nativeTheme.themeSource = "light"; + setTimeout(() => { + nativeTheme.themeSource = "dark"; + }, 100); + }); + initArRPC(); }