diff options
author | 2018-12-05 14:33:47 +0100 | |
---|---|---|
committer | 2018-12-05 14:33:47 +0100 | |
commit | 08fa75acc11d023a37f72f6f0a86d304ef6fdf18 (patch) | |
tree | f57514cbcb97348ea3a2e4af589338eaa82ca496 /src/electron | |
parent | fix(Windows): Fix quit app, really! (diff) | |
download | ferdium-app-08fa75acc11d023a37f72f6f0a86d304ef6fdf18.tar.gz ferdium-app-08fa75acc11d023a37f72f6f0a86d304ef6fdf18.tar.zst ferdium-app-08fa75acc11d023a37f72f6f0a86d304ef6fdf18.zip |
Merge 'fix/window-bounds' into 'develop'
Diffstat (limited to 'src/electron')
-rw-r--r-- | src/electron/windowUtils.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/electron/windowUtils.js b/src/electron/windowUtils.js new file mode 100644 index 000000000..23b946ac4 --- /dev/null +++ b/src/electron/windowUtils.js | |||
@@ -0,0 +1,11 @@ | |||
1 | /* eslint import/prefer-default-export: 0 */ | ||
2 | |||
3 | import { screen } from 'electron'; | ||
4 | |||
5 | export function isPositionValid(position) { | ||
6 | const displays = screen.getAllDisplays(); | ||
7 | const { x, y } = position; | ||
8 | return displays.some(({ | ||
9 | workArea, | ||
10 | }) => x >= workArea.x && x <= workArea.x + workArea.width && y >= workArea.y && y <= workArea.y + workArea.height); | ||
11 | } | ||