moved some stuff
This commit is contained in:
parent
e6c5c043c3
commit
a30297cfb7
2 changed files with 38 additions and 34 deletions
32
index.js
32
index.js
|
@ -7,45 +7,17 @@ const { app } = require('electron'),
|
||||||
const ElectronSentry = require("@sentry/electron");
|
const ElectronSentry = require("@sentry/electron");
|
||||||
ElectronSentry.init({ dsn: "https://68c422bfaaf44dea880b86aad5a820d2@o954055.ingest.sentry.io/6112214" });
|
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");
|
// const {Init} = require("./src/main/cider-base");
|
||||||
// Init()
|
// Init()
|
||||||
CiderBase.Init()
|
CiderBase.Init().catch(() => {})
|
||||||
|
|
||||||
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 Event Handlers
|
* App Event Handlers
|
||||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
||||||
|
|
||||||
app.commandLine.appendSwitch('js-flags', '--max-old-space-size=1024')
|
|
||||||
|
|
||||||
app.on('ready', () => {
|
app.on('ready', () => {
|
||||||
if (app.isQuiting) { app.quit(); return; }
|
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.')
|
console.log('[Cider] Application is Ready. Creating Window.')
|
||||||
if (!app.isPackaged) {
|
if (!app.isPackaged) {
|
||||||
console.info('[Cider] Running in development mode.')
|
console.info('[Cider] Running in development mode.')
|
||||||
|
|
|
@ -3,6 +3,7 @@ const win = require('./base/win')
|
||||||
|
|
||||||
// Analytics for debugging.
|
// Analytics for debugging.
|
||||||
const ElectronSentry = require("@sentry/electron");
|
const ElectronSentry = require("@sentry/electron");
|
||||||
|
const {app} = require("electron");
|
||||||
ElectronSentry.init({dsn: "https://68c422bfaaf44dea880b86aad5a820d2@o954055.ingest.sentry.io/6112214"});
|
ElectronSentry.init({dsn: "https://68c422bfaaf44dea880b86aad5a820d2@o954055.ingest.sentry.io/6112214"});
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -19,12 +20,43 @@ module.exports = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the main application (run before on-ready)
|
* Initializes the main application (run before on-ready)
|
||||||
*/
|
*/
|
||||||
Init() {
|
async Init() {
|
||||||
// Initialize the config.
|
// Initialize the config.
|
||||||
const {init} = require("./base/store");
|
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')
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue