Skip to content

win: native: Scaling factor is incorrect on external monitor after coming back from hibernate #4054

@antal-foldi-work

Description

@antal-foldi-work

Describe the bug
When using a laptop connected to an external monitor with different display scaling factors, content is rendered with the wrong scale after resuming Windows from hibernate.
This issue occurs specifically when Win+P -> Second screen only is enabled before hibernation.

To Reproduce
Setup:
Laptop with an external monitor where the two displays use different scale values (e.g., built-in display at 250%, external monitor at 150%).

Steps to reproduce the behavior:

  1. Enable Win+P -> Second screen only
  2. Run cefclient.exe --use-native, and navigate to any website
  3. Hibernate Windows (you may need to configure the power button to hibernate)
  4. Turn off the external monitor
  5. Resume Windows and log in
  6. Turn the external monitor back on

Expected behavior
After the external monitor is turned back on, the cefclient window is moved to that display and should adopt the correct scale factor for that monitor. The rendered content should appear at the proper size.
Currently the content is rendered incorrectly, it still appears scaled according to the built-in display's scale instead of the external monitor’s scale.

Screenshots
Current behavior:
Image

Expected behavior:
Image

Versions (please complete the following information):

  • OS: Windows 11
  • CEF Version: 143.0.9

Additional context
The problem does not reproduce when running cefclient without --use-native.
To fix the content scaling, the window needs to be resized. Just moving the window around doesn't fix the scaling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug reportnativeRelated to a native (non-Views) frameworkwindowsWindows platform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions