moved some stuff

This commit is contained in:
Core 2021-12-29 18:51:18 +00:00
parent e6c5c043c3
commit a30297cfb7
2 changed files with 38 additions and 34 deletions

View file

@ -7,44 +7,16 @@ const { app } = require('electron'),
const ElectronSentry = require("@sentry/electron");
ElectronSentry.init({ dsn: "https://68c422bfaaf44dea880b86aad5a820d2@o954055.ingest.sentry.io/6112214" });
// Enable WebGPU and list adapters (EXPERIMENTAL.)
// Note: THIS HAS TO BE BEFORE ANYTHING GETS INITIALIZED.
// const {Init} = require("./src/main/cider-base");
// Init()
CiderBase.Init()
switch (app.cfg.get("visual.hw_acceleration")) {
default:
case "default":
break;
case "webgpu":
console.info("WebGPU is enabled.");
app.commandLine.appendSwitch('enable-unsafe-webgpu')
break;
case "disabled":
console.info("Hardware acceleration is disabled.");
app.commandLine.appendSwitch('disable-gpu')
break;
}
if (process.platform === "linux") {
app.commandLine.appendSwitch('disable-features', 'MediaSessionService');
}
CiderBase.Init().catch(() => {})
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* App Event Handlers
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
app.commandLine.appendSwitch('js-flags', '--max-old-space-size=1024')
app.on('ready', () => {
if (app.isQuiting) { app.quit(); return; }
app.commandLine.appendSwitch('high-dpi-support', 1)
app.commandLine.appendSwitch('force-device-scale-factor', 1)
app.commandLine.appendSwitch('disable-pinch');
console.log('[Cider] Application is Ready. Creating Window.')
if (!app.isPackaged) {

View file

@ -3,6 +3,7 @@ const win = require('./base/win')
// Analytics for debugging.
const ElectronSentry = require("@sentry/electron");
const {app} = require("electron");
ElectronSentry.init({dsn: "https://68c422bfaaf44dea880b86aad5a820d2@o954055.ingest.sentry.io/6112214"});
module.exports = {
@ -21,10 +22,41 @@ module.exports = {
/**
* Initializes the main application (run before on-ready)
*/
Init() {
async Init() {
// Initialize the config.
const {init} = require("./base/store");
init()
await init()
//-------------------------------------------------------------------------------
// Append Commandline Arguments
//-------------------------------------------------------------------------------
// Hardware Acceleration
// Enable WebGPU and list adapters (EXPERIMENTAL.)
// Note: THIS HAS TO BE BEFORE ANYTHING GETS INITIALIZED.
switch (app.cfg.get("visual.hw_acceleration")) {
default:
case "default":
break;
case "webgpu":
console.info("WebGPU is enabled.");
app.commandLine.appendSwitch('enable-unsafe-webgpu')
break;
case "disabled":
console.info("Hardware acceleration is disabled.");
app.commandLine.appendSwitch('disable-gpu')
break;
}
if (process.platform === "linux") {
app.commandLine.appendSwitch('disable-features', 'MediaSessionService');
}
app.commandLine.appendSwitch('high-dpi-support', 'true');
app.commandLine.appendSwitch('force-device-scale-factor', '1');
app.commandLine.appendSwitch('disable-pinch');
app.commandLine.appendSwitch('js-flags', '--max-old-space-size=1024')
},
/**