[NTUSER] Fix SPI_SETFONTSMOOTHING behavior (#5526)

CORE-19092

Fixes the behavior of the SPI_SETFONTSMOOTHING system parameter. This also
fixes a bug when trying to select "Use the following method to smooth edges
of screen fonts" in desk.cpl.

Instead of checking if uiParam is equal to two, treat uiParam as a Boolean
that sets font smoothing on or off. This is the correct behavior according
to Microsoft documentation.
Use SpiStoreSzInt method instead of SpiStoreSz to store the value in the registry.
This commit is contained in:
Carl J. Bialorucki 2023-08-10 09:10:51 -06:00 committed by GitHub
parent 28ae9fb738
commit c64103d55f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1404,10 +1404,10 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
return SpiGetInt(pvParam, &gspv.bFontSmoothing, fl);
case SPI_SETFONTSMOOTHING:
gspv.bFontSmoothing = (uiParam == 2);
gspv.bFontSmoothing = !!uiParam;
if (fl & SPIF_UPDATEINIFILE)
{
SpiStoreSz(KEY_DESKTOP, VAL_FONTSMOOTHING, (uiParam == 2) ? L"2" : L"0");
SpiStoreSzInt(KEY_DESKTOP, VAL_FONTSMOOTHING, gspv.bFontSmoothing ? 2 : 0);
}
return (UINT_PTR)KEY_DESKTOP;