outlookemailmicrosoft-teamsdiscordmessengercustom-servicesmacoslinuxwindowsinboxwhatsappicloudtweetdeckhipchattelegramhangoutsslackgmailskypefacebook-workplace
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
485 B
19 lines
485 B
8 years ago
|
const { screen } = require('electron');
|
||
|
|
||
|
const positionOnScreen = (position) => {
|
||
|
let inBounds = false;
|
||
|
if (position) {
|
||
|
screen.getAllDisplays().forEach((display) => {
|
||
|
if (position[0] >= display.workArea.x &&
|
||
|
position[0] <= display.workArea.x + display.workArea.width &&
|
||
|
position[1] >= display.workArea.y &&
|
||
|
position[1] <= display.workArea.y + display.workArea.height) {
|
||
|
inBounds = true;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
return inBounds;
|
||
|
};
|
||
|
|
||
|
module.exports = {positionOnScreen};
|