|
|
Rank: Advanced Member Groups: Member
Joined: 7/21/2014 Posts: 137
|
Hi, I'm experiencing a display issue with the Essential Objects WebView component after enabling HighDPI support in my WinForms application (.NET Framework 4.7). **Configuration:** - .NET Framework 4.7 - DPI Awareness: PerMonitorV2 (configured via application manifest) **Manifest configuration:**
Code: XML
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</windowsSettings>
</application>
**Issue Description:** After enabling PerMonitorV2 DPI awareness, the WebView control displays incorrectly after some url load. Some elements appear outside the control's bounds and no scrollbar are displayed. The issue resolves itself when I manually resize the parent form, which suggests a scaling/layout calculation problem during the initial rendering. I noticed similar issues were reported and fixed in previous versions on your forum. Has this regression been identified in the current version? Is there a patch or updated version available that addresses PerMonitorV2 compatibility for the WebView component? Thank you for your help. Fabien
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,461
|
Thanks for letting us know. We will look into it and see what we can find.
|
|
Rank: Advanced Member Groups: Member
Joined: 7/21/2014 Posts: 137
|
Hi,
I also did some testing with different Windows display scaling settings. It looks like the issue does not occur when the system scaling is set to 100%. However, as soon as the scaling factor is increased (e.g. 125% or above), the layout/rendering problem appears in the WebView area.
For reference, at 100% scaling everything renders correctly, but starting at 125% scaling the WebView contents / bounds are mis-calculated, causing UI elements to overflow or layout incorrectly.
Hope this additional data point helps narrow down the root cause!
Thanks !
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,461
|
Hi,
We have not been able to reproduce this problem. Our steps are as follow:
1. Create a new Windows.Forms application with the manifest setting you posted; 2. Create a new WebControl and load a web page on Form_Load; 3. Test the applicaton on different scaling level;
We have some questions about what you mentioned:
1. " incorrectly after some url load". Do you mean this only occur for specific Urls/pages? If so can you send us the Url/HTML in question? Or does it randomly occurs to any web pages? 2. "Some elements appear outside the control's bounds and no scrollbar are displayed". Do you mean the web page area overflow the WebControl's boundary? Windows.Forms creates a window handle for each control (EO.Winform.WebControl) and the WebView then creates its own handle as a child window of that window. So in theory it is not possible for the WebView's content to overflow the WebControls' boundary since the WebView's window is a child window of the WebContro's window and it's not possible for a child window to overflow its parent window.
We automatically sync the WebView's window size and the WebControl's window size. If something goes wrong on that part, then it is possible for the WebView's window size to exceed the WebControl's window size causing the WebView's contents to be clipped by the WebControl's window. In that case if the web page has a scrollbar you won't see it since it's beyond the visible area of the WebControl window thus is clipped off. If any case, a picture of the problem would be helpful.
You can use contact us page to send us test files/pictures.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 7/21/2014 Posts: 137
|
Hi! I've sent you a video of the issue I encountered. I've also noticed a different behavior depending on how the NewWindow event is handled. With this code, the problem occurs:
Code: Visual Basic.NET
Private Sub WebView_NewWindow(sender As Object, e As NewWindowEventArgs)
Try
Dim webBrowser As New EO.WinForm.WebControl()
webBrowser.WebView = e.WebView
AddTabWeb(webBrowser)
'Signifies that we accept the new WebView. Without this line
'the newly created WebView will be immediately destroyed
e.Accepted = True
Catch ex As Exception
MsgBox("Error while creating the tab:" & ex.Message)
End Try
End Sub
However, if I don't use the webview but instead create a new one using .LoadUrl to load the requested page, the problem doesn't occur:
Code: Visual Basic.NET
Private Sub WebView_NewWindow(sender As Object, e As NewWindowEventArgs)
Try
'Dim webBrowser As New EO.WinForm.WebControl()
'WebBrowser.WebView = e.WebView
'AddTabWeb(webBrowser)
Dim newTab As New TabPage()
newTab.Width = 150
newTab.Height = 20
Dim webControl As New EO.WinForm.WebControl
'create the tab
Me.TabWeb.TabPages.Add(newTab)
'create the webbrowser
webControl.WebView = New WebView
WebView_Attach(webControl)
webControl.Dock = DockStyle.Fill
Me.TabWeb.TabPages(TabWeb.TabPages.Count - 1).Controls.Add(webControl)
webControl.WebView.LoadUrl(e.TargetUrl)
'Signifies that we accept the new WebView. Without this line
'the newly created WebView will be immediately destroyed
'e.Accepted = True
Catch ex As Exception
MsgBox("Error while creating the tab:" & ex.Message)
End Try
End Sub
Hope this helps! ;)
|
|