neutralino.js
neutralino.js copied to clipboard
Preventing white flash when starting up the window
Hey! I'm the opposite of a complete fan when it comes to white flashes as you open up software, is there a way to achieve something similar to this?
Things I tried:
- Using CSS to set the background color of the body, and while that helps (slightly), the white flash is still there on startup.
- Setting
"hidden": trueinneutralino.config.json, but it seems you can't show a hidden application for some reason? (Binding thereadyevent to just to doNeutralino.window.show()-or any other- doesn't do anything, if this worked it'd solve my issue)
I was thinking maybe the "main" process can start hidden (specified the config file), and then you programatically create the actual user-facing window (in the background, somehow?) and show it after it's done rendering the black background (probably a timeout is enough) as per this https://neutralino.js.org/docs/api/window#windowcreateurl-windowoptions
Maybe also starting the window transparent and borderless and then disabling the transparency, with timeout as well.
Anyway a little bit lost here! Would appreciate more configuration options for the window / overridable window creation event.
Setting "transparent: true" helps, no white flash at least.
I was thinking maybe the "main" process can start hidden (specified the config file), and then you programatically create the actual user-facing window (in the background, somehow?) and show it after it's done rendering the black background (probably a timeout is enough) as per this https://neutralino.js.org/docs/api/window#windowcreateurl-windowoptions
That is a great idea
I also tried solution number 2 just like you described but couldn't get it to work either. I'm on Windows 11 and would love to be able to remove the white flashing window on startup.
Another potential solution would be if the native window could load with another background color on default, before the CSS kicks in, but I see no option for this in the config file.
Setting "transparent: true" works but also removes the menu bar on Windows as noted in the docs, so it's not an option unfortunately, unless we could re-enable it after load.