This adds a series of patches related to https://bugreports.qt.io/browse/QTBUG-53022 for Windows to allow enabling experimental support for fractional DPI scaling.
In addition, a patch to fix https://bugreports.qt.io/browse/QTBUG-72504 (which is set to be in Qt 5.12.3) is included..
The exact list of patches is as follow:
- https://codereview.qt-project.org/248822
- https://codereview.qt-project.org/157173
- https://codereview.qt-project.org/157174
- https://codereview.qt-project.org/161334
- https://codereview.qt-project.org/163219
- https://codereview.qt-project.org/176381
- https://codereview.qt-project.org/209886
These series of patches adds the option `QGuiApplication::setHighDpiScaleFactorRoundingPolicy` to control how the DPI scale factor is rounded (or not), which can also be overridden by the environment variable `QT_SCALE_FACTOR_ROUNDING_POLICY`. The options include:
- Round: Round up for .5 and above.
- Ceil: Always round up.
- Floor: Always round down.
- RoundPreferFloor: Round up for .75 and above.
- PassThrough: Don't round.
Currently the default option is explicitly set to `Round` to obtain the old behaviour (where 1.5x is rounded to 2x). Though we can consider switching the behaviour to `RoundPreferFloor` (where 1.5x is rounded down to 1x), since users with 1.5x scaling will tend to complain that the UI gets too large and rounding down can be a more acceptable behaviour.
The actual config option for user to enable the `PassThrough` option is to be added in a separate change.