Give macOS an extra 300ms to open and fullscreen a webview
This commit is contained in:
parent
f8fc9fded6
commit
45f96e6537
|
@ -17,7 +17,7 @@ function padded_frame(i) {
|
|||
return str;
|
||||
}
|
||||
class WebView {
|
||||
constructor() {
|
||||
constructor(platform) {
|
||||
this.opened = false;
|
||||
this.showing = false;
|
||||
this.digitalWindow = new BrowserWindow({
|
||||
|
@ -39,7 +39,8 @@ class WebView {
|
|||
this.digitalWindow = null;
|
||||
this.close();
|
||||
});
|
||||
this.digitalWindow.hide();
|
||||
//this.digitalWindow.hide();
|
||||
this.platform = platform;
|
||||
}
|
||||
async open() {
|
||||
this.digitalWindow.show();
|
||||
|
@ -47,6 +48,9 @@ class WebView {
|
|||
this.opened = true;
|
||||
await this.digitalWindow.setFullScreen(true);
|
||||
await delay_1.delay(300);
|
||||
if (this.platform === 'osx') {
|
||||
await delay_1.delay(300); //give macs an extra 300ms to open fullscreen
|
||||
}
|
||||
}
|
||||
async show(src) {
|
||||
if (!this.digitalWindow) {
|
||||
|
@ -150,7 +154,7 @@ class Display {
|
|||
async open() {
|
||||
//if (this.platform !== 'nix') {
|
||||
if (!this.wv || !this.wv.opened) {
|
||||
this.wv = new WebView();
|
||||
this.wv = new WebView(this.platform);
|
||||
await this.wv.open();
|
||||
}
|
||||
//} else {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -17,7 +17,7 @@ function padded_frame(i) {
|
|||
return str;
|
||||
}
|
||||
class WebView {
|
||||
constructor() {
|
||||
constructor(platform) {
|
||||
this.opened = false;
|
||||
this.showing = false;
|
||||
this.digitalWindow = new BrowserWindow({
|
||||
|
@ -39,7 +39,8 @@ class WebView {
|
|||
this.digitalWindow = null;
|
||||
this.close();
|
||||
});
|
||||
this.digitalWindow.hide();
|
||||
//this.digitalWindow.hide();
|
||||
this.platform = platform;
|
||||
}
|
||||
async open() {
|
||||
this.digitalWindow.show();
|
||||
|
@ -47,6 +48,9 @@ class WebView {
|
|||
this.opened = true;
|
||||
await this.digitalWindow.setFullScreen(true);
|
||||
await delay_1.delay(300);
|
||||
if (this.platform === 'osx') {
|
||||
await delay_1.delay(300); //give macs an extra 300ms to open fullscreen
|
||||
}
|
||||
}
|
||||
async show(src) {
|
||||
if (!this.digitalWindow) {
|
||||
|
@ -150,7 +154,7 @@ class Display {
|
|||
async open() {
|
||||
//if (this.platform !== 'nix') {
|
||||
if (!this.wv || !this.wv.opened) {
|
||||
this.wv = new WebView();
|
||||
this.wv = new WebView(this.platform);
|
||||
await this.wv.open();
|
||||
}
|
||||
//} else {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -17,7 +17,7 @@ function padded_frame(i) {
|
|||
return str;
|
||||
}
|
||||
class WebView {
|
||||
constructor() {
|
||||
constructor(platform) {
|
||||
this.opened = false;
|
||||
this.showing = false;
|
||||
this.digitalWindow = new BrowserWindow({
|
||||
|
@ -39,7 +39,8 @@ class WebView {
|
|||
this.digitalWindow = null;
|
||||
this.close();
|
||||
});
|
||||
this.digitalWindow.hide();
|
||||
//this.digitalWindow.hide();
|
||||
this.platform = platform;
|
||||
}
|
||||
async open() {
|
||||
this.digitalWindow.show();
|
||||
|
@ -47,6 +48,9 @@ class WebView {
|
|||
this.opened = true;
|
||||
await this.digitalWindow.setFullScreen(true);
|
||||
await delay_1.delay(300);
|
||||
if (this.platform === 'osx') {
|
||||
await delay_1.delay(300); //give macs an extra 300ms to open fullscreen
|
||||
}
|
||||
}
|
||||
async show(src) {
|
||||
if (!this.digitalWindow) {
|
||||
|
@ -150,7 +154,7 @@ class Display {
|
|||
async open() {
|
||||
//if (this.platform !== 'nix') {
|
||||
if (!this.wv || !this.wv.opened) {
|
||||
this.wv = new WebView();
|
||||
this.wv = new WebView(this.platform);
|
||||
await this.wv.open();
|
||||
}
|
||||
//} else {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -25,7 +25,9 @@ class WebView {
|
|||
private digitalWindow : any;
|
||||
public opened : boolean = false;
|
||||
public showing : boolean = false;
|
||||
constructor() {
|
||||
private platform : string;
|
||||
|
||||
constructor (platform : string) {
|
||||
this.digitalWindow = new BrowserWindow({
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
|
@ -45,7 +47,8 @@ class WebView {
|
|||
this.digitalWindow = null;
|
||||
this.close();
|
||||
});
|
||||
this.digitalWindow.hide();
|
||||
//this.digitalWindow.hide();
|
||||
this.platform = platform;
|
||||
}
|
||||
async open () {
|
||||
this.digitalWindow.show();
|
||||
|
@ -53,6 +56,9 @@ class WebView {
|
|||
this.opened = true;
|
||||
await this.digitalWindow.setFullScreen(true);
|
||||
await delay(300);
|
||||
if (this.platform === 'osx') {
|
||||
await delay(300); //give macs an extra 300ms to open fullscreen
|
||||
}
|
||||
}
|
||||
async show (src : string) {
|
||||
if (!this.digitalWindow) {
|
||||
|
@ -164,7 +170,7 @@ class Display {
|
|||
public async open () {
|
||||
//if (this.platform !== 'nix') {
|
||||
if (!this.wv || !this.wv.opened) {
|
||||
this.wv = new WebView();
|
||||
this.wv = new WebView(this.platform);
|
||||
await this.wv.open()
|
||||
}
|
||||
//} else {
|
||||
|
|
Loading…
Reference in New Issue