perf: performance improvements 1

This commit is contained in:
2026-07-14 01:34:33 +02:00
parent edc4d935d8
commit 59dfd2de85
27 changed files with 762 additions and 94 deletions
@@ -0,0 +1,16 @@
/**
* The display-media request handler is a session-level singleton. Registering
* it inside `createWindow()` without a guard re-installed a fresh handler
* (holding fresh closures) every time the window was recreated from the tray
* or a deep link. Registration happens at most once per app run.
*/
export function shouldRegisterDisplayMediaHandler(
platform: NodeJS.Platform,
alreadyConfigured: boolean
): boolean {
if (alreadyConfigured) {
return false;
}
return platform === 'linux' || platform === 'win32';
}