diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-08-27 16:24:41 +0300 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-08-27 16:24:41 +0300 |
| commit | efbf7c5f060b1a91ef260b76af4a3bbdf21d0278 (patch) | |
| tree | aae43da4fc3c87b6fc7f6f2b1a5b981edc94edd0 | |
| parent | a4e15840b135fc90106647772a733fed72fcd7b6 (diff) | |
| parent | e65cc35f2c045a24d0ee6c3e4166ecadba42c25e (diff) | |
| download | mullvadvpn-efbf7c5f060b1a91ef260b76af4a3bbdf21d0278.tar.xz mullvadvpn-efbf7c5f060b1a91ef260b76af4a3bbdf21d0278.zip | |
Merge branch 'external-display-fix'
| -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; |
