summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-08-24 16:08:34 +0300
committerAndrej Mihajlov <and@mullvad.net>2018-08-27 16:19:47 +0300
commite65cc35f2c045a24d0ee6c3e4166ecadba42c25e (patch)
treeaae43da4fc3c87b6fc7f6f2b1a5b981edc94edd0 /gui
parenta4e15840b135fc90106647772a733fed72fcd7b6 (diff)
downloadmullvadvpn-e65cc35f2c045a24d0ee6c3e4166ecadba42c25e.tar.xz
mullvadvpn-e65cc35f2c045a24d0ee6c3e4166ecadba42c25e.zip
Detect the current active screen based tray icon location
Diffstat (limited to 'gui')
-rw-r--r--gui/packages/desktop/src/main/window-controller.js7
1 files changed, 5 insertions, 2 deletions
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;