summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main/window-controller.ts
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-11-22 09:13:08 +0100
committerOskar Nyberg <oskar@mullvad.net>2021-11-22 13:13:21 +0100
commitbcf34bb9fd27136305daeec88ee113324d7a9f09 (patch)
treeced164384e00bd8d35a77dd45ca639ca4ab6fc5a /gui/src/main/window-controller.ts
parentbde1bb119f09d43f11cb720916a54e84f717a685 (diff)
downloadmullvadvpn-bcf34bb9fd27136305daeec88ee113324d7a9f09.tar.xz
mullvadvpn-bcf34bb9fd27136305daeec88ee113324d7a9f09.zip
Move platform version checks to it's own file
Diffstat (limited to 'gui/src/main/window-controller.ts')
-rw-r--r--gui/src/main/window-controller.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/gui/src/main/window-controller.ts b/gui/src/main/window-controller.ts
index dff90de639..c4d6b47232 100644
--- a/gui/src/main/window-controller.ts
+++ b/gui/src/main/window-controller.ts
@@ -1,8 +1,8 @@
import { BrowserWindow, Display, screen, Tray, WebContents } from 'electron';
-import os from 'os';
import { IWindowShapeParameters } from '../shared/ipc-types';
import { Scheduler } from '../shared/scheduler';
import { IpcMainEventChannel } from './ipc-event-channel';
+import { isWindows11OrNewer } from './platform-version';
interface IPosition {
x: number;
@@ -14,10 +14,8 @@ interface IWindowPositioning {
getWindowShapeParameters(window: BrowserWindow): IWindowShapeParameters;
}
-// Tray applications are positioned aproximately 10px from the tray in Windows 11. Windows 11 has
-// the internal version 10.0.22000+.
-const MARGIN =
- process.platform === 'win32' && parseInt(os.release().split('.').at(-1)!) >= 22000 ? 10 : 0;
+// Tray applications are positioned aproximately 10px from the tray in Windows 11.
+const MARGIN = isWindows11OrNewer() ? 10 : 0;
class StandaloneWindowPositioning implements IWindowPositioning {
public getPosition(window: BrowserWindow): IPosition {