Open jhastingsiii opened 1 week ago
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):
MauiProgram.cs
-> ConfigureLifecycleEvents()
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
});
App.cs
where I do some window resizing and such (and also check if it should launch in systray)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. This is the setup both share.
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.
I 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 WebView2
runtime.
Edit: I managed to stop with a break point when the popup is open.
2024-09-26_14-38-34.zip (this is a short screen cast, I didn't manage to upload the MP4 directly...
What really strange is: I can click behind it and open the context menu from a desktop icon (as example).
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.
Yes, it wouldn't let me attach it to the original ticket for some reason, here it is. MauiApp1.zip
Hi @jhastingsiii. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
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 MAUI.Blazor
apps, so every launch of an app launches WebView2
and revealing this issue at app startup immediately.
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 was able to reproduce this with the following method:
<MauiVersion>8.0.91</MauiVersion>
underneath <UseMaui>true</UseMaui>
in the app's csprojWebView
to the MainPage.xaml
<WebView
HeightRequest="600"
Source="https://github.com/dotnet/maui/issues/24933"
WidthRequest="600" />
Here are 5 screenshots representing the different states I see the app go thru:
Launch the app
At approximately 2.8 seconds we see a blank MainPage.xaml appear
At approximately 3.1 seconds we see an unexpected empty window popup (full height, half width, left aligned) and it stays visible for approximately 0.1 seconds
At approximately 3.3 seconds the MainPage.xaml goes to gray for approximately 0.1 seconds
At approximately 3.4 seconds the MainPage.xaml goes back to white and takes a further 1.4 seconds to fully populate
I tried the workaround from https://github.com/MicrosoftEdge/WebView2Feedback/issues/4834#issuecomment-2381904393 by adding:
Environment.SetEnvironmentVariable("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", "--window-size=0,0 --window-position=20000,20000");
to my App.xaml.cs
before InitializeComponent();
and it appears to obfuscate the empty window popup. This might be a satisfactory workaround that can be put in place until this issue is fixed.
Adding this to our .NET8 SR9.2 milestone for tracking purposes.
It looks like this is a runtime issue https://github.com/MicrosoftEdge/WebView2Feedback/issues/4834#issuecomment-2379786141
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: https://github.com/MicrosoftEdge/WebView2Feedback/issues/4834
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