-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebView causes empty window popup and closes immediately #24933
Comments
Can you please make a small repro project showing this? It makes it easier to establish the issue from a shared context in case anyone else can't. |
I think I have a related problem. I am developing two WinUI apps which both have approximately the same setup. My app setup is as follows (the same for both):
builder.ConfigureLifecycleEvents(lifecycle =>
{
#if WINDOWS
lifecycle.AddWindows(lifecycleBuilder => lifecycleBuilder
.OnPlatformMessage((window, _) =>
{
if (!(IsStarting && ps.StartInSystemTray())) return;
GetAppWindow(window);
_appWindow.Hide();
})
.OnVisibilityChanged((_, args) =>
{
if (IsStarting && ps.StartInSystemTray())
{
DisableStarting();
return;
}
if (!ps.Get<bool>(StorageKey.MinimizeToSystemTray)) return;
if (IsClosing || args.Visible)
{
App.ResizeSave();
return;
}
MinimizeToTray();
})
.OnWindowCreated(window =>
{
// window.ExtendsContentIntoTitleBar = true; // https://github.com/dotnet/maui/issues/18773
GetAppWindow(window);
if (ps.StartAppMaximized() && _appWindow.Presenter is OverlappedPresenter p) p.Maximize();
_appWindow.Closing += (_, e) =>
{
e.Cancel = true;
if (ps.Get<bool>(StorageKey.DoNotQuitApp) && !ForceClose)
{
MinimizeToTray();
return;
}
SetClosing();
Application.Current?.Quit();
};
}));
#endif
});
In the past, this setup prevents the app window to show at all on startup (just makes the systray icon (with H.NotifyIcon.Maui, btw) and nothing else, until the user opens the app by icon click. But since today or so (I can not tell since when exactly, because I stumbled upon this today the first time) a blank window pops up, size is approx. window height and the width approx. width/2. What I tried:
ConclusionI can not tell what had changed, but it seems that MAUI is not the only actor in the story, because when I start the already released and deployed apps it works as it should. Probably a race condition with WASDK/MAUI or .NET SDK or Edit: I managed to stop with a break point when the popup is open. 2024-09-26_14-38-34.zip What really strange is: I can click behind it and open the context menu from a desktop icon (as example). |
Yes, it wouldn't let me attach it to the original ticket for some reason, here it is. |
Broken bot? Not only did I provide the steps for reproducing the problem, but I also provided the source code as well. |
This issue has been verified using Visual Studio 17.12.0 Preview 2.0(8.0.91 & 8.0.3) 17.11.4 (7.0.101). Can repro this issue at windows platform. |
I have also started seeing this issue with no code change. Do we know what this issue is and any workaround/fixes for now? |
As I said: I think MAUI is not to blame here. My apps are |
I am having this same problem. Last week I didn't have this issue and with no code change I am seeing a flickering popup. |
I am having this same issue. No code changes. |
I tried the workaround from MicrosoftEdge/WebView2Feedback#4834 (comment) by adding:
to my |
Adding this to our .NET8 SR9.2 milestone for tracking purposes. It looks like this is a runtime issue |
Thanks for the reports and the repro step details. This one is unrelated to MAUI and is reproduceable with a plain .NET WinUI3 app. We're waiting on an upstream fix for the issue already mentioned here: MicrosoftEdge/WebView2Feedback#4834 |
This issue is fixed now with the latest Edge release Version 130.0.2849.46 (Official build) (64-bit) |
Description
This only started happening recently without any code changes, guessing maybe a browser or windows update has caused the problem? There never used to be any kind of flickering popup. If you don't set the source property on the web view, the popup doesn't occur. The popup is hard to see with the default window size, make the window size smaller to see it easier.
Steps to Reproduce
https://github.com/jhastingsiii/busted-maui-webview
Link to public reproduction project repository
No response
Version with bug
8.0.91 SR9.1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: