https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c64103d55f2be9dc42f6b052abf7bc8a6c47c53b

commit c64103d55f2be9dc42f6b052abf7bc8a6c47c53b
Author:     Carl J. Bialorucki <[email protected]>
AuthorDate: Thu Aug 10 09:10:51 2023 -0600
Commit:     GitHub <[email protected]>
CommitDate: Thu Aug 10 17:10:51 2023 +0200

    [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.
---
 win32ss/user/ntuser/sysparams.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/win32ss/user/ntuser/sysparams.c b/win32ss/user/ntuser/sysparams.c
index 47349cedd37..552a63e1f6a 100644
--- a/win32ss/user/ntuser/sysparams.c
+++ b/win32ss/user/ntuser/sysparams.c
@@ -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;
 

Reply via email to