Skip to content

Commit

Permalink
start electron with --disable-gpu flag (MagicMirrorOrg#3290)
Browse files Browse the repository at this point in the history
can be overriden with env var ELECTRON_ENABLE_GPU=1.

see MagicMirrorOrg#3226 

Tests will fail as long as
MagicMirrorOrg#3289 is not merged.
  • Loading branch information
khassel authored Dec 13, 2023
1 parent d5406f4 commit 319a921
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ _This release is scheduled to be released on 2024-01-01._
- Review ESLint config (#3269)
- Updated dependencies
- Clock module: optionally display current moon phase in addition to rise/set times
- electron is now per default started without gpu, if needed it must be enabled with new env var `ELECTRON_ENABLE_GPU=1` on startup (#3226)

### Fixed

Expand Down
5 changes: 3 additions & 2 deletions js/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ const Log = require("./logger");
let config = process.env.config ? JSON.parse(process.env.config) : {};
// Module to control application life.
const app = electron.app;
// If ELECTRON_DISABLE_GPU is set electron is started with --disable-gpu flag.
// Per default electron is started with --disable-gpu flag, if you want the gpu enabled,
// you must set the env var ELECTRON_ENABLE_GPU=1 on startup.
// See https://www.electronjs.org/docs/latest/tutorial/offscreen-rendering for more info.
if (process.env.ELECTRON_DISABLE_GPU !== undefined) {
if (process.env.ELECTRON_ENABLE_GPU !== "1") {
app.disableHardwareAcceleration();
}

Expand Down

0 comments on commit 319a921

Please sign in to comment.