mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
Prevent display sleep while on a call
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
dialog,
|
||||
ipcMain as ipc,
|
||||
Menu,
|
||||
powerSaveBlocker,
|
||||
protocol as electronProtocol,
|
||||
screen,
|
||||
shell,
|
||||
@@ -54,6 +55,7 @@ import * as attachments from './attachments';
|
||||
import * as attachmentChannel from './attachment_channel';
|
||||
import * as bounce from '../ts/services/bounce';
|
||||
import * as updater from '../ts/updater/index';
|
||||
import { PreventDisplaySleepService } from './PreventDisplaySleepService';
|
||||
import { SystemTrayService } from './SystemTrayService';
|
||||
import { SystemTraySettingCache } from './SystemTraySettingCache';
|
||||
import {
|
||||
@@ -120,6 +122,10 @@ const enableCI = config.get<boolean>('enableCI');
|
||||
const sql = new MainSQL();
|
||||
const heicConverter = getHeicConverter();
|
||||
|
||||
const preventDisplaySleepService = new PreventDisplaySleepService(
|
||||
powerSaveBlocker
|
||||
);
|
||||
|
||||
let systemTrayService: SystemTrayService | undefined;
|
||||
const systemTraySettingCache = new SystemTraySettingCache(
|
||||
sql,
|
||||
@@ -761,6 +767,8 @@ ipc.on('title-bar-double-click', () => {
|
||||
});
|
||||
|
||||
ipc.on('set-is-call-active', (_event, isCallActive) => {
|
||||
preventDisplaySleepService.setEnabled(isCallActive);
|
||||
|
||||
if (!mainWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user