Fix full screen detection for Chromium

This commit is contained in:
Asher 2019-04-25 13:29:11 -05:00
parent fab45dedcd
commit 58cf109a83
No known key found for this signature in database
GPG Key ID: 7BB4BA9C783D2BBC
1 changed files with 8 additions and 2 deletions

View File

@ -394,10 +394,16 @@ class BrowserWindow extends EventEmitter {
if (typeof (window as any)["fullScreen"] !== "undefined") {
return (window as any)["fullScreen"];
}
// tslint:enable no-any
try {
return window.matchMedia("(display-mode: fullscreen)").matches;
} catch (error) {
logger.error(error.message);
return false;
}
}
public isFocused(): boolean {
return document.hasFocus();