Page 1 of 1

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

PostPosted: Tue Nov 24, 2015 11:25 am
by JamesBateson
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.

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

PostPosted: Tue Nov 24, 2015 12:05 pm
by magreenblatt
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.

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

PostPosted: Tue Nov 24, 2015 12:17 pm
by magreenblatt
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.

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

PostPosted: Tue Nov 24, 2015 1:00 pm
by magreenblatt
Also, make sure you're enabling high-dpi support in the helper process in addition to the main process.

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

PostPosted: Wed Nov 25, 2015 8:08 am
by JamesBateson
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.

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

PostPosted: Wed Nov 25, 2015 12:32 pm
by magreenblatt
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.

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

PostPosted: Wed Nov 25, 2015 12:48 pm
by JamesBateson
Ahh - I wondered why it took up so little memory!