Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with High DPI support in latest CEF on Windows #358

Closed
cztomczak opened this issue Apr 25, 2017 · 6 comments
Closed

Issues with High DPI support in latest CEF on Windows #358

cztomczak opened this issue Apr 25, 2017 · 6 comments
Labels
Milestone

Comments

@cztomczak
Copy link
Owner

High DPI was last tested by me in the v31 release. There were some changes in upstream CEF in regards to High DPI support. For example in phpdesktop it was no more required to change zoom level according to OS DPI settings.

SetProcessDpiAware code was commented out in phpdesktop:
https://github.com/cztomczak/phpdesktop/blob/c00988f69348b73b6dee27bdf45d145b719e2a3d/phpdesktop-chrome39/dpi_aware.cpp#L14

CEF Python has the same code. It needs to be checked whether this needs to be commented out as well:

void SetBrowserDpiSettings(CefRefPtr<CefBrowser> cefBrowser,

In the wxpython.py example you can see this code that enables High DPI support:

if WINDOWS:
        settings["auto_zooming"] = "system_dpi"  # High DPI support
        # noinspection PyUnresolvedReferences, PyArgumentList
        cef.DpiAware.SetProcessDpiAware()  # Alternative is to embed manifest

PHP Desktop embeds DPI aware manifest by default:
https://github.com/cztomczak/phpdesktop/blob/master/phpdesktop-chrome57/DeclareDPIAware.manifest

@cztomczak cztomczak added this to the v58 milestone Apr 25, 2017
@cztomczak cztomczak changed the title Re-test High DPI support in latest CEF Re-test High DPI support on Windows in latest CEF Apr 25, 2017
@cztomczak cztomczak added the bug label Sep 20, 2017
@cztomczak cztomczak removed this from the v58 milestone Sep 20, 2017
@cztomczak cztomczak changed the title Re-test High DPI support on Windows in latest CEF Issues with High DPI support in latest CEF on Windows Sep 20, 2017
@cztomczak
Copy link
Owner Author

cztomczak commented Sep 20, 2017

When custom scaling is set to 132% in Windows 10, calling cef.DpiAware.SetProcessDpiAware() will cause the GPU process to crash, it is then relaunched and crashes again, and so on in a loop. Changing "auto_zooming" option to either "system_dpi" or "" or other fixed values doesn't change anything, it still crashes.

cztomczak added a commit that referenced this issue Sep 22, 2017
Both main process and subprocesses are now set to be DPI aware
when cef.DpiAware.EnableHighDpiSupport function is called.

- Update docs/MigrationGuide.md document.
- Update examples/wxpython.py
- Add DpiAware.EnableHighDpiSupport function.
- Deprecate DpiAware.SetProcessDpiAware function.
- Deprecate ApplicationSettings.auto_zooming "system_dpi" value
cztomczak added a commit that referenced this issue Sep 22, 2017
Both main process and subprocesses are now set to be DPI aware
when cef.DpiAware.EnableHighDpiSupport function is called.

- Update docs/MigrationGuide.md document.
- Update examples/wxpython.py
- Add DpiAware.EnableHighDpiSupport function.
- Deprecate DpiAware.SetProcessDpiAware function.
- Deprecate ApplicationSettings.auto_zooming "system_dpi" value
@cztomczak
Copy link
Owner Author

Fixed in cefpython57 branch in commit 331bfb5 and in master branch in commit ebdb184.

See Migration Guide document for new changes:
https://github.com/cztomczak/cefpython/blob/master/docs/Migration-guide.md#v571-high-dpi-support-on-windows

Both main process and subprocesses are now set to be DPI aware when cef.DpiAware.EnableHighDpiSupport function is called.

Updated wxpython.py example.

@cztomczak cztomczak added this to the v57 milestone Sep 22, 2017
@cormacc
Copy link

cormacc commented Mar 26, 2019

Hi - not sure whether to post here or create a new issues, but appear to be encountering a regression in relation to this on cefpython3 66 / Windows 10 / 4k screen
Specifically the problem described here in relation to r57, with an unscaled version of the window inlaid/overlaid on the scaled version:
https://magpcss.org/ceforum/viewtopic.php?f=6&t=13659

I'm packaging a flask/dash app -- was initially using cefpython3 directly with a window launcher based on the pywin32 example, but now using it via pywebview instead. The problem is evident using either approach.

@cztomczak
Copy link
Owner Author

@cormacc Does the issue reproduce with the original wxpython.py example? https://github.com/cztomczak/cefpython/blob/master/examples/wxpython.py

It's best to report problems on the forum.

@cormacc
Copy link

cormacc commented Mar 26, 2019

I'm afraid it does. Steps taken to reproduce below, but I'll duplicate them in that forum thread. Or would you prefer I post under a new topic?

Steps to reproduce:

Laptop is fairly mainstream -- a Thinkpad T580 with the high def screen option, running Windows 10 Pro

@cztomczak
Copy link
Owner Author

@cormacc This is issue tracker. Please create a topic on the forum so we can discuss your problem further. Provide more details on your issue. In the referenced CEF topic the reporter said his issue was resolved by adding DPI awareness manifest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants