From f5165d517c52a60a28c1db66a84875e880ea8af3 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sun, 17 Sep 2023 13:56:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9F=B3=E9=A2=91=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E8=AE=BE=E5=A4=87=E8=AE=BE=E7=BD=AE=E5=9C=A8=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E8=BD=AF=E4=BB=B6=E5=90=8E=E8=A2=AB=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88#1568=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 4 ++++ src/main/modules/winMain/main.ts | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 48a2be0f..11153ee3 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -5,6 +5,10 @@ - 新增Scheme URL对播放器的控制操作,新增的操作包含 播放、暂停、下一首、上一首等,详情看Scheme URL文档 +### 修复 + +- 修复音频输出设备设置在重启软件后被重置的问题(#1568) + ### 其他 - 更新 electron 到 v22.3.24 diff --git a/src/main/modules/winMain/main.ts b/src/main/modules/winMain/main.ts index b9a95580..588d1663 100644 --- a/src/main/modules/winMain/main.ts +++ b/src/main/modules/winMain/main.ts @@ -1,4 +1,4 @@ -import { BrowserWindow, dialog } from 'electron' +import { BrowserWindow, dialog, session } from 'electron' import path from 'node:path' import { createTaskBarButtons, getWindowSizeInfo } from './utils' import { isLinux, isWin } from '@common/utils' @@ -65,6 +65,7 @@ export const createWindow = () => { const windowSizeInfo = getWindowSizeInfo(global.lx.appSetting['common.windowSizeId']) const { shouldUseDarkColors, theme } = global.lx.theme + const ses = session.fromPartition('persist:win-main') /** * Initial window options @@ -82,6 +83,7 @@ export const createWindow = () => { fullscreenable: true, show: false, webPreferences: { + session: ses, nodeIntegrationInWorker: true, contextIsolation: false, webSecurity: false,