glasstron update

This commit is contained in:
Jean Ouina 2020-09-05 20:33:58 +02:00
parent 435f405b38
commit 341e079c57
4 changed files with 15 additions and 14 deletions

View File

@ -377,11 +377,9 @@ function launchMainAppWindow(isVisible) {
mainWindowId = mainWindow.id; mainWindowId = mainWindow.id;
global.mainWindowId = mainWindowId; global.mainWindowId = mainWindowId;
if(settings.get("GLASSTRON", true)){ if(settings.get("GLASSTRON", true)){
glasstron.update(mainWindow, { mainWindow.blurType = settings.get("GLASSTRON_BLUR", "blurbehind")
windows: {blurType: 'blurbehind'}, mainWindow.setVibrancy("fullscreen-ui")
macos: {vibrancy: 'fullscreen-ui'}, mainWindow.setBlur(true)
linux: {requestBlur: true} // KWin
});
} }
mainWindow.webContents.session.webRequest.onHeadersReceived(function(details, callback) { mainWindow.webContents.session.webRequest.onHeadersReceived(function(details, callback) {

12
package-lock.json generated
View File

@ -591,10 +591,11 @@
} }
}, },
"glasstron": { "glasstron": {
"version": "0.0.3", "version": "0.0.4",
"resolved": "https://registry.npmjs.org/glasstron/-/glasstron-0.0.3.tgz", "resolved": "https://registry.npmjs.org/glasstron/-/glasstron-0.0.4.tgz",
"integrity": "sha512-yJ8+8gkGXXBlnI+4j6i8N+SaeZcswtrO82M863zQkCc5BQfC5fTXcwj9+v80f0jYUfZLFigsgaFuKoFmlVsOdw==", "integrity": "sha512-FgM0mkCRqbzyZq+eru6ulXKRi/wCKbglyEhGB2L2B3Aaq7nf9GkvV+X9fpwha8yxEv95/T7dllzvozQZ+fPPrg==",
"requires": { "requires": {
"node-addon-api": "^3.0.0",
"x11": "^2.3.0" "x11": "^2.3.0"
} }
}, },
@ -869,6 +870,11 @@
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true "dev": true
}, },
"node-addon-api": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.0.0.tgz",
"integrity": "sha512-sSHCgWfJ+Lui/u+0msF3oyCgvdkhxDbkCS6Q8uiJquzOimkJBvX6hl5aSSA7DR1XbMpdM8r7phjcF63sF4rkKg=="
},
"node-fetch": { "node-fetch": {
"version": "2.6.0", "version": "2.6.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",

View File

@ -24,7 +24,7 @@
"dependencies": { "dependencies": {
"auto-launch": "^5.0.5", "auto-launch": "^5.0.5",
"custom-electron-titlebar": "^3.2.2-hotfix62", "custom-electron-titlebar": "^3.2.2-hotfix62",
"glasstron": "0.0.3", "glasstron": "0.0.4",
"mkdirp": "^1.0.4", "mkdirp": "^1.0.4",
"node-fetch": "^2.6.0", "node-fetch": "^2.6.0",
"request": "^2.88.2", "request": "^2.88.2",

View File

@ -3,10 +3,7 @@ import appSettings from "./appSettings";
let settings = appSettings.getSettings(); let settings = appSettings.getSettings();
/** Glasstron */ /** Glasstron */
if (settings.get("GLASSTRON", true)) { if (settings.get("GLASSTRON", true))require("glasstron");
const glasstron = require("glasstron");
glasstron.init();
}
/** Modules */ /** Modules */
import * as electron from "electron"; import * as electron from "electron";
@ -37,6 +34,7 @@ electron.app.commandLine.appendSwitch(
"no-user-gesture-required" "no-user-gesture-required"
); );
electron.app.commandLine.appendSwitch("no-force-async-hooks-checks"); electron.app.commandLine.appendSwitch("no-force-async-hooks-checks");
electron.app.commandLine.appendSwitch("enable-transparent-visuals");
function setupHardwareAcceleration() { function setupHardwareAcceleration() {
const settings = appSettings.getSettings(); const settings = appSettings.getSettings();
@ -96,7 +94,6 @@ function hasArgvFlag(flag) {
releaseChannel: ${buildInfo.releaseChannel} releaseChannel: ${buildInfo.releaseChannel}
commit: ${buildInfo.commit}`); commit: ${buildInfo.commit}`);
if (!electron.app.commandLine.hasSwitch("enable-transparent-visuals"))electron.app.commandLine.appendSwitch("enable-transparent-visuals");
electron.app.setAppUserModelId(Constants.APP_ID); electron.app.setAppUserModelId(Constants.APP_ID);