In prerelease, enable background throttling when not on a call
This commit is contained in:
parent
2f7226e200
commit
942ce16610
7 changed files with 59 additions and 2 deletions
28
main.js
28
main.js
|
@ -403,7 +403,10 @@ async function createWindow() {
|
|||
),
|
||||
nativeWindowOpen: true,
|
||||
spellcheck: await getSpellCheckSetting(),
|
||||
backgroundThrottling: false,
|
||||
// We are evaluating background throttling in prerelease versions. If we decide to
|
||||
// move forward, we can remove this line (as `backgroundThrottling` is true by
|
||||
// default).
|
||||
backgroundThrottling: !isProduction(app.getVersion()),
|
||||
enablePreferredSizeMode: true,
|
||||
},
|
||||
icon: windowIcon,
|
||||
|
@ -664,6 +667,29 @@ ipc.on('title-bar-double-click', () => {
|
|||
}
|
||||
});
|
||||
|
||||
ipc.on('set-is-call-active', (_event, isCallActive) => {
|
||||
if (!mainWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We are evaluating background throttling in prerelease versions. If we decide to move
|
||||
// forward, we can remove this check.
|
||||
if (isProduction(app.getVersion())) {
|
||||
return;
|
||||
}
|
||||
|
||||
let backgroundThrottling;
|
||||
if (isCallActive) {
|
||||
console.log('Background throttling disabled because a call is active');
|
||||
backgroundThrottling = false;
|
||||
} else {
|
||||
console.log('Background throttling enabled because no call is active');
|
||||
backgroundThrottling = true;
|
||||
}
|
||||
|
||||
mainWindow.webContents.setBackgroundThrottling(backgroundThrottling);
|
||||
});
|
||||
|
||||
ipc.on('convert-image', async (event, uuid, data) => {
|
||||
const { error, response } = await heicConverter(uuid, data);
|
||||
event.reply(`convert-image:${uuid}`, { error, response });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue