Rendering issue with DPI-scaled 4K screen in Windows 10

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Rendering issue with DPI-scaled 4K screen in Windows 10

Postby JamesBateson » Tue Nov 24, 2015 11:25 am

We have currently upgrading from CEF 3.1750 to CEF 3.2526. The main reason is so that the CEF browser scales up when the Windows DPI-scaling factor is increased. Ideally, we want the browser to be per-monitor DPI aware on Windows 8/10 machines.

The broswer scales up nicely at 200% DPI-scaling on Windows 10 on two 1920x1080 monitors with no problems.

However, when a 4K monitor (set at 150% DPI-scaling) is paired with a 1920x1080 monitor (set at 100%), there is a rendering glitch (see image) where it seems to flicker between a scaled up version and a non-scaled up version and sometime show both at the same time.

Some more factors:
  • Forcing CEF to run in a single process (CefSettings.single_process) seems to fix the issue. However, we'd rather not do this if possible.
  • Right clicking on the .exe and checking "Disable display scaling on high DPI settings" stops the flickering but the browser then does not react when moving from one screen to another (i.e. it is not per-monitor DPI aware). The CefClient app and other CEF applications (like Spotify) do not have this setting ticked and still seem to render correctly.
  • Disabling display scaling on the "helper" .exe seems to stop the flickering on the 4K monitor, but moving the app to the other monitor causes the flickering to re-appear.
Attachments
HighDPI_glitch.png
HighDPI_glitch.png (531.73 KiB) Viewed 13163 times
JamesBateson
Newbie
 
Posts: 8
Joined: Wed Feb 06, 2013 5:56 am

Re: Rendering issue with DPI-scaled 4K screen in Windows 10

Postby magreenblatt » Tue Nov 24, 2015 12:05 pm

Per-monitor DPI awareness is rather buggy on Windows 8 (sorry, I don't remember the details). I'm not sure if the situation is improved with Windows 10. Are you calling CefEnableHighDPISupport in your application? See also https://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).aspx.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Rendering issue with DPI-scaled 4K screen in Windows 10

Postby magreenblatt » Tue Nov 24, 2015 12:17 pm

Looks like a combination of setting dpiAware in the application manifest and calling SetProcessDpiAwarenessInternal on Windows 8.1+ gives the best result. Older Windows versions don't support per-monitor DPI awareness so you'll need a fallback that calls SetProcessDPIAware on those platforms.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Rendering issue with DPI-scaled 4K screen in Windows 10

Postby magreenblatt » Tue Nov 24, 2015 1:00 pm

Also, make sure you're enabling high-dpi support in the helper process in addition to the main process.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Rendering issue with DPI-scaled 4K screen in Windows 10

Postby JamesBateson » Wed Nov 25, 2015 8:08 am

Thanks. Switching on DPI awareness in our "helper" process' project manifest fixed the issue.

I was a little surprised because, looking at the DPI Awareness of Spotify in Process Explorer, shows that the main Spotify.exe process is "System Aware" but the SpotifyWebHelper.exe process is "Unaware", and it renders perfectly.
JamesBateson
Newbie
 
Posts: 8
Joined: Wed Feb 06, 2013 5:56 am

Re: Rendering issue with DPI-scaled 4K screen in Windows 10

Postby magreenblatt » Wed Nov 25, 2015 12:32 pm

JamesBateson wrote:I was a little surprised because, looking at the DPI Awareness of Spotify in Process Explorer, shows that the main Spotify.exe process is "System Aware" but the SpotifyWebHelper.exe process is "Unaware", and it renders perfectly.

SpotifyWebHelper.exe is not a CEF helper process, it's used for something else.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Rendering issue with DPI-scaled 4K screen in Windows 10

Postby JamesBateson » Wed Nov 25, 2015 12:48 pm

Ahh - I wondered why it took up so little memory!
JamesBateson
Newbie
 
Posts: 8
Joined: Wed Feb 06, 2013 5:56 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 38 guests