https://bugs.winehq.org/show_bug.cgi?id=54988
Bug ID: 54988 Summary: Final Fantasy XIV: Japanese IME behavior incorrect Product: Wine Version: 8.9 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winex11.drv Assignee: wine-bugs@winehq.org Reporter: achurch+wine@achurch.org Regression SHA1: d9fc3eab9a4ae39c94fa484d65679de22d02e75a Distribution: ---
Final Fantasy XIV: Japanese IME behavior incorrect
As of Wine 8.8, when using a Japanese input method editor (IME), the IME is no longer disabled in cases where it should be, such as the following:
1) Log in to Final Fantasy XIV (get in-game). 2) Click on the chat input bar to enter text entry mode. 3) Enable the Japanese IME (so that Japanese text can be typed). 4) With the IME active, press Enter to leave text entry mode.
Expected behavior: The IME is disabled, so that keyboard controls (WASD etc.) are properly recognized.
Observed behavior: The IME remains enabled, preventing keyboard controls from working until the user disables the IME manually.
This is a regression from Wine 8.7; git bisect identifies d9fc3eab9a4ae39c94fa484d65679de22d02e75a as introducing the regression.
https://bugs.winehq.org/show_bug.cgi?id=54988
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression CC| |rbernon@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=54988
--- Comment #1 from Rémi Bernon rbernon@codeweavers.com --- Hi, could you tell me which IME engine you are using?
https://bugs.winehq.org/show_bug.cgi?id=54988
--- Comment #2 from Andrew Church achurch+wine@achurch.org --- ATOK X3.
https://bugs.winehq.org/show_bug.cgi?id=54988
--- Comment #3 from Rémi Bernon rbernon@codeweavers.com --- Created attachment 74538 --> https://bugs.winehq.org/attachment.cgi?id=74538 patch
Okay, well I'd need more detail with how to get and install it, if you don't mind, because it looks like it's behaving specifically.
I tried with ibus and fcitx and I didn't see any difference in behavior. Both are broken, when IME composition is enabled, as they always filter key presses and translate them into IME composition.
Key events are translated to game input only when direct input mode (or non-japanese IME) is used.
The game is never actively enabling or disabling IME, at least not on the imm level -but I think it tries to use the newer msctf API, which is only stubbed- and all it does it call ImmNotifyIME NI_CLOSECANDIDATE (which never did anything), then ImmNotifyIME NI_COMPOSITIONSTR / CPS_COMPLETE when chat box is exited.
The latter indeed slightly changed in behavior in this commit, so I'm thinking that your IME might be automatically resetting itself to direct input whenever XmbResetIC is called.
I'm attaching a patch that may have an impact on this, could you check whether it helps?
https://bugs.winehq.org/show_bug.cgi?id=54988
--- Comment #4 from Rémi Bernon rbernon@codeweavers.com --- s/CPS_COMPLETE/CPS_CANCEL/
https://bugs.winehq.org/show_bug.cgi?id=54988
--- Comment #5 from Andrew Church achurch+wine@achurch.org --- Unfortunately the Linux version of ATOK is no longer available (and hasn't been for several years, which is unfortunate because it's still better quality than all the other Japanese IMEs I've tried...) but I'll give the patch a try and let you know. I can also investigate further on my side, but I have zero knowledge about the Windows IME API so it'll take time to get up to speed.
https://bugs.winehq.org/show_bug.cgi?id=54988
--- Comment #6 from Andrew Church achurch+wine@achurch.org --- The patch seems to fix the bug, but it introduces a different one in which the IME is active on startup and I have to manually deactivate it for direct keyboard input - the launcher starts in Japanese input mode when I try entering my username, and the game doesn't accept keyboard input at all until I click on and then off of a text entry field (at which point I can can then toggle the IME off, and after that things work fine).
I will note that git HEAD fixes a couple other bugs I'd had with input: cursor movement in text fields didn't work in certain cases after toggling off the IME, and if a text field lost focus while preedit text was displayed, then that text would subsequently be displayed along with the current preedit string while entering Japanese text (but not sent to the program on commit) until the game was closed.
https://bugs.winehq.org/show_bug.cgi?id=54988
--- Comment #7 from Andrew Church achurch+wine@achurch.org --- As an additional observation, it seems the preedit_done callback is never called at all in my environment, and thus the NtPostUserMessage(...,FALSE) call added in the patch has no effect; this could certainly be an issue specific to ATOK. Despite this, the NtPostUserMessage(...,TRUE) call in the preedit_start callback is enough to trigger correct behavior, aside from the IME incorrectly starting active.
I was able to obtain completely correct behavior by commenting out the "if (status != ctx->fOpen)" test in imm32/imm.c:ImmSetOpenStatus() and making that block execute unconditionally. I assume ctx->fOpen is intended to reflect the current IME state, so perhaps that's not getting properly updated under some condition? (Again, I have no background knowledge on imm32 and this is just throwing things at the wall to see what sticks.)
Also just for the record, the issue can be checked without logging into a character by going to the settings menu from the title screen, clicking the Other Settings -> Screenshot Folder -> Change Folder button, and typing in the text field that pops up.