When drawing windows on monitors that differ in DPI, we can sometimes
have UI elements draw at an incorrect scale. This patch just ensures
that wm_window_make_drawable always updates DPI.
This bug is not seen often, but the following bug report has a good reproducible way to see it in action: https://developer.blender.org/T85706
When drawing windows we only have a single place that stores all the current metrics for user scale, monitor dpi, font sizes, etc. Obviously we then have to frequently update this information when there are multiple monitors that differ in DPI. Unfortunately most of the times we do this are unnecessary because we don't actually draw immediately afterward. Instead we draw at regular intervals, checking then to see which areas are in need of drawing. And at that time it is also necessary to do the same checks between monitor draws, making the prior values moot.
In this particular example, we are changing the workspace, which triggers each monitor to update these settings (in Userprefs), one at a time. The last one had higher dpi. And all were tagged with a need to be redrawn.
At drawing time we go through each monitor and again have to check dpi between each one. But there is one flaw. At this time the first monitor is currently the active and drawable one. We call wm_window_make_drawable() and it decides that because the monitor is already the "windrawable" it does not need to check dpi. And so it draws it out with the incorrect sizes.
This patch just makes it so that wm_window_make_drawable() always checks for dpi. But, as mentioned, this thing always needs to be called between window draws anyway and is in almost every case.