How to get hiDPI aware popup on Windows? (DocumentWindow and similar)

Ok, so this problem seems to be related to these two: