diff options
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | gui/packages/desktop/src/main/window-controller.js | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 97c76bd4af..5774c87369 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,9 @@ Line wrap the file at 100 chars. Th - The CLI command to list relays is now shorter, `mullvad relay list` instead of `mullvad relay list locations`. +### Fixed +- Fix incorrect window position when using external display. + ## [2018.2] - 2018-08-13 This release is identical to 2018.2-beta3 diff --git a/gui/packages/desktop/src/main/window-controller.js b/gui/packages/desktop/src/main/window-controller.js index 9e30529dda..dc6165c5f3 100644 --- a/gui/packages/desktop/src/main/window-controller.js +++ b/gui/packages/desktop/src/main/window-controller.js @@ -36,8 +36,11 @@ class AttachedToTrayWindowPositioning implements WindowPositioning { const windowBounds = window.getBounds(); const trayBounds = this._tray.getBounds(); - const primaryDisplay = screen.getPrimaryDisplay(); - const workArea = primaryDisplay.workArea; + const activeDisplay = screen.getDisplayNearestPoint({ + x: trayBounds.x, + y: trayBounds.y, + }); + const workArea = activeDisplay.workArea; const placement = this._getTrayPlacement(); const maxX = workArea.x + workArea.width - windowBounds.width; const maxY = workArea.y + workArea.height - windowBounds.height; |
