From ddcec2babe1f88c82783ce61bf66ea4af02092bf Mon Sep 17 00:00:00 2001 From: James Salter Date: Fri, 20 May 2022 13:09:25 +0100 Subject: [PATCH 1/4] 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 92ef511eb2b..801a299fd79 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); } + supportsDisableHardwareAcceleration(): boolean { + return true; + } + + async getDisableHardwareAcceleration(): Promise { + return this.ipcCall('getDisableHardwareAcceleration'); + } + + async setDisableHardwareAcceleration(enabled: boolean): Promise { + return this.ipcCall('setDisableHardwareAcceleration', enabled); + } + async canSelfUpdate(): Promise { const feedUrl = await this.ipcCall('getUpdateFeedUrl'); return Boolean(feedUrl); From 9d9b5f504ccdb7b2e0b0c03480b55851f397bde3 Mon Sep 17 00:00:00 2001 From: James Salter Date: Fri, 20 May 2022 14:00:56 +0100 Subject: [PATCH 2/4] explicit public --- src/vector/platform/ElectronPlatform.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index 801a299fd79..30171d6dbc4 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -414,15 +414,15 @@ export default class ElectronPlatform extends VectorBasePlatform { return this.ipcCall('setMinimizeToTrayEnabled', enabled); } - supportsDisableHardwareAcceleration(): boolean { + public supportsDisableHardwareAcceleration(): boolean { return true; } - async getDisableHardwareAcceleration(): Promise { + public async getDisableHardwareAcceleration(): Promise { return this.ipcCall('getDisableHardwareAcceleration'); } - async setDisableHardwareAcceleration(enabled: boolean): Promise { + public async setDisableHardwareAcceleration(enabled: boolean): Promise { return this.ipcCall('setDisableHardwareAcceleration', enabled); } From 8fbf6053ea7111b19717620b6e32f715d854c87f Mon Sep 17 00:00:00 2001 From: James Salter Date: Fri, 20 May 2022 14:28:53 +0100 Subject: [PATCH 3/4] invert how we refer to enablement --- src/vector/platform/ElectronPlatform.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index 30171d6dbc4..b5bb2bc48f6 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -414,16 +414,16 @@ export default class ElectronPlatform extends VectorBasePlatform { return this.ipcCall('setMinimizeToTrayEnabled', enabled); } - public supportsDisableHardwareAcceleration(): boolean { + public supportsHardwareAcceleration(): boolean { return true; } - public async getDisableHardwareAcceleration(): Promise { - return this.ipcCall('getDisableHardwareAcceleration'); + public async getHardwareAccelerationEnabled(): Promise { + return this.ipcCall('getHardwareAccelerationEnabled'); } - public async setDisableHardwareAcceleration(enabled: boolean): Promise { - return this.ipcCall('setDisableHardwareAcceleration', enabled); + public async setHardwareAccelerationEnabled(enabled: boolean): Promise { + return this.ipcCall('setHardwareAccelerationEnabled', enabled); } async canSelfUpdate(): Promise { From 039d1366dac39860d53fb61fe077ec074bee787a Mon Sep 17 00:00:00 2001 From: James Salter Date: Fri, 20 May 2022 15:02:22 +0100 Subject: [PATCH 4/4] Clarify naming --- src/vector/platform/ElectronPlatform.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index b5bb2bc48f6..d41d239b5c0 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -414,7 +414,7 @@ export default class ElectronPlatform extends VectorBasePlatform { return this.ipcCall('setMinimizeToTrayEnabled', enabled); } - public supportsHardwareAcceleration(): boolean { + public supportsTogglingHardwareAcceleration(): boolean { return true; }