Otherwise when the prefix was created with one locale and later an application
in the prefix is running with a different locale values cached in the registry
lead to broken UI.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/user32/tests/sysparams.c | 4 ++--
dlls/win32u/sysparams.c | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c
index e354ef69a94..6ab7010c4ed 100644
--- a/dlls/user32/tests/sysparams.c
+++ b/dlls/user32/tests/sysparams.c
@@ -4139,14 +4139,13 @@ static void test_LOGFONT_charset(void)
ret = SystemParametersInfoA(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, FALSE);
ok(ret, "SystemParametersInfoW error %lu\n", GetLastError());
- todo_wine
ok(lf.lfCharSet == DEFAULT_CHARSET, "got %d\n", lf.lfCharSet);
ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
ret = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
ok(ret, "SystemParametersInfoW error %lu\n", GetLastError());
- todo_wine
ok(ncm.lfCaptionFont.lfCharSet == DEFAULT_CHARSET, "got %d\n", ncm.lfCaptionFont.lfCharSet);
+ ok(ncm.lfSmCaptionFont.lfCharSet == DEFAULT_CHARSET, "got %d\n", ncm.lfSmCaptionFont.lfCharSet);
}
START_TEST(sysparams)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c
index 52665f7a641..879dffb58e2 100644
--- a/dlls/win32u/sysparams.c
+++ b/dlls/win32u/sysparams.c
@@ -3039,12 +3039,14 @@ static BOOL get_font_entry( union sysparam_all_entry *entry, UINT int_param, voi
switch (load_entry( &entry->hdr, &font, sizeof(font) ))
{
case sizeof(font):
+ font.lfCharSet = DEFAULT_CHARSET; /* Support locale change */
if (font.lfHeight > 0) /* positive height value means points ( inch/72 ) */
font.lfHeight = -muldiv( font.lfHeight, USER_DEFAULT_SCREEN_DPI, 72 );
entry->font.val = font;
break;
case sizeof(LOGFONT16): /* win9x-winME format */
logfont16to32( (LOGFONT16 *)&font, &entry->font.val );
+ entry->font.val.lfCharSet = DEFAULT_CHARSET; /* Support locale change */
if (entry->font.val.lfHeight > 0)
entry->font.val.lfHeight = -muldiv( entry->font.val.lfHeight, USER_DEFAULT_SCREEN_DPI, 72 );
break;
@@ -3055,6 +3057,7 @@ static BOOL get_font_entry( union sysparam_all_entry *entry, UINT int_param, voi
/* fall through */
case 0: /* use the default GUI font */
NtGdiExtGetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(font), &font );
+ font.lfCharSet = DEFAULT_CHARSET; /* Support locale change */
font.lfHeight = map_from_system_dpi( font.lfHeight );
font.lfWeight = entry->font.weight;
entry->font.val = font;
@@ -3094,6 +3097,7 @@ static BOOL set_font_entry( union sysparam_all_entry *entry, UINT int_param, voi
static BOOL init_font_entry( union sysparam_all_entry *entry )
{
NtGdiExtGetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(entry->font.val), &entry->font.val );
+ entry->font.val.lfCharSet = DEFAULT_CHARSET; /* Support locale change */
entry->font.val.lfHeight = map_from_system_dpi( entry->font.val.lfHeight );
entry->font.val.lfWeight = entry->font.weight;
get_real_fontname( &entry->font.val, entry->font.fullname );
--
2.37.2