Skip to content

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

Closed

Description

@cztomczak

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

Activity

  1. added this to the v58 milestone on Apr 25, 2017
  2. changed the title [-]Re-test High DPI support in latest CEF[/-] [+]Re-test High DPI support on Windows in latest CEF[/+] on Apr 25, 2017
  3. removed this from the v58 milestone on Sep 20, 2017
  4. changed the title [-]Re-test High DPI support on Windows in latest CEF[/-] [+]Issues with High DPI support in latest CEF on Windows[/+] on Sep 20, 2017
  5. cztomczak commented on Sep 20, 2017

    @cztomczak
    OwnerAuthor

    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.

  6. cztomczak commented on Sep 22, 2017

    @cztomczak
    OwnerAuthor

    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.

  7. added this to the v57 milestone on Sep 22, 2017
  8. cormacc commented on Mar 26, 2019

    @cormacc

    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.

  9. cztomczak commented on Mar 26, 2019

    @cztomczak
    OwnerAuthor

    @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.

  10. cormacc commented on Mar 26, 2019

    @cormacc

    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

  11. cztomczak commented on Mar 26, 2019

    @cztomczak
    OwnerAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions