diff --git a/browser/src/slideshow/SlideShowPresenter.ts b/browser/src/slideshow/SlideShowPresenter.ts index d7b51b14e2d84..0cb888123d093 100644 --- a/browser/src/slideshow/SlideShowPresenter.ts +++ b/browser/src/slideshow/SlideShowPresenter.ts @@ -422,7 +422,7 @@ class SlideShowPresenter { else return this._slideShowWindowProxy.document; } - _doInWindowPresentation() { + async _doInWindowPresentation() { const popupTitle = _('Windowed Presentation: ') + this._map['wopi'].BaseFileName; const htmlContent = this._generateSlideWindowHtml(popupTitle); @@ -437,7 +437,20 @@ class SlideShowPresenter { this._getProxyDocumentNode().write(''); this._getProxyDocumentNode().close(); } else { - this._slideShowWindowProxy = window.open('', '_blank', 'popup'); + let options = 'popup'; + // if the device has more than one screen. + if ((window.screen as any).isExtended) { + const details = await (window as any).getScreenDetails(); + const secondary = details.screens.find(function (s: any) { + return s !== s.primaryScreen; + }); + options += + 'left=${secondary.availLeft},' + + 'top=${secondary.availTop},' + + 'width=${secondary.availWidth},' + + 'height=${secondary.availHeight}'; + } + this._slideShowWindowProxy = window.open('', '_blank', options); } if (!this._slideShowWindowProxy) {