mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
14 lines
367 B
JavaScript
14 lines
367 B
JavaScript
const electron = require('electron');
|
|
|
|
function positionIsValid(position) {
|
|
const displays = electron.screen.getAllDisplays();
|
|
const [x, y] = position;
|
|
|
|
return displays.some(({workArea}) => {
|
|
return x >= workArea.x && x <= workArea.x + workArea.width && y >= workArea.y && y <= workArea.y + workArea.height;
|
|
});
|
|
}
|
|
|
|
module.exports = {
|
|
positionIsValid
|
|
};
|