0

We have a windows application in which we are using cefsharp to open chrome browser to display some data. It was working fine with cefsharp version 75.1.14. But recently as part of Angular 14 update we had to update cefsharp to 108.4.130 latest version. After the update we are facing UI issues in our windows application (NOT Chrome page). Applcaition UI's font size and overall size became too small. As part of Cefsharp update we only did the following changes

  1. Updated cefsharp to latest 108 for all cefsharp depended libraries

  2. Changes recommended for new version update like

     _chromeWebBrowser.javascriptobjectrepository.settings.legacybindingenabled = true
    

and

     _chromeWebBrowser.javascriptobjectrepository.Register("myAsync", New ChromeBrowserEventHandler(Me),True,BindingOptions.DefaultBinder)  

Chrome is rendering without any issues, but window application UI design is facing this issue.

Any help will be appreciated

  • Is your application explicitly DpiAware (PerMonitorV2)? – Jimi Jan 06 '23 at 12:08
  • @Jimi my application is pretty old one, how will i check application is DpiAware? I used find all to find any of the keyword with name Dpi, but none found. In one place i can see autoscalemode is setting as dpi. but its not our form – Nidhin Paul Jan 06 '23 at 12:20
  • In .NET Framework, the DpiAwareness is set in either `app.manifest` (older versions, prior to 4.7) or `app.config` (where you can set `PerMonitorV2`) -- In .NET, this can be configured in the Project's configuration file (`.csproj`), for example: `PerMonitorV2` -- If you're targeting .NET Framework prior to 4.7 and you don't have a Manifest, add one and see [How to configure an app to run correctly on a machine with a high DPI setting](https://stackoverflow.com/q/13228185/7444103) – Jimi Jan 06 '23 at 12:30
  • Scaling the UI to Dpi or Font is a big decision. If you haven't planned for that and your app becomes DpiAware because of dependencies added to a Project, you have to make some serious design choices. Or explicitly disable automatic DpiAwarenes. See the notes here: [DPI Awareness - Unaware in one Release, System Aware in the Other](https://stackoverflow.com/q/50239138/7444103) – Jimi Jan 06 '23 at 12:32
  • @Jimi my target version of .net is 4.6.2. I checked both .csproj and app.config files but i could not find any DPI usages. So that means i need to create new manifest and configure this DPi there? Modifying the designer files of my existing application is hectic task. According to you which will be the easiest approach? – Nidhin Paul Jan 06 '23 at 12:39
  • I'd first try to disable automatic DpiAwaress (see the second link, at the very bottom) and see whether this sets you back to the *original state* – Jimi Jan 06 '23 at 12:53
  • Please provide a before and after upgrade screenshot to highlight the problem (edit your original question to add the images). Are there any errors in the log file? https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting#log-file What OS are you testing with? How does loading google.com in a `ChromiumWebBrowser` instance behave? Does it look too small also? – amaitland Jan 07 '23 at 19:50
  • I downgraded cefsharp version and my issue got resolved. thanks for the updates – Nidhin Paul Jan 09 '23 at 11:13

1 Answers1

1

Finally I resolved the issue. It was not DPI awareness which caused my issue. It looks the like the issue was with cefsharp version i installed 108.4.130. So to fix the issue i downgraded cefsharp version to 107.1.120 and after that resolution issue solved.