Hello @Matthew_Newville Thank you for taking the time to read through the PR and replying.
Background
For understanding current wx support for building applications that display sharply in high resolution displays you may read: wxWidgets: High DPI Support in wxWidgets There you will find a reference to platform specific issues. In particular in the section for MSW you will be pointed to this document: High DPI Desktop Application Development on Windows - Win32 apps | Microsoft Learn.
This MS documentation above explains that what level of high resolution display support an application gets on MSW is specified by the application itself. In particular it specifies whether the O/S should scale up images and fonts, etc. by zooming, thus blurring them, or whether the application code will do it by drawing them with more pixels, by thus keeping them sharp. If scaling is not done, the images appear sharp, but very small because the pixels in high resolution displays are smaller than “regular” so anything using the same number of pixels as in lower resolution displays will appear small and not easy to see.
When a wx application displays on a high resolution display, it is the responsibility of the application developer that all custom (non-wx rendered) widget is drawn taking into account the display resolution. For legacy applications that don’t do this. It is best to let the O/S do the scaling for all the widgets, at the expense of some blur. Else some windows will be scaled and some others won’t, which will change the relative sizes of widows with respect to the intended layout and the UI will be very bad looking.
The previous two paragraphs are not relevant to non-MSW platforms as in those the O/S performs scaling per widget not per application.
What this PR does
The PR refenerenced enhances the matplotlib wx backend so that matplotlib figures drawn using the wx backend display sharply in high resolution monitors and at the expected physical size. The PR adds support for this behavior in Windows, Mac and GTK. Without this PR matplotlib figures drawn using the wx backend on high resolution displays will look either too small or the right size but blurry.
What my original question was
The original question was whether matplotlib or end user code should tell the O/S whether for the whole application, user code would do the scaling or whether the O/S should do the scaling. As discussed above this is only done in MSW since the scaling setting on MAC and GTK is per widget.
If all custom widgets are matplotlib figures (which is the case when using wxAgg
rather than embedding figures in a wx application) then, with this PR, they will all have support for displaying sharply and at the correct size, and matplotlib could tell the O/S that end user code will do the scaling. But when embedding matplotlib figures in an application, the user needs to update their custom widgets before telling this to the O/S. So it should be user code that notifies the O/S of the desired dpi support.
We have figured out a way to distinguish the two cases, so the question has already been answered (Add support for High DPI displays to wxAgg backend by jmoraleda · Pull Request #26710 · matplotlib/matplotlib · GitHub)
Even though the question has already been answered, I figured that this longer explanation might provide a service to the community.