[Bootstrap] Rewrite forcing Electron props
This commit is contained in:
parent
4f7ce2a3d5
commit
64567cdad8
1 changed files with 15 additions and 7 deletions
22
src/bootstrap.js
vendored
22
src/bootstrap.js
vendored
|
@ -2,14 +2,23 @@ const { app, BrowserWindow } = require('electron');
|
|||
const { readFileSync } = require('fs');
|
||||
const { join } = require('path');
|
||||
|
||||
if (process.platform === 'linux') { // Discord is a well-made app which properly implements WebRTC
|
||||
if (process.env.PULSE_LATENCY_MSEC === undefined) {
|
||||
process.env.PULSE_LATENCY_MSEC = 30;
|
||||
}
|
||||
}
|
||||
const Constants = require('./Constants');
|
||||
|
||||
log('Bootstrap', 'Forcing Electron props');
|
||||
app.name = 'discord'; // Force name as sometimes breaks data path even with "discord" name (also fixes kernel?)
|
||||
|
||||
switch (process.platform) { // Discord forces these
|
||||
case 'linux':
|
||||
process.env.PULSE_LATENCY_MSEC = process.env.PULSE_LATENCY_MSEC ?? 30;
|
||||
|
||||
break;
|
||||
case 'win32':
|
||||
app.setAppUserModelId(Constants.APP_ID);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
app.name = 'discord'; // Force name as sometimes breaks
|
||||
app.allowRendererProcessReuse = false;
|
||||
|
||||
const requireNative = require('./utils/requireNative');
|
||||
|
||||
|
@ -31,7 +40,6 @@ const appSettings = require('./appSettings');
|
|||
const GPUSettings = require('./GPUSettings');
|
||||
const crashReporterSetup = require('./crashReporterSetup');
|
||||
const splashScreen = require('./splash');
|
||||
const Constants = require('./Constants');
|
||||
const autoStart = require('./autoStart');
|
||||
|
||||
const updater = require('./updater/updater');
|
||||
|
|
Loading…
Reference in a new issue