Skip to content

Commit

Permalink
fix(troubleshooting): disable GPU to attempt to fix issue #184 (unexp…
Browse files Browse the repository at this point in the history
…lained "did-fail-load" error message)
  • Loading branch information
danielweck committed Feb 13, 2025
1 parent d1e8ca3 commit 18a84e6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,27 +85,27 @@ jobs:
- osarch: windows-intel
runson: windows-latest #windows-2022
packname: win
release_tag: latest-windows-intel
release_tag: latest-windows-intel-no-gpu
- osarch: windows-arm
runson: windows-latest #windows-2022
packname: win
release_tag: latest-windows-arm
release_tag: latest-windows-arm-no-gpu
- osarch: macos-intel
runson: macos-latest #macos-14-arm64
packname: 'mac:skip-notarize'
release_tag: latest-macos-intel
release_tag: latest-macos-intel-no-gpu
- osarch: macos-arm
runson: macos-latest #macos-14-arm64
packname: 'mac:skip-notarize'
release_tag: latest-macos-arm
release_tag: latest-macos-arm-no-gpu
- osarch: linux-intel
runson: ubuntu-22.04 #ubuntu-latest is ubuntu-24.04
packname: linux
release_tag: latest-linux-intel
release_tag: latest-linux-intel-no-gpu
- osarch: linux-arm
runson: ubuntu-22.04 #ubuntu-latest is ubuntu-24.04
packname: linux
release_tag: latest-linux-arm
release_tag: latest-linux-arm-no-gpu
env:
RELEASE_TAG: ${{ matrix.release_tag }}
steps:
Expand Down
25 changes: 19 additions & 6 deletions src/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,20 @@ let _storeSubscribe;
let _storeUnsubscribe;

// https://github.com/electron/electron/releases/tag/v14.0.0
// Removes the deprecation warning message in the console
// https://github.com/electron/electron/issues/18397
// app.allowRendererProcessReuse = true;
// https://www.electronjs.org/releases/stable#breaking-changes-1400

// https://github.com/electron/electron/issues/43415#issuecomment-2308352266
// https://github.com/electron/electron/issues/28164
// https://github.com/electron/electron/issues/20702
// --in-process-gpu ?
// app.commandLine.appendSwitch("in-process-gpu");
// ------------------------------------ see patchElectronJestRunner4
app.commandLine.appendSwitch("disable-gpu");
// app.disableHardwareAcceleration();
// app.commandLine.appendSwitch("disable-software-rasterizer");

const ACE_ELECTRON_HTTP_PROTOCOL = "acehttps";
const ACE_KB_ELECTRON_HTTP_PROTOCOL = "acekbhttps";
Expand Down Expand Up @@ -266,23 +279,23 @@ function createWindow() {

const menuBuilder = new MenuBuilder(_win, _store);
menuBuilder.buildMenu(_win);

const cb = () => {
menuBuilder.storeHasChanged();
};
_storeSubscribe(cb);

if (isDev) {

// require('electron-debug')(); // also see electron-react-devtools

_win.webContents.on("did-finish-load", () => {
const {
default: installExtension,
REACT_DEVELOPER_TOOLS,
REDUX_DEVTOOLS, // also see redux-devtools-extension
} = require("electron-devtools-installer");

[REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS].forEach((extension) => {
installExtension(extension)
.then((name) => console.log("Added Extension: ", name))
Expand Down Expand Up @@ -320,11 +333,11 @@ function createWindow() {
_win.loadURL(rendererUrl); // `file://${__dirname}/index.html`

_win.on('closed', function () {

_storeUnsubscribe(cb);

_win = null;

// closeKnowledgeBaseWindows();

// // about box
Expand Down

0 comments on commit 18a84e6

Please sign in to comment.