From c2b29005d97d605e61726bec7cbdb02d51eea837 Mon Sep 17 00:00:00 2001 From: OrangeJedi Date: Thu, 9 Mar 2023 22:32:24 -0700 Subject: [PATCH] Fixed a bug in the preview window --- app.js | 8 ++++++-- web/screensaver.js | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 0a1743b..8ea0522 100644 --- a/app.js +++ b/app.js @@ -172,7 +172,8 @@ function createSSPWindow(argv) { }, frame: true, transparent: true, - icon: path.join(__dirname, 'icon.ico') + icon: path.join(__dirname, 'icon.ico'), + show: false }); win.loadFile('web/screensaver.html'); win.on('closed', function () { @@ -181,7 +182,10 @@ function createSSPWindow(argv) { win = null; preview = false; }); - win.webContents.send('screenNumber', 0); + win.once('ready-to-show', () => { + win.webContents.send('screenNumber', 0); + win.show(); + }) if (argv) { if (argv.includes("/dt")) { win.webContents.openDevTools(); diff --git a/web/screensaver.js b/web/screensaver.js index abb81d9..8467606 100644 --- a/web/screensaver.js +++ b/web/screensaver.js @@ -231,7 +231,6 @@ function fadeVideoIn(time) { randomDirection = true; transitionSettings.direction = transitionDirections[transitionSettings.type][randomInt(0, transitionDirections[transitionSettings.type].length)]; } - console.log(transitionSettings); } if (time > 0) { transitionTimeout = setTimeout(fadeVideoIn, 16, time - 16);