-
Notifications
You must be signed in to change notification settings - Fork 55
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
(sometimes) control not fully fill window at first loaded #432
Comments
Thanks for filing this @cuiliang! This is a known issue (but didn't have a GitHub issue yet), and we'll take a look next sprint. |
Any workground on this issue? |
No, we haven't started taking a look at this yet. I'll update you when we have more info. Thanks! |
@cuiliang The issue didn't occur when I tried your project. Have you tried setting
There does seem to be a little bit of a delay when starting one's program when the web cache files/folders don't exist yet. Not sure if it would make a difference or not, but you could try programmatically initializing "CoreWebView2" by calling Subscribe to the Window "Loaded" event by adding MainWindow.xaml
Don't set Source property, as this causes initialization to occur.
Then in MainWindow.xaml.cs, add the following code: MainWindow.xaml.cs
|
@cgeier Run program directly from output folder, not from visual studio. I have also tried call 'UpdateLayout()' from window Loaded event handler, but have no effect. |
We've got a fix for this, and it should be available next release (around mid October). In the meantime, you should be able to workaround the issue by calling webView.UpdateWindowPos() after EnsureCoreWebViewAsync is completed (or in CoreWebView2Ready event handler). This will cause a WindowPosChanging event in our control which will correctly update the window bounds. |
@champnic webView.UpdateWindowPos() works, thank you! |
This should now be fixed in WebView2 SDK 1.0.674-prerelease. If this is still an issue please let us know. Thanks! |
Looks like this one is back in V1.0.707.0 |
Thanks for the heads up. We'll take another look... |
@ukandrewc We've been unable to repro this bug. Do you have a repro sample you could share, or other machine setup info? |
@champnic Sorry, I'm not seeing it all the time, it's while resizing during initialisation. Will try and get a repro together, in the mean time, a screenshot (WebView2.Dock = DockStyle.Fill, resized manually when form opened) Win32, Winforms Latest Dev Edge : |
Ah, I don't think we've been trying to test other explicit resizing during initialization - the original bug was with just a default "Create a webview" behavior we would see the broken resizing. My guess is the control takes the current expected bounds when it begins initialization and uses those, and then misses the updated size until it's done initializing, at which point it starts listening for changes. The fix may be something like having the control re-check bounds when it hooks up to size listening. Let me know if you do get a repro sample/app, as that will make verifying this much easier. Thanks! |
@champnic Will do, just a bit up against with my day job at the moment ;-) |
@champnic I think this is me, possibly due to a WebView2 change, I'm not sure. I was enabling DevTools Protocol events in CoreWebView2InitializationCompleted:
This is deadlocking. I don't think it was prior to 1.0.707.0, but not sure. Has the CoreWebView2 event changed from Async to Sync? because I'm sure this used to work. Anyway, I've moved "Page.enable" now, and I can't reproduce the issue any more. |
@ukandrewc The events are still async in general, though there are parts of it that are sync (setup for the CDP call). Where did you move the call to that's working? If you move it back, do you hit the same deadlock issue (it's reproducible)? |
@champnic This is me, because I'm waiting for the result of the call. It is a little odd, because using PushFrame prevents the task completing. I don't know you need to know, but this is what I've found:
|
@ukandrewc any luck on a repro? I haven't been able to repro anything. |
@johna-ms In my case, it was my fault. |
Thanks for the follow-up - closing this for now. Let us know if you see this again! |
Description
When window first show, some time it will show on only part of window.
After mouse move over webview or move/resize window, it will be stretched to full window.
code:
Version
SDK: 0.9.628-prerelease
Runtime: 87.0.637.0
Framework: WPF with .Net 4.6.2
OS: Windows 10 2004(19041.450) , Windows 10 1909
Display: 3840*2160, display ratio: 150%
Repro Steps
Screenshots
It also happend with my own application.
Additional context
This not always happen, only some times.
It seems like something related to dpi scale.
AB#28658107
The text was updated successfully, but these errors were encountered: