diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index baeff4d..f7c4d05 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -172,12 +172,13 @@ function startSplashScreen() { } } - - splashScreen.setIgnoreMouseEvents(true); + //Removed as we want to be able to drag the splash screen: splashScreen.setIgnoreMouseEvents(true); app.once('browser-window-created', () => { - splashScreen.destroy(); - splashScreen = null; + if (splashScreen) { + splashScreen.hide(); + } + //We cannot destroy the window here as this triggers an electron freeze bug (https://github.com/electron/electron/issues/29050) }); const loadSplashscreenUrl = path.join(__dirname, 'splashscreen', 'index.html') + '?imgPath=' + imageFile; @@ -271,6 +272,13 @@ function startSocketApiBridge(port) { } }); + socket.on('splashscreen-destroy', () => { + if(splashScreen) { + splashScreen.destroy(); + splashScreen = null; + } + }); + socket.on('register-app-open-url-event', (id) => { global['electronsocket'] = socket;