From 2ea6eb3a738439be0745150a1e6c8e33d2310773 Mon Sep 17 00:00:00 2001 From: Hanxven Date: Wed, 31 Jul 2024 19:56:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=85=E5=8A=A9=E7=AA=97=E5=8F=A3=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6=E9=97=AE=E9=A2=98=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/modules/akari-core/auxiliary-window.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/modules/akari-core/auxiliary-window.ts b/src/main/modules/akari-core/auxiliary-window.ts index 2af12bd7..4b28cd2b 100644 --- a/src/main/modules/akari-core/auxiliary-window.ts +++ b/src/main/modules/akari-core/auxiliary-window.ts @@ -292,7 +292,6 @@ export class AuxWindowModule extends MobxBasedBasicModule { icon, fullscreenable: false, skipTaskbar: false, - alwaysOnTop: this.state.settings.isPinned, webPreferences: { preload: join(__dirname, '../preload/index.js'), sandbox: false, @@ -311,6 +310,7 @@ export class AuxWindowModule extends MobxBasedBasicModule { this.state.setShow(AuxWindowModule.INITIAL_SHOW) this._w.setOpacity(this.state.settings.opacity) + this._w.setAlwaysOnTop(this.state.settings.isPinned, 'normal') this._w.webContents.on('did-finish-load', () => { this._w?.webContents.setZoomFactor(this.state.settings.zoomFactor) @@ -360,7 +360,7 @@ export class AuxWindowModule extends MobxBasedBasicModule { }) this._w.on('always-on-top-changed', (_, b) => { - this._sm.settings.set('auxiliary-window/is-pinned', b) + this._ss.set('is-pinned', b) this.state.settings.setPinned(b) }) @@ -408,8 +408,7 @@ export class AuxWindowModule extends MobxBasedBasicModule { 'is-pinned', () => this.state.settings.isPinned, async (s, ss) => { - this.state.settings.setPinned(s) - this._w?.setAlwaysOnTop(s) + this._w?.setAlwaysOnTop(s, 'normal') await ss.set('is-pinned', s) return true