Electron.NET
Electron.NET copied to clipboard
Content After Splash Screen Is Blank Until Click
ElectronNET.CLI 13.5.1 ElectronNET.API 13.5.1
NodeJs version 6.14.12 (not sure if used)
Blazor Application Using net5.0 Target Framework
When I run my Blazor app as a windows desktop application using Electron, the splash screen shows, and then a blank screen shows. If I do not interact with the screen from that point, the blank screen persists and the app hangs on the blank screen.
Clicking the screen or hovering the mouse over Electron window seems to trigger the content of the page loading. After clicking I can resume use of the app as normal.
Steps to Reproduce:
- Create Blazor (may not have to be Blazor) application with electron.
- Add splash screen to electron.manifest.json
- Run the electron app. Do not interact with the computer (i.e. mouse, keyboard) while the app is starting.
- Verify the splash screen shows.
- Verify a blank screen shows after the splash screen is hidden.
- Click around inside and outside of the electron window. Verify the blank screen goes away.
Note: this issue occurs sporadically, so it may take a few tries to reproduce.
After splash screen, before click:
After splash screen, after click:
Same problem here.
net5 and ReactJs
I tried some things like setting focus programmatically after the window opens, but with no success.
We are also seeing this problem sporadically. I've tried with a frameless window and a TitleBarStyle.hidden
and the problem exists in both cases.
Question to @TiagoBrazSantos and @sthomas-fcbh - are y'all using a frameless window or does the problem occur even in a regular window?
I'm seeing the same issue. My splash screen displays properly, followed by my app. But...my app page is blank, until I grab the app window with the mouse and move it. Then it refreshes, and all is well.
Interestingly, the bug does not happen when I run in debug mode in Visual Studio 2022 (or VS2019). It's only with a Release build/install that this occurs.
public async void Electronize()
{
var electronOptions = new BrowserWindowOptions { AutoHideMenuBar = true, Width = 1024, Height = 1024, MinWidth = 1024, MinHeight = 1024, Icon = "GreekVocabBuilder.ico" };
var mainWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions { AutoHideMenuBar = true, EnableLargerThanScreen = true, Width = 1024, Height = 1024, MinWidth = 1024, MinHeight = 1024 });
mainWindow.OnReadyToShow += () => mainWindow.Show();
}
These are the startup options I have in my Startup.cs file Configure method.
UPDATE: In fact, if you wait 10 seconds or so, the page will eventually show (at times), even without moving the main window. However, as mentioned above, if you do move the main window, the page immediately refreshes, and you can see the page context as expected.
Hello,
Yes, I'm using a custom icon.
In the electron.manifest.json file, I'm using this to configure the custom icon:
"win": { "icon": "../../../GreekVocabBuilder.ico" }
Similarly, for the splash screen, I'm using a custom image, and specifying it in electron.manifest.json like so:
"splashscreen": { "imageFile": "/wwwroot/assets/img/GreekVocabBuilder.png" }
Sincerely, Jeff Dodson
On Sat, Nov 27, 2021 at 9:43 AM Guillermo Orue Marighetti < @.***> wrote:
I'm seeing the same issue. My splash screen displays properly, followed by my app. But...my app page is blank, until I grab the app window with the mouse and move it. Then it refreshes, and all is well.
Interestingly, the bug does not happen when I run in debug mode in Visual Studio 2022 (or VS2019). It's only with a Release build/install that this occurs.
public async void Electronize() { var electronOptions = new BrowserWindowOptions { AutoHideMenuBar = true, Width = 1024, Height = 1024, MinWidth = 1024, MinHeight = 1024, Icon = "GreekVocabBuilder.ico" }; var mainWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions { AutoHideMenuBar = true, EnableLargerThanScreen = true, Width = 1024, Height = 1024, MinWidth = 1024, MinHeight = 1024 }); mainWindow.OnReadyToShow += () => mainWindow.Show(); }
These are the startup options I have in my Startup.cs file Configure method.
UPDATE: In fact, if you wait 10 seconds or so, the page will eventually show (at times), even without moving the main window. However, as mentioned above, if you do move the main window, the page immediately refreshes, and you can see the page context as expected.
How have you configured to place a custom .ico? What path does this icon configuration point to?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ElectronNET/Electron.NET/issues/615#issuecomment-980645442, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6APALVEOCR7QI3B5LKONDUOD4C5ANCNFSM5F55O5YA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Hello, Yes, I'm using a custom icon. In the electron.manifest.json file, I'm using this to configure the custom icon: "win": { "icon": "../../../GreekVocabBuilder.ico" } Similarly, for the splash screen, I'm using a custom image, and specifying it in electron.manifest.json like so: "splashscreen": { "imageFile": "/wwwroot/assets/img/GreekVocabBuilder.png" } Sincerely, Jeff Dodson … On Sat, Nov 27, 2021 at 9:43 AM Guillermo Orue Marighetti < @.***> wrote: I'm seeing the same issue. My splash screen displays properly, followed by my app. But...my app page is blank, until I grab the app window with the mouse and move it. Then it refreshes, and all is well. Interestingly, the bug does not happen when I run in debug mode in Visual Studio 2022 (or VS2019). It's only with a Release build/install that this occurs. public async void Electronize() { var electronOptions = new BrowserWindowOptions { AutoHideMenuBar = true, Width = 1024, Height = 1024, MinWidth = 1024, MinHeight = 1024, Icon = "GreekVocabBuilder.ico" }; var mainWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions { AutoHideMenuBar = true, EnableLargerThanScreen = true, Width = 1024, Height = 1024, MinWidth = 1024, MinHeight = 1024 }); mainWindow.OnReadyToShow += () => mainWindow.Show(); } These are the startup options I have in my Startup.cs file Configure method. UPDATE: In fact, if you wait 10 seconds or so, the page will eventually show (at times), even without moving the main window. However, as mentioned above, if you do move the main window, the page immediately refreshes, and you can see the page context as expected. How have you configured to place a custom .ico? What path does this icon configuration point to? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#615 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6APALVEOCR7QI3B5LKONDUOD4C5ANCNFSM5F55O5YA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Thank you Jeff, sorry for delete the previous issue.
One other thing I should probably mention: This "bug" only occurs with a Windows build. If I build and run on a Linux (i.e., Ubuntu) system, everything works...the splash screen splashes, then the app window shows up, and everything instantly displays as it should. So at least for me, this seems to be a Windows-only problem.
Hi, I have the same issue (win 10), is there any workaround?
It has something to do with the Chromium rendering engine. If I put a window over my blank screen it will also redraw and show content. The blank screen occurs in 50% of the cases on my computer. But...
There is a workaround!
What I do is a browserWindow.Reload()
as last step within the Configure()
method. My Configure
method looks like this:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
...
Task.Run(async () =>
{
Electron.Menu.SetApplicationMenu(GetElectronNetMenu());
var browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions() { Show = false });
browserWindow.Show();
browserWindow.Maximize();
browserWindow.Reload(); // Prevents showing a white screen (sometimes)
});
Thank you for the workaround!
🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉
With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!