I am using ChromiumFX to render some webcontent in WPF application. But it seems that the content is somehow rendered twice as shown in following screenshot. The bigger one is the expected size which functions correctly while the smaller one doesn't response to any mouse operation. The smaller one acts just as a static picture.
Notice that We have tested the exact same application on Win7/Win8/Win10 on x86/x64 machine with different screen sizes and resolutions. Everything works fine except for Surface Pro 3/4 + Win10. It also works on Surface Pro 1 + Win8.
I guess Chromium kernel is using native Windows API to render behind the scene. So there could be some incompatible problems with Surface hardware, OS API and Chromium kernel. But to be honest, I don't have any idea where to start the research. Could you guys give me a hint on this? Thanks in advance!
Detailed version info:
2016-7-11 Update
After further tests, it seems that the original solution is not the best one. The problem happens again if another monitor is connected to PC and the application window is moved there.
So the final solution should be add app.manifest to the application and enable the dpiAware
property.
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
Finally got it work. So I will put the answer in case someone runs into same problem.
Actually the problem not only happens in Win10 + Surface Pro. It happens in all devices with win10. Once user changes the default DPI setting, the problem appears.
The workaround for the applications in the filed is to disable display scaling on high dpi settings for your application.
And to solve the problem once for all, you may need to add a registry key for your application during installation as follows:
Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
<RegistryValue Type="string" Name="APPLICATIONROOTDIRECTORY]ApplicationName.exe" Value="~ HIGHDPIAWARE" />
Notice that if you are using a separated process to render, set aforementioned value as the value of CfxSettings.BrowserSubprocessPath
.