Skip to content

Commit fab45de

Browse files
committed
Fix toggling full screen
1 parent 4465738 commit fab45de

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

packages/ide/src/fill/electron.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,14 +378,25 @@ class BrowserWindow extends EventEmitter {
378378

379379
public setFullScreen(fullscreen: boolean): void {
380380
if (fullscreen) {
381-
document.documentElement.requestFullscreen();
381+
document.documentElement.requestFullscreen().catch((error) => {
382+
logger.error(error.message);
383+
});
382384
} else {
383-
document.exitFullscreen();
385+
document.exitFullscreen().catch((error) => {
386+
logger.error(error.message);
387+
});
384388
}
385389
}
386390

387391
public isFullScreen(): boolean {
388-
return document.fullscreenEnabled;
392+
// TypeScript doesn't recognize this property.
393+
// tslint:disable no-any
394+
if (typeof (window as any)["fullScreen"] !== "undefined") {
395+
return (window as any)["fullScreen"];
396+
}
397+
398+
// tslint:enable no-any
399+
return false;
389400
}
390401

391402
public isFocused(): boolean {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy