[PATCH 0/4] MR10913: Various IME fixes for FFXIV
These are small fixes that make sure that FFXIV correctly sees the current input source as IME capable, so the game will display an IME icon next to its chat box (IME input actually working is independent of this). On macOS, there is no such concept as open or closed IME. Whenever an IME keyboard layout is active, we should open/close the IME that is currently active. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10913
From: Marc-Aurel Zent <mzent@codeweavers.com> --- dlls/winemac.drv/keyboard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index 8cf203c9fb8..38bb2a7ad69 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -1179,6 +1179,8 @@ BOOL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags) TRACE("hkl %p flags %04x\n", hkl, flags); + NtUserPostMessage( NULL, WM_WINE_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, is_ime_hkl(hkl) ); + if (hkl == thread_data->active_keyboard_layout) return TRUE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10913
From: Marc-Aurel Zent <mzent@codeweavers.com> --- dlls/imm32/ime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/imm32/ime.c b/dlls/imm32/ime.c index c4d71856e68..3cf7c1ed00a 100644 --- a/dlls/imm32/ime.c +++ b/dlls/imm32/ime.c @@ -419,7 +419,7 @@ static UINT ime_set_comp_string( HIMC himc, LPARAM lparam ) static LRESULT ime_ui_notify( HIMC himc, HWND hwnd, WPARAM wparam, LPARAM lparam ) { - TRACE( "himc %p, hwnd %p, wparam %s, lparam %#Ix\n", hwnd, himc, debugstr_imn(wparam), lparam ); + TRACE( "himc %p, hwnd %p, wparam %s, lparam %#Ix\n", himc, hwnd, debugstr_imn(wparam), lparam ); switch (wparam) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10913
From: Marc-Aurel Zent <mzent@codeweavers.com> --- dlls/imm32/imm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 0b2814da2cb..f05f2d772a3 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -718,6 +718,7 @@ static void input_context_init( INPUTCONTEXT *ctx ) COMPOSITIONSTRING *str; CANDIDATEINFO *info; GUIDELINE *line; + struct ime *ime; UINT i; if (!(ctx->hMsgBuf = ImmCreateIMCC( 0 ))) @@ -755,6 +756,13 @@ static void input_context_init( INPUTCONTEXT *ctx ) for (i = 0; i < ARRAY_SIZE(ctx->cfCandForm); i++) ctx->cfCandForm[i].dwIndex = ~0u; + + if ((ime = ime_acquire( GetKeyboardLayout( 0 ) ))) + { + ctx->fdwConversion = ime->info.fdwConversionCaps; + ctx->fdwSentence = ime->info.fdwSentenceCaps; + ime_release( ime ); + } } static void IMM_FreeThreadData(void) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10913
From: Marc-Aurel Zent <mzent@codeweavers.com> --- dlls/imm32/imm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index f05f2d772a3..73f0009f15d 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -603,6 +603,8 @@ static void ime_save_input_context( struct ime *ime, HIMC himc, INPUTCONTEXT *ct ctx->hCompStr = old.hCompStr; ctx->hCandInfo = old.hCandInfo; ctx->hGuideLine = old.hGuideLine; + ctx->fdwConversion = old.fdwConversion; + ctx->fdwSentence = old.fdwSentence; if (!(ctx->hPrivate = ImmCreateIMCC( ime->info.dwPrivateDataSize ))) WARN( "Failed to allocate IME private data\n" ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10913
Rémi Bernon (@rbernon) commented about dlls/imm32/imm.c:
for (i = 0; i < ARRAY_SIZE(ctx->cfCandForm); i++) ctx->cfCandForm[i].dwIndex = ~0u; + + if ((ime = ime_acquire( GetKeyboardLayout( 0 ) ))) + { + ctx->fdwConversion = ime->info.fdwConversionCaps; + ctx->fdwSentence = ime->info.fdwSentenceCaps; + ime_release( ime ); + }
Could we have tests for this and the next one? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10913#note_140004
Rémi Bernon (@rbernon) commented about dlls/winemac.drv/keyboard.c:
TRACE("hkl %p flags %04x\n", hkl, flags);
+ NtUserPostMessage( NULL, WM_WINE_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, is_ime_hkl(hkl) );
Not sure but doesn't open status denote whether the composition window is opened? Shouldn't this rather happen once we have started feeding keys to the IME? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10913#note_140005
participants (3)
-
Marc-Aurel Zent -
Marc-Aurel Zent (@mzent) -
Rémi Bernon (@rbernon)