Workaround for electron freeze bug

This commit is contained in:
theolivenbaum
2021-09-07 17:48:12 +02:00
parent a637174b93
commit 6a4a7eff1c

View File

@@ -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;