mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
10 lines
346 B
TypeScript
10 lines
346 B
TypeScript
import electron from 'electron';
|
|
|
|
export function positionIsValid(position: [number, number]) {
|
|
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;
|
|
});
|
|
}
|