From 22192a40372db76a47a58ef728e9a00cb87a2d72 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Fri, 2 Aug 2024 09:52:06 -0700 Subject: [PATCH] Reduce number of cases where playback is disabled --- app/main.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/main.ts b/app/main.ts index 7ca8bba577..4866c753f1 100644 --- a/app/main.ts +++ b/app/main.ts @@ -843,12 +843,6 @@ async function createWindow() { // App dock icon bounce bounce.init(mainWindow); - mainWindow.on('hide', () => { - if (mainWindow && !windowState.shouldQuit()) { - mainWindow.webContents.send('set-media-playback-disabled', true); - } - }); - // Emitted when the window is about to be closed. // Note: We do most of our shutdown logic here because all windows are closed by // Electron before the app quits. @@ -873,6 +867,9 @@ async function createWindow() { // Prevent the shutdown e.preventDefault(); + // Disable media playback + mainWindow.webContents.send('set-media-playback-disabled', true); + // In certain cases such as during an active call, we ask the user to confirm close // which includes shutdown, clicking X on MacOS or closing to tray. let shouldClose = true;