Skip to content

Commit c64103d

Browse files
authored
[NTUSER] Fix SPI_SETFONTSMOOTHING behavior (reactos#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.
1 parent 28ae9fb commit c64103d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

win32ss/user/ntuser/sysparams.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,10 +1404,10 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
14041404
return SpiGetInt(pvParam, &gspv.bFontSmoothing, fl);
14051405

14061406
case SPI_SETFONTSMOOTHING:
1407-
gspv.bFontSmoothing = (uiParam == 2);
1407+
gspv.bFontSmoothing = !!uiParam;
14081408
if (fl & SPIF_UPDATEINIFILE)
14091409
{
1410-
SpiStoreSz(KEY_DESKTOP, VAL_FONTSMOOTHING, (uiParam == 2) ? L"2" : L"0");
1410+
SpiStoreSzInt(KEY_DESKTOP, VAL_FONTSMOOTHING, gspv.bFontSmoothing ? 2 : 0);
14111411
}
14121412
return (UINT_PTR)KEY_DESKTOP;
14131413

0 commit comments

Comments
 (0)