-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Only set Tk scaling-on-map for Windows systems #22898
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
Conversation
Oops, I reversed the title... |
On Windows, the DPI that Tk sees is 96 for regular screens and some multiple of that for HiDPI screens. On Linux, the DPI is the true DPI (or at least what the display server tells it is true), and doesn't have anything to do with HiDPI. On macOS, the DPI appears closer to 72 by default.
I get 1.0005 for my external monitor and 0.9994 for my HiDPI retina screen. Maybe the HiDPI comes from somewhere else? |
OK, that's good to know. I think it makes sense to disable this scaling on macOS then. We were currently doing effectively 1.005 / 1.33 (which is 96/72 from Windows), meaning we'd be underscaling macOS. I think for HiDPI on macOS, I'll have to somehow link up with the same code in the macosx ObjC side, in a similar manner to Windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still works on my hi/lo dpi Windows setup!
@meeseeksdev backport to v3.5.x |
…898-on-v3.5.x Backport PR #22898 on branch v3.5.x (Only set Tk scaling-on-map for Windows systems)
PR Summary
On Windows, the DPI that Tk sees is 96 for regular screens and some multiple of that for HiDPI screens.
On Linux, the DPI is the true DPI (or at least what the display server tells it is true), and doesn't have anything to do with HiDPI.
On macOS, the DPI appears closer to 72 by default. If anyone with a retina screen could check what the value of
self._tkcanvas.tk.call('tk', 'scaling')
is inFigureCanvasTk._update_device_pixel_ratio
, then perhaps we could enable HiDPI-on-startup there, at least.PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).