Skip to content

Commit

Permalink
Update windows position before windows displaying
Browse files Browse the repository at this point in the history
Referring to the issue
max-mapper#232
  • Loading branch information
TheyrLtd committed Nov 24, 2020
1 parent 20a5a28 commit 4ecad60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Menubar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ export class Menubar extends EventEmitter {
if (!this._browserWindow) {
throw new Error('Window has been initialized just above. qed.');
}

// 'Windows' taskbar: sync windows position each time before showing
// https://github.com/maxogden/menubar/issues/232
if (process.platform === 'win32') {
// Fill in this._options.windowPosition when taskbar position is available
this._options.windowPosition = getWindowPosition(this.tray);
}

this.emit('show');

if (trayPos && trayPos.x !== 0) {
Expand Down

0 comments on commit 4ecad60

Please # to comment.