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

Fix DpiAware.GetSystemDpi and expose DpiAware.Scale #398

Closed
cztomczak opened this issue Oct 1, 2017 · 1 comment
Closed

Fix DpiAware.GetSystemDpi and expose DpiAware.Scale #398

cztomczak opened this issue Oct 1, 2017 · 1 comment
Labels
Milestone

Comments

@cztomczak
Copy link
Owner

cztomczak commented Oct 1, 2017

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

@cztomczak cztomczak added this to the v66 milestone May 22, 2018
@cztomczak cztomczak changed the title DpiAware.GetSystemDpi and CalculateWindowSize throw error: tuple() takes at most 1 argument (2 given) Fix DpiAware.GetSystemDpi and expose DpiAware.Scale Aug 16, 2018
cztomczak added a commit that referenced this issue Aug 16, 2018
)

Fix DpiAware.GetSystemDpi, CalculateWindowSize (deprecated now).
Add DpiAware.Scale.
@cztomczak
Copy link
Owner Author

Done in rev e6bcf2c.

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

1 participant