Skip to content

Commit

Permalink
Merge pull request #13 from sosolimited/freeze-fixes
Browse files Browse the repository at this point in the history
fix a few issues with app backgrounding / suspension
  • Loading branch information
westhom committed Oct 26, 2022
2 parents 151e832 + 65bda28 commit 3b86b62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mit-illuminations",
"version": "v1.2.9",
"version": "1.2.10",
"private": true,
"description": "Illuminations by MIT - Turn P5 Code into Light Shows",
"author": "Sosolimited in collaboration with MIT",
Expand Down
12 changes: 10 additions & 2 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import unhandled from "electron-unhandled";

unhandled();

import {app, BrowserWindow, Menu, protocol, dialog, ipcMain, shell} from 'electron'
import {app, BrowserWindow, Menu, protocol, dialog, ipcMain, shell, powerSaveBlocker} from 'electron'
import {createProtocol} from 'vue-cli-plugin-electron-builder/lib'
import {copyAssets, getAssetPath} from './assets'
import electronStore from "electron-store";
import pkgjson from '../package.json';

const isDevelopment = process.env.NODE_ENV !== 'production'
const path = require('path');
Expand Down Expand Up @@ -102,6 +103,10 @@ function createWindow() {
const { shell } = require('electron')
await shell.openExternal('https://github.com/sosolimited/MIT-Illuminations/issues/new')
}
},
{
label: `version ${pkgjson.version}`,
enabled: false
}
]
}
Expand All @@ -127,7 +132,8 @@ function createWindow() {
contextIsolation: false,
webSecurity: false,
preload: path.join(__dirname, 'preload.js'),
additionalArguments: [userDataPath]
additionalArguments: [userDataPath],
backgroundThrottling: false
}
});

Expand Down Expand Up @@ -212,6 +218,8 @@ app.on('ready', async () => {
});

createWindow();

powerSaveBlocker.start('prevent-app-suspension');
})

// Exit cleanly on request from parent process in development mode.
Expand Down

0 comments on commit 3b86b62

Please sign in to comment.