Skip to content

Commit

Permalink
fix: disable hardware acceleration for all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Enubia committed Mar 23, 2024
1 parent 1137061 commit dfca5e1
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions electron/main/background.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { release } from 'node:os';
import { join } from 'node:path';

import { BrowserWindow, app, crashReporter, globalShortcut, ipcMain } from 'electron';
import { BrowserWindow, app, globalShortcut, ipcMain } from 'electron';
import log from 'electron-log';

import { IpcEvent } from '@shared/constants';
Expand All @@ -13,6 +12,10 @@ import TrayIcon from './trayIcon';
import Overlay from './window/overlay';
import ManualUpdater from './manualUpdater';

if (!app.requestSingleInstanceLock()) {
app.quit();
}

log.transports.file.level = 'info';

const date = new Date();
Expand All @@ -22,26 +25,7 @@ log.transports.file.fileName = `app-${logFileDate}.log`;

log.info('App starting');

crashReporter.start({ submitURL: '', uploadToServer: false });

log.info('Crash reporter started');

if ((process.platform === 'win32' && release().startsWith('6.1')) || process.platform === 'linux') {
log.info('called disableHardwareAcceleration');
// disabled due to issues with transparency when there are multiple gpu's on windows
app.disableHardwareAcceleration();
}

if (process.platform === 'win32') {
log.info('called setAppUserModelId');
app.setAppUserModelId(app.getName());
}

if (!app.requestSingleInstanceLock()) {
log.error('quit due to requestSingleInstanceLock');
app.quit();
process.exit(0);
}
app.disableHardwareAcceleration();

const store = createStore();

Expand Down

0 comments on commit dfca5e1

Please sign in to comment.