Skip to content

Fix DpiAware.GetSystemDpi and expose DpiAware.Scale #398

@cztomczak

Description

@cztomczak

DpiAware.GetSystemDpi error

Error:

File "dpi_aware_win.pyx", line 26, in cefpython_py27.DpiAware.GetSystemDpi
TypeError: tuple() takes at most 1 argument (2 given)

Source code:

return tuple(dpix, dpiy)

This should replaced with:

return (dpix, dpiy)

Temporarily you could use pywin32/ctypes extensions to get system dpi settings, this would require translating this C++ code to a Python equivalent:

void GetSystemDpi(int* dpix, int* dpiy) {

Issue #399 is blocked by this issue.

Expose DpiAware.Scale

Additionally, it should be fixed how CalculateWindowSize behaves. Currently it only allows for sizes that are factor of 0.25 when scaling (1.0, 1.25, 1.5, etc). In Windows 10 you can set custom scaling to for example "132%" and it should scale window size exactly by 132%.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions