Closed ghord closed 1 year ago
We have this exact problem
The problem is still there in Microsoft.WindowsAppSDK 1.2.221209.1
To repro this in a trivial WinUI3 app:
<WebView2 x:Name="wv2" ></WebView2>
Change MainWindow.xaml.cs to have this code:
public MainWindow()
{
this.InitializeComponent();
wv2.CoreWebView2Initialized += Wv2_CoreWebView2Initialized;
wv2.EnsureCoreWebView2Async();
}
private void Wv2_CoreWebView2Initialized(WebView2 sender, CoreWebView2InitializedEventArgs args)
{
wv2.NavigateToString(@"
<html>
<body>
<h1>Hello, world!</h1>
<div class=""container"">
<div class=""row"">
<div class=""col"">
<input class=""form-control"" type=""text"" />
</div>
</div>
<div class=""row"">
<div class=""col"">
<input class=""form-control"" type=""text"" />
</div>
</div>
</div>
</body>
</html>
");
}
Eventually you'll still be able to type, but clicking with the mouse won't work.
Can't really tell from the screenshot, but I can assure you that keyboard/typing works, yet I can't click on the textboxes (it ignores the clicks):
we're affected too --> upvote...
Do they even test it more than 2 seconds before releasing it?
To be fair, crApple is not better, last year the macOS WKWebview was crashing all the times and it took 8 months before they fix it. This year Apple WKWebview on macOS Intel will never trigger the onKey events, so every website on the planet with a text input will not work.
It just proves that big corps don't test before releasing and not only the programmers suffers, but in the end their customers suffer from their lack of respect. Just 5 minutes of using their own tools would show them that it does not work at all.
We are also affected by this problem and our implementation of the Monaco editor. We cannot go live with this issue. Please resolve this ASAP.
Is there any progress on the problem?
This would've made bill gates poor back in the days
Bill Gates best contribution to the world is not Windows (a cheap copy of CPM and YES windows is CPM not Unix based), but the BASIC rom chip (he was the one who programmed it) that was included in every C64, ZX Spectrum, Tandy COCO, and Atari 8bit computers. Bill was a true programmer, not some XML pretentious scripters. BASIC was the revolution that made the 80's kids and normies do stuff and become programmers.
Bill was a true programmer
Sorry I didn't know better, thanks for the information given
Tracking with internal bug.
I suspect it's because they are using Task based mechanism to handle user input then send it to the browser like a proxy, and they use some kinds of mutex or lock that doesn't get released properly. If that's happening I would like to input directly to the browser without this extra layer and if we are using native control with webview then we cover the browser layer with the native layer but no proxy-ing (unless it's needed?)
The design of the MS framework is baffling and insane. Everything is async so everything becomes 400x slower than anything on Android and Apple because of the useless context switching (only I should decide what is async). And the biggest sin of the computer world : MS are a huge fan of thread re-entrance where our code running on the main thread will be pause execution mid-way (by MS) and another main thread task from MS will trigger again the same code and complete and then the code that was running will resume.
Instead of putting the next task on the main thread queue, they pause our main. This is criminally insane and dangerous. Another problem is that every MS function can throw and it is never mentioned in the documentation. Worst most of the time you will get unhandled exception inside a try catch block.
Not only it is painful to me an my customers because it require 100x more work to make the app just not crash every 2 minutes, but everything made by MS will be unstable, including WebView2 that crash every seconds.
There are so many wait, dispatch and useless validation just so the app won't crash every second. Anytime you call a MS function, you risk crashing the app. But getting so many unhandled exception inside try catch block is maddening.
Stop throwing MS, just make your code work. There is even thread re-entrance inside the MS library. Found that if you call the HttpClient thousands of time over 1 hour, eventually, deep inside MS code, there will be thread-re-entrance where the same line of code is executed twice and that will crash the app.
Because it is never mentioned anywhere on the internet that anything you do can be interrupted by MS and then called multiple times while the other did not even complete. You have to be paranoid and add a if (isFinishedExecuting) everywhere absolutely everywhere at the beginning of every functions. And if you do log the name of every function, you will see that everything is out of order.
I draw the buttons myself with Win2D, everything is async and waiting. Because of that drawing a button on windows is 400x slower than on a Mac. The app on iOS and macOS is rendering at 4x the resolution (oversampling) and it runs at 60fps. On windows, I had to render 1:1 and disabled animation. Everything is stuttering on MS, nothing is smooth. My pc has a 2080ti and the apple product have cheap onboard gpu. Microsoft design has a cost in speed and in stability and we are the one paying for it.
How come cloud gaming doesn't have this problem
Tracking with internal bug.
Internal tracking is great... but can the users please get an update?
Just reporting another instance of this bug that is completely deal-breaking for my application developed in MAUI Hybrid.
We can't develop our app and was forced to put the windows version of the MAUI blazor project on hold, forced to use it on android device only.
We can't develop our app and was forced to put the windows version of the MAUI blazor project on hold, forced to use it on android device only.
.NET 6 still works On another environment, copy your project and change it all from .NET 7 to .NET 6, then wait for the problem fixed. You can update client on windows once it's fixed
You can update client on windows once it's fixed
It says "fixed internally", does that mean a public fix is coming soon? thanks?
We can't develop our app and was forced to put the windows version of the MAUI blazor project on hold, forced to use it on android device only.
.NET 6 still works On another environment, copy your project and change it all from .NET 7 to .NET 6, then wait for the problem fixed. You can update client on windows once it's fixed
Its not that easy, there are a lot of features and API's that were introduced in .NET 7 that people are using. It turns into a migration project.
This bug actually seems very interesting, can you guys tell a story on how it was fixed, what went wrong was it hard
I bet that it was threading problem. Same code executing again while the previous one has not completed. They should use more TryEnqueue() and put the next job on the thread queue so it will be executed when the thread is free.
This bug actually seems very interesting, can you guys tell a story on how it was fixed, what went wrong was it hard
Lets just focus on actually getting the bug fix first.
@gabbybilka What's the point of having an open source community with issue tracking if you're just going to track it internally and never respond to the public?
Open Source does not always mean the Richard Stallman (St-iGNUsius) definition of open source. Anything can be open source with a good disassembler I guess.
Open Source is just a generic feel good name like democracy and peace, but in practice it means quiet the opposite.
Open Source does not always mean the Richard Stallman (St-iGNUsius) definition of open source
Richard said was free is not open source, former is better
Anything can be open source with a good disassembler I guess
it's way easier to monitor and modify with 'source', server still is a black box, closer to hardware then you need special methods like mEMR to probe electron bits in ram
This bug actually seems very interesting, can you guys tell a story on how it was fixed, what went wrong was it hard
This was a multi-threaded multi-HWND issue. Mouse/pointer input is delivered to a background thread (to enable things like smooth touch panning of ScrollViewers) while keyboard input still goes to the UI thread. These need to be synchronized. WebView2 introduces an extra HWND for keyboard input, and this caused problems in the synchronization code.
This was a multi-threaded multi-HWND issue. Mouse/pointer input is delivered to a background thread (to enable things like smooth touch panning of ScrollViewers) while keyboard input still goes to the UI thread. These need to be synchronized. WebView2 introduces an extra HWND for keyboard input, and this caused problems in the synchronization code.
That's amazing. Thanks for fixing this bug.
Then through which way the update comes to us developers (Windows, Visual Studio, NET MAUI...)?
Thanks
When will you release fix?
@codendone Any news about an update possibility?
no
I don't yet have a release timeline to share beyond we'd like it to be soon. The fix is currently going through extra testing.
Will the update be available to us when a new nuget version of Microsoft.Web.WebView2 is released here?
By the way, is there a way of force my .Net Maui App to use a specific version of Microsoft.Web.WebView2?
@Eilon Do you know how we (.NET MAUI Blazor developers) will get this fix? Is it by nuget, VS, new SDK? 😊 Thanks in advance and have a nice weekend!
The fix will be delivered as a Windows App SDK update.
The fix will be delivered as a Windows App SDK update.
Hi! I don't think I have installed any Windows sdk explicitly. I have just installed the Visual studio MAUI workload. Will I get it in a VS update then? 😊
Hi! I don't think I have installed any Windows sdk explicitly. I have just installed the Visual studio MAUI workload. Will I get it in a VS update then? 😊
yes, Visual Studio is microsoft's powerful IDE for making all kinds of program. When you install a 'workload' you installed what you needed to develop for the application. A couple years / months ago there is Xamarin, their selling point was that you can write UI that run on Android + IOS, while still having access to native UI you are mostly writing 'common' UI features for both platform together. Xamarin achieved this by using native dependency for each platforms, MAUI too is using WindowsSDK when your app is going to be running on WIndows. When you are updating Visual Studio you are getting the newest version of the SDK for your development.
Meanwhile, these SDK can still be installed via nuget packages sometimes. People who doesn't use Visual Studio does a lot stuffs manually.
For example, in order to write C++ to compile to webassembly, you first have to find tools like emscripten, which turns out providing you with other tools to compile your programing languages to IL using LLVM and then compiles IL to webassembly. It's people's decision for how to do certain things and they provide the way to do it for you, you don't have to worry about it mostly because it works, just like when you are coding for Blazor.Webassembly .NET compiles your code to webassembly using emscripten too
If I understand you correctly @Xyncgas , we don't have to look for new Nuget versions or donwload SDK (see https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/downloads), we just wait for the next Visual Studio update.
I need to get another thing off at this point. The fact that this problem has dragged on for so long indicates that MAUI is used almost exclusively with XAML. And if someone then wants to display the web content in their app, then they will have the current problem through WebView2. And from the way it seems, it's really only a few programmers. On the other hand, if you use MAUI with Blazor, then there is no workaround and with such errors in the VebView component, the developed app is unusable because Blazor cannot work with MAUI without WebView. Two points worry me a lot here:
Thanks
I don't like XAML, it's a static description, where as html you can change it dynamically and add event listeners to elements. The overhead of parsing plaintext html might seem stupid, it is actually very fast to parse string due to SIMD optimizations.
Everyone seriously wanting a MAUI.Blazor app can switch back to .NET 6 and this problem will not exist, publishers can choose the publish a webview that's evergreen or with the version locked.
the heavy dependency on WebView from MAUI Blazer or no alternative.
The dependency for MAUI.Blazor to have webview is so there is a browser to render web content, although it would be nice if we can draw ui using a unified rendering engine like a browser but without a browser and directly use the underlying available GUI framework for that platform
Tried to get some feedback in the WinUI community call but had no luck @gabbybilka (I noticed as well the 1.3 milestone was added). But any update when a fix would become available? cc @codendone
Fixed and available in 1.2.5: https://www.nuget.org/packages/Microsoft.WindowsAppSDK/1.2.230313.1 Will be available in 1.3.0 when it ships as well.
Fixed and available in 1.2.5: https://www.nuget.org/packages/Microsoft.WindowsAppSDK/1.2.230313.1 Will be available in 1.3.0 when it ships as well.
Thank you!
Awesome! Thanks!!
@Eilon can we get Microsoft.WindowsAppSDK
upgraded to this version (1.2.230313.1) on MAUI?
Alright! At first glance a long standing issue which as road block for me is resolved now https://github.com/MicrosoftEdge/WebView2Feedback/issues/3167
Fingers crossed!
How do we update it in MAUI? I have seen the nuget package manager is saying this package is blocked by the project. I have tried to add it in the csproj manually.
Do we need to do any thing special for updating it inside Maui Blazor App?
How do we update it in MAUI? I have seen the nuget package manager is saying this package is blocked by the project. I have tried to add it in the csproj manually.
Do we need to do any thing special for updating it inside Maui Blazor App?
In my MAUI Blazor csproj, I have added this package reference manually into an ItemGroup tag (where all my other package references are), and it seems to have done it for me (at least no freezes so far): `
When can we get patched
I have updated my Visual Studio to version 17.5.3 and the error is fixed on Windows 10.
Unfortunately, it did not work on Windows Server 2019. I have written a new post about this here (but no feedback from WebView2 team yet). See https://github.com/MicrosoftEdge/WebView2Feedback/issues/3333
Describe the bug
WebView2 freezes mouse input when typing too fast.
Steps to reproduce the bug
Expected behavior
WebView2 continues to work normally
Screenshots
NuGet package version
Windows App SDK 1.2.1: 1.2.221116.1
Packaging type
Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
This does reproduce on both packaged and unpackaged apps.
This does not reproduce on versions 1.1.x.
This issue occurs in every 1.2.x version I've tried.