You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scaling issues with PyQt5 when using mixed resolution displays #8061
I have a set-up where I have a retina MBP (bottom) plugged in to a non-retina display (top).
Normally Matplotlib looks fine on retina or non-retina displays when used separately, but in the case of mixed resolutions, the fonts and the elements of the figure appear too large on the non-retina display. The following image sequence shows a matplotlib window that was created on the retina display and is then moved to the non-retina display. The same issue happens if I create the figure in the non-retina display to start with, so this is not about moving from one to the other.
I then click in the bottom right to resize the window:
Note that this also causes issues when just showing a plot on the lower-res screen that is attached to a retina screen laptop (the fonts are two times too large and lines two times too thick) - that is, without even changing screen. I think this is something to do with the fact that the DPI device ratio is declared to be 1 for the low-res screen. If I force _dpi_ratio to return 2 then the scaling looks correct on the low-res screen (but the mouse events are then wrong...). Can people test what the behavior is like on other OSes with mixed-resolution screens?
Activity
tacaswell commentedon Feb 10, 2017
Does Qt provide a signal we can hook into when the window changes screens (and hence the dpi scaling)?
astrofrog commentedon Feb 10, 2017
Looks like the easiest way is to look for screenChanged then in there check if devicePixelRatio changes:
https://forum.qt.io/topic/52296/detect-changing-devicepixelratio/4
astrofrog commentedon May 5, 2017
Note that this also causes issues when just showing a plot on the lower-res screen that is attached to a retina screen laptop (the fonts are two times too large and lines two times too thick) - that is, without even changing screen. I think this is something to do with the fact that the DPI device ratio is declared to be 1 for the low-res screen. If I force
_dpi_ratioto return2then the scaling looks correct on the low-res screen (but the mouse events are then wrong...). Can people test what the behavior is like on other OSes with mixed-resolution screens?astrofrog commentedon May 5, 2017
@QuLogic - do you have any ideas since you've worked on the DPI ratio stuff before?
tacaswell commentedon May 7, 2017
@astrofrog can you check with v2.0.1?
astrofrog commentedon May 8, 2017
@tacaswell - this is still an issue with 2.0.1 unfortunately
efiring commentedon May 8, 2017
It looks like you identified at least part of the machinery we need to add (screenChanged, etc.); any chance you can have a go at implementing it?
astrofrog commentedon Jul 24, 2017
All right, I'm going to take a look at this today. This has been bugging me for a while. Wish me luck.
burnpanck commentedon Aug 18, 2017
This bug report here describes two problems:
#8931 only fixes the first of the two issues. Should this bug report be reopened or a separate one be created?
tacaswell commentedon Aug 18, 2017
@burnpanck Can you make a new issue for the second?