From 874b06ccdece817c3eca36fd541c2f9c909a79bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7?= <308487730@qq.com> Date: Tue, 7 Dec 2021 19:06:11 +0800 Subject: [PATCH] feat: disableHardwareAcceleration on windows 7 --- src/main/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/index.ts b/src/main/index.ts index 36cc59a..656b7c0 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1,6 +1,11 @@ +import os from 'os' import path from 'path' import { app, BrowserWindow } from 'electron' +// https://stackoverflow.com/questions/42524606/how-to-get-windows-version-using-node-js +const isWin7 = os.release().startsWith('6.1') +if (isWin7) app.disableHardwareAcceleration() + if (!app.requestSingleInstanceLock()) { app.quit() process.exit(0)