A more complete fix to per-monitor DPI issues #326
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#321
This now covers all cases that I can find. There are still issues if the application does not declare per-monitor DPI awareness and the docking host window is split over two monitors with different DPIs, but these existed already, and I don't think it is possible to solve that sort of issue without being per monitor DPI aware.
A number of changes are needed, largely taking into account the fact that a floating window can have a different DPI to the main docking window in a per-monitor DPI aware application:
I have tested on Win10 (21H1) with the TestApp set to each of
*PerMonitor V2 DPI Awareness
*PerMonitor DPI Awareness
*System DPI Awareness
*No DPI Awareness
The first two seem to work correctly in all cases (docking window on high DPI, floating on low, vice versa, docking window split across high and low, floating on either high or low). The last two still have issues, but the same issues are seen with the code before my changes.
Win8 and earlier did not have per-monitor DPI, so any changes made here should have no effect on them (because the DPI would always be the same for all windows).