aboutsummaryrefslogtreecommitdiff
path: root/src/patcher.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/patcher.ts')
-rw-r--r--src/patcher.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/patcher.ts b/src/patcher.ts
index 9fe3dd2..e991377 100644
--- a/src/patcher.ts
+++ b/src/patcher.ts
@@ -20,6 +20,10 @@ class BrowserWindow extends electron.BrowserWindow {
}
}
Object.assign(BrowserWindow, electron.BrowserWindow);
+// esbuild may rename our BrowserWindow, which leads to it being excluded
+// from getFocusedWindow(), so this is necessary
+// https://github.com/discord/electron/blob/13-x-y/lib/browser/api/browser-window.ts#L60-L62
+Object.defineProperty(BrowserWindow, "name", { value: "BrowserWindow", configurable: true });
// Replace electrons exports with our custom BrowserWindow
const electronPath = require.resolve("electron");