anmar7889 / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 1 forks source link

CEF3: CEF scales output when per-monitor dpi awareness (Win8.1) mode set #1359

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run Win8.1
2. Compile cefclient with pmdpi.manifest (attached)
3. Run cefclient

What is the expected output? What do you see instead?
cefclient do some scaling so webpage is bigger and right and bottom part is cut.
Offscreen rendering works fine in any mode.

What version of the product are you using? On what operating system?
cef_binary_3.2078.1808_windows32 (from cefbuilds)
Win8.1
MSI GS60 2PE laptop
Built-in 1920x1080 15" screen
External 1920x1080 23" screen
See DPI configuration in attached screen shot (screenconfig.jpg, sorry it is in 
Russian). You just need to right-click at Desktop and choose Personalization, 
then click at Screen on left side.

Please provide any additional information below.
I seen this bug 1 month ago when tried to integrate new cef build into our 
application (cef_binary_3.2042.1752_windows32). This issue still happens in 
absolute latest - cef_binary_3.2078.1808_windows32. However, there was no 
issues in older versions.

Windows 8.1 introduces new virtualization technology. So when you have 2 
monitors with different DPI - OS scales window of not dpi aware applications so 
window looks same on both monitors. Window still have same client area size and 
works with virtual coordinates and there usually no issues except in cases when 
you trying to send coordinates from one process to another. When application is 
per-monitor dpi aware, then it works with physical coordinates and I suppose it 
receives dpi change event so it can scale window. You can read current dpi 
awareness mode with  GetProcessDpiAwareness function. Attached manifest turns 
on Process_Per_Monitor_DPI_Aware mode.

We have many issues with this virtualization technology because our application 
works with other applications. So we use per-monitor dpi awareness mode in our 
application instead.

Original issue reported on code.google.com by v...@splitmedialabs.com on 22 Aug 2014 at 4:15

Attachments:

GoogleCodeExporter commented 9 years ago
How does it behave in Google Chrome?

Original comment by czarek.t...@gmail.com on 22 Aug 2014 at 5:44

GoogleCodeExporter commented 9 years ago
Chrome Canary works ok. But it works in not dpi aware mode. cefclient also 
works fine in this mode. I created chrome.exe.manifest file in chrome.exe 
folder but it was not applied so I can not test chrome in per-monitor dpi aware 
mode.

Original comment by v...@splitmedialabs.com on 22 Aug 2014 at 6:21

GoogleCodeExporter commented 9 years ago
Google Chrome uses PROCESS_SYSTEM_DPI_AWARE option when setting DPI awareness 
(based on registry settings). The other option PROCESS_PER_MONITOR_DPI_AWARE 
does not seem to be used, see:

http://src.chromium.org/svn/trunk/src/ui/gfx/win/dpi.cc

Original comment by czarek.t...@gmail.com on 22 Aug 2014 at 7:31

GoogleCodeExporter commented 9 years ago
When I move Google Chrome browser window between monitors - OS changes it's 
size so it have similar physical size but bigger size in pixels. So I think 
only Per-monitor DPI aware mode works differently and do not change window size.

It is interesting that older CEF3 releases do not have this reported issue. 
This starts to happen after update to latest. Maybe there some special 
coordinate transformations was added and you need to avoid this when 
Per-monitor DPI aware mode detected, or maybe need to use 
PhysicalToLogicalPointForPerMonitorDPI/LogicalToPhysicalPointForPerMonitorDPI 
instead of PhysicalToLogicalPoint/LogicalToPhysicalPoint since last no more 
works in Win8.1.

FYI:
In Windows 8, system–DPI aware applications translate between physical and 
logical space using PhysicalToLogicalPoint and LogicalToPhysicalPoint. In 
Windows 8.1, the additional virtualization of the system and inter-process 
communications means that for the majority of applications, you do not need 
these APIs. As a result, in Windows 8.1, PhysicalToLogicalPoint and 
LogicalToPhysicalPoint no longer transform points. The system returns all 
points to an application in its own coordinate space. This behavior preserves 
functionality for the majority of applications, but there are some exceptions 
in which you must make changes to ensure that the application works as 
expected. In those cases, use PhysicalToLogicalPointForPerMonitorDPI and 
LogicalToPhysicalPointForPerMonitorDPI.

Original comment by v...@splitmedialabs.com on 22 Aug 2014 at 8:57

GoogleCodeExporter commented 9 years ago
The problem seems even much more general on Windows 7, with or without 
dpi-awareness setting in manifest the latest CEF client scales output on 
Windows 7 OS. 

http://321.tv/v?d2422b832b9fd14ec3ac1649c0789d17.flv

I'm not really sure if we need to change or add to issue description or create 
a new issue. But it's probably the same fundamental problem and it looks pretty 
critical.

Original comment by a...@splitmedialabs.com on 27 Aug 2014 at 2:25

GoogleCodeExporter commented 9 years ago
This is a known issue with Chromium 37 (https://crbug.com/395425). Try passing 
`--high-dpi-support=1 --force-device-scale-factor=1` command-line flags.

Original comment by magreenb...@gmail.com on 28 Aug 2014 at 2:53

GoogleCodeExporter commented 9 years ago
Thanks a lot! This is very helpful.

Original comment by a...@splitmedialabs.com on 29 Aug 2014 at 12:08

GoogleCodeExporter commented 9 years ago
CEF is transitioning from Google Code to Bitbucket project hosting. If you 
would like to continue receiving notifications on this issue please add 
yourself as a Watcher at the new location: 
https://bitbucket.org/chromiumembedded/cef/issue/1359

Original comment by magreenb...@gmail.com on 14 Mar 2015 at 3:32