mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-31 21:49:57 +01:00
Merge pull request #365 from vector-im/disable-hardware-acceleration
Option to disable hardware acceleration
This commit is contained in:
commit
d1f488a094
@ -271,6 +271,7 @@ const store = new Store<{
|
|||||||
spellCheckerEnabled?: boolean;
|
spellCheckerEnabled?: boolean;
|
||||||
autoHideMenuBar?: boolean;
|
autoHideMenuBar?: boolean;
|
||||||
locale?: string | string[];
|
locale?: string | string[];
|
||||||
|
disableHardwareAcceleration?: boolean;
|
||||||
}>({ name: "electron-config" });
|
}>({ name: "electron-config" });
|
||||||
|
|
||||||
let eventIndex = null;
|
let eventIndex = null;
|
||||||
@ -424,6 +425,12 @@ ipcMain.on('ipcCall', async function(ev, payload) {
|
|||||||
global.mainWindow.autoHideMenuBar = Boolean(args[0]);
|
global.mainWindow.autoHideMenuBar = Boolean(args[0]);
|
||||||
global.mainWindow.setMenuBarVisibility(!args[0]);
|
global.mainWindow.setMenuBarVisibility(!args[0]);
|
||||||
break;
|
break;
|
||||||
|
case 'getDisableHardwareAcceleration':
|
||||||
|
ret = store.get('disableHardwareAcceleration') === true;
|
||||||
|
break;
|
||||||
|
case 'setDisableHardwareAcceleration':
|
||||||
|
store.set('disableHardwareAcceleration', args[0]);
|
||||||
|
break;
|
||||||
case 'getAppVersion':
|
case 'getAppVersion':
|
||||||
ret = app.getVersion();
|
ret = app.getVersion();
|
||||||
break;
|
break;
|
||||||
@ -843,6 +850,12 @@ app.enableSandbox();
|
|||||||
// We disable media controls here. We do this because calls use audio and video elements and they sometimes capture the media keys. See https://github.com/vector-im/element-web/issues/15704
|
// We disable media controls here. We do this because calls use audio and video elements and they sometimes capture the media keys. See https://github.com/vector-im/element-web/issues/15704
|
||||||
app.commandLine.appendSwitch('disable-features', 'HardwareMediaKeyHandling,MediaSessionService');
|
app.commandLine.appendSwitch('disable-features', 'HardwareMediaKeyHandling,MediaSessionService');
|
||||||
|
|
||||||
|
// Disable hardware acceleration if the setting has been set.
|
||||||
|
if (store.get('disableHardwareAcceleration') === true) {
|
||||||
|
console.log("Disabling hardware acceleration.");
|
||||||
|
app.disableHardwareAcceleration();
|
||||||
|
}
|
||||||
|
|
||||||
app.on('ready', async () => {
|
app.on('ready', async () => {
|
||||||
try {
|
try {
|
||||||
await setupGlobals();
|
await setupGlobals();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user