4

I am building an app using electron and react. In that i need to conditionally enable and disable hardware acceleration of app. I can disable it as below. But I did not find any thing in electron documentation to enable it back. How can I do that?

import { app, BrowserWindow } from 'electron';
....
....
app.disableHardwareAcceleration()
srinivast6
  • 309
  • 3
  • 8
  • 3
    This method can only be called before app is ready. once it started in this mode you need to restart again. – Excalibur Jul 01 '20 at 14:51

2 Answers2

0

You can enable it again passing false as an argument in this function:

app.disableHardwareAcceleration(false);

-1

HW acceleration is enabled by default. If you want it to be like that it must be for all the application.

Edit 2022: By default is enabled but not activated. If the GPUFeatureStatus object shows it is deactivated you should append some flags to the execution of your electron binary (or app package)