[COMCTL32][USER32] EDIT: WM_SETFONT for IME (#5214)

- Call ImmSetCompositionFontW in WM_SETFONT handling of EDIT controls if necessary.
- If the specified font is NULL, then use DEFAULT_GUI_FONT.
CORE-11700
This commit is contained in:
Katayama Hirofumi MZ 2023-04-04 19:09:21 +09:00 committed by GitHub
parent d0c657074d
commit 2b356adbc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View file

@ -3766,6 +3766,18 @@ static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw)
es->flags & EF_AFTER_WRAP);
ShowCaret(es->hwndSelf);
}
#ifdef __REACTOS__
if (ImmIsIME(GetKeyboardLayout(0)))
{
LOGFONTW lf;
HIMC hIMC = ImmGetContext(es->hwndSelf);
if (font == NULL)
font = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
GetObjectW(font, sizeof(lf), &lf);
ImmSetCompositionFontW(hIMC, &lf);
ImmReleaseContext(es->hwndSelf, hIMC);
}
#endif
}

View file

@ -53,6 +53,8 @@
#define ImmLockIMC IMM_FN(ImmLockIMC)
#define ImmUnlockIMC IMM_FN(ImmUnlockIMC)
#define ImmNotifyIME IMM_FN(ImmNotifyIME)
#define ImmIsIME IMM_FN(ImmIsIME)
#define ImmSetCompositionFontW IMM_FN(ImmSetCompositionFontW)
#endif
WINE_DEFAULT_DEBUG_CHANNEL(edit);
@ -3972,6 +3974,18 @@ static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw)
es->flags & EF_AFTER_WRAP);
ShowCaret(es->hwndSelf);
}
#ifdef __REACTOS__
if (ImmIsIME(GetKeyboardLayout(0)))
{
LOGFONTW lf;
HIMC hIMC = ImmGetContext(es->hwndSelf);
if (font == NULL)
font = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
GetObjectW(font, sizeof(lf), &lf);
ImmSetCompositionFontW(hIMC, &lf);
ImmReleaseContext(es->hwndSelf, hIMC);
}
#endif
}