diff --git a/CHANGELOG.md b/CHANGELOG.md index c5647e95c..880853c63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 3.1.0 + +- Added a separate advanced options settings panel with flags + - Added gpu-rasterization flag +- config setting `disableHardwareMediaKeys` moved to `flags.disableHardwareMediaKeys`, it will be migrated automatically + ## 3.0.0 - Updated to Electron 15 diff --git a/package.json b/package.json index 330b00560..86a4c5129 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tidal-hifi", - "version": "3.0.0", + "version": "3.1.0", "description": "Tidal on Electron with widevine(hifi) support", "main": "src/main.js", "scripts": { diff --git a/src/constants/flags.js b/src/constants/flags.js new file mode 100644 index 000000000..88813ae70 --- /dev/null +++ b/src/constants/flags.js @@ -0,0 +1,6 @@ +const flags = { + gpuRasterization: [{ flag: "enable-gpu-rasterization", value: undefined }], + disableHardwareMediaKeys: [{ flag: "disable-features", value: "HardwareMediaKeyHandling" }], +}; + +module.exports = flags; diff --git a/src/constants/settings.js b/src/constants/settings.js index 570b41f6e..7e268f4f3 100644 --- a/src/constants/settings.js +++ b/src/constants/settings.js @@ -21,6 +21,10 @@ const settings = { }, singleInstance: "singleInstance", disableHardwareMediaKeys: "disableHardwareMediaKeys", + flags: { + disableHardwareMediaKeys: "flags.disableHardwareMediaKeys", + gpuRasterization: "flags.gpuRasterization", + }, mpris: "mpris", enableCustomHotkeys: "enableCustomHotkeys", trayIcon: "trayIcon", diff --git a/src/main.js b/src/main.js index 3f80adc69..9c6407044 100644 --- a/src/main.js +++ b/src/main.js @@ -17,20 +17,30 @@ const mediaKeys = require("./constants/mediaKeys"); const mediaInfoModule = require("./scripts/mediaInfo"); const discordModule = require("./scripts/discord"); const globalEvents = require("./constants/globalEvents"); +const flagValues = require("./constants/flags"); let mainWindow; let icon = path.join(__dirname, "../assets/icon.png"); -/** - * Fix Display Compositor issue. - */ -app.commandLine.appendSwitch("disable-seccomp-filter-sandbox"); +setFlags(); + +function setFlags() { + const flags = store.get().flags; + if (flags) { + for (const [key, value] of Object.entries(flags)) { + if (value) { + flagValues[key].forEach((flag) => { + console.log(`enabling command line switch ${flag.flag} with value ${flag.value}`); + app.commandLine.appendSwitch(flag.flag, flag.value); + }); + } + } + } -/** - * Disable media keys when requested - */ -if (store.get(settings.disableHardwareMediaKeys)) { - app.commandLine.appendSwitch("disable-features", "HardwareMediaKeyHandling"); + /** + * Fix Display Compositor issue. + */ + app.commandLine.appendSwitch("disable-seccomp-filter-sandbox"); } /** diff --git a/src/pages/settings/preload.js b/src/pages/settings/preload.js index a424a635c..9d5d9d726 100644 --- a/src/pages/settings/preload.js +++ b/src/pages/settings/preload.js @@ -11,7 +11,8 @@ let trayIcon, menuBar, mutedArtists, singleInstance, - disableHardwareMediaKeys; + disableHardwareMediaKeys, + gpuRasterization; const { store, settings } = require("./../../scripts/settings"); const { ipcRenderer } = require("electron"); @@ -35,7 +36,8 @@ function refreshSettings() { muteArtists.checked = store.get(settings.muteArtists); mutedArtists.value = store.get(settings.mutedArtists).join("\n"); singleInstance.checked = store.get(settings.singleInstance); - disableHardwareMediaKeys.checked = store.get(settings.disableHardwareMediaKeys); + disableHardwareMediaKeys.checked = store.get(settings.flags.disableHardwareMediaKeys); + gpuRasterization.checked = store.get(settings.flags.gpuRasterization); } /** @@ -117,6 +119,7 @@ window.addEventListener("DOMContentLoaded", () => { mutedArtists = get("mutedArtists"); singleInstance = get("singleInstance"); disableHardwareMediaKeys = get("disableHardwareMediaKeys"); + gpuRasterization = get("gpuRasterization"); refreshSettings(); @@ -133,5 +136,6 @@ window.addEventListener("DOMContentLoaded", () => { addInputListener(muteArtists, settings.muteArtists); addTextAreaListener(mutedArtists, settings.mutedArtists); addInputListener(singleInstance, settings.singleInstance); - addInputListener(disableHardwareMediaKeys, settings.disableHardwareMediaKeys); + addInputListener(disableHardwareMediaKeys, settings.flags.gpuRasterization); + addInputListener(gpuRasterization, settings.flags.gpuRasterization); }); diff --git a/src/pages/settings/settings.html b/src/pages/settings/settings.html index 892812896..6bd275c10 100644 --- a/src/pages/settings/settings.html +++ b/src/pages/settings/settings.html @@ -37,6 +37,9 @@

Settings

+ + + @@ -122,17 +125,6 @@

Single instance

-
-

Disable hardware media keys

-

- Disable built-in media keys.
- Also prevents certain desktop environments from recognizing the chrome MPRIS client separetely from the custom MPRIS client. -

- -
@@ -196,16 +188,44 @@

Discord RPC

-
-
- tidal icon -

- Tidal-hifi is made by Rick van Lieshout.
- It uses Castlabs' versions of Electron for widevine support. -

+
+
+

Flags

+
+

Disable hardware media keys

+

+ Disable built-in media keys.
+ Also prevents certain desktop environments from recognizing the chrome MPRIS client separetely from the custom MPRIS client. +

+
-
+
+

Enable GPU rasterization

+

+ Move a part of the rendering to the GPU for increased performance. +

+ +
+
+
+ + +
+
+ tidal icon +

+ Tidal-hifi is made by Rick van Lieshout.
+ It uses Castlabs' versions of Electron for widevine support. +

+
+
Some settings require a restart of Tidal-hifi. To do so, click the button below: diff --git a/src/scripts/settings.js b/src/scripts/settings.js index 9c16dc2d8..04ef9d30e 100644 --- a/src/scripts/settings.js +++ b/src/scripts/settings.js @@ -24,6 +24,19 @@ const store = new Store({ enableCustomHotkeys: false, enableDiscord: false, windowBounds: { width: 800, height: 600 }, + flags: { + gpuRasterization: true, + disableHardwareMediaKeys: false, + }, + }, + migrations: { + "3.1.0": (migrationStore) => { + console.log("running migrations for 3.1.0"); + migrationStore.set( + settings.flags.disableHardwareMediaKeys, + migrationStore.get("disableHardwareMediaKeys") ?? false + ); + }, }, });