Skip to content

Commit

Permalink
辅助窗口置顶问题修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanxven committed Jul 31, 2024
1 parent b9c8374 commit 2ea6eb3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/modules/akari-core/auxiliary-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -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)
})

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2ea6eb3

Please sign in to comment.