Skip to content

Commit

Permalink
browser: slideshow: open presenter in secondary screen
Browse files Browse the repository at this point in the history
Change-Id: Ifa0410075ceb25b01797f6219356adc184a74b31
Signed-off-by: Henry Castro <[email protected]>
  • Loading branch information
hcvcastro committed Nov 11, 2024
1 parent 9c47980 commit e756a89
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions browser/src/slideshow/SlideShowPresenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -437,7 +437,20 @@ class SlideShowPresenter {
this._getProxyDocumentNode().write('<html><body></body></html>');
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) {

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable secondary.
return s !== s.primaryScreen;
});
options +=
'left=${secondary.availLeft},' +

Check warning

Code scanning / CodeQL

Template syntax in string literal Warning

This string is not a template literal, but appears to reference the variable
secondary
.
'top=${secondary.availTop},' +

Check warning

Code scanning / CodeQL

Template syntax in string literal Warning

This string is not a template literal, but appears to reference the variable
secondary
.
'width=${secondary.availWidth},' +

Check warning

Code scanning / CodeQL

Template syntax in string literal Warning

This string is not a template literal, but appears to reference the variable
secondary
.
'height=${secondary.availHeight}';

Check warning

Code scanning / CodeQL

Template syntax in string literal Warning

This string is not a template literal, but appears to reference the variable
secondary
.
}
this._slideShowWindowProxy = window.open('', '_blank', options);
}

if (!this._slideShowWindowProxy) {
Expand Down

0 comments on commit e756a89

Please sign in to comment.