From 11a3011cbd60f59b9f08442883f8ca577b3de547 Mon Sep 17 00:00:00 2001 From: James Salter Date: Mon, 23 May 2022 11:50:10 +0100 Subject: [PATCH] Option to disable hardware acceleration on Element Desktop (#22295) Override ElectronPlatform to support disableHardwareAcceleration --- src/vector/platform/ElectronPlatform.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index 92ef511eb2..d41d239b5c 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -414,6 +414,18 @@ export default class ElectronPlatform extends VectorBasePlatform { return this.ipcCall('setMinimizeToTrayEnabled', enabled); } + public supportsTogglingHardwareAcceleration(): boolean { + return true; + } + + public async getHardwareAccelerationEnabled(): Promise { + return this.ipcCall('getHardwareAccelerationEnabled'); + } + + public async setHardwareAccelerationEnabled(enabled: boolean): Promise { + return this.ipcCall('setHardwareAccelerationEnabled', enabled); + } + async canSelfUpdate(): Promise { const feedUrl = await this.ipcCall('getUpdateFeedUrl'); return Boolean(feedUrl);