winecfg: Don't convert font height to points when saving system font metrics.
commit5cebefc24fe9dd944fd8656fd1b160d51bf7ec80
authorZhiyi Zhang <zzhang@codeweavers.com>
Fri, 2 Jul 2021 03:38:31 +0000 (2 11:38 +0800)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 2 Jul 2021 10:39:12 +0000 (2 12:39 +0200)
treec794bc1be80d7b5a62f411f9149d656f2b74fd58
parentfe257dde58f03fe1fc9705caf24edbe16df7a1cd
winecfg: Don't convert font height to points when saving system font metrics.

Fix tooltip font size becomes smaller after clicking the apply button in Desktop Integration tab.
For example, the original non-client area tooltip font lfHeight is -11. 11 pixels is 8 points in 96
DPI. Setting font size to 8 points to SPI_SETNONCLIENTMETRICS will make SPI_GETNONCLIENTMETRICS
report lfHeight as 8. With lfHeight being 8, CreateFontIndirectW() creates a smaller font. This
behavior is added by 5b8fdb9. I assume the intention was to save font size in a DPI-independent way.
However, when lfHeight is negative, lfHeight will still be scaled back to 96 DPI before saving it to
registry and scaled to system DPI when it's read from registry. So I think converting to points is
unnecessary.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
programs/winecfg/theme.c