Skip to content
Permalink
Browse files

Merge pull request #670 from geppy/fix-overlay-sizing

size overlay based on the display it's on
  • Loading branch information...
Manuel-777 committed Oct 28, 2019
2 parents b18e820 + 962e2f7 commit 5907b09675b720fb7ea11079ae0cfec3c2651674
Showing with 11 additions and 12 deletions.
  1. +11 −12 src/main.js
@@ -421,19 +421,18 @@ function updateOverlayVisibility() {
// display entire overlay window
clearTimeout(overlayHideTimeout);
overlayHideTimeout = undefined;
overlay.show();

let displayId = settings.overlay_display
? settings.overlay_display
: electron.screen.getPrimaryDisplay().id;
let display = electron.screen
.getAllDisplays()
.filter(d => d.id == displayId)[0];
if (display) {
overlay.setBounds(display.bounds);
} else {
overlay.setBounds(electron.screen.getPrimaryDisplay().bounds);
}
const {
bounds,
size: { width, height }
} =
electron.screen
.getAllDisplays()
.find(d => d.id === settings.overlay_display) ||
electron.screen.getPrimaryDisplay();
overlay.setBounds(bounds);
overlay.setSize(width, height);
overlay.show();
}
}

0 comments on commit 5907b09

Please sign in to comment.
You can’t perform that action at this time.