On Sun, 15 Dec 2024 20:57:14 GMT, Martin Fox <m...@openjdk.org> wrote:
>> I modified it to no longer rely on pre-edit calls, but I'm not sure if it's >> working as expected yet. > > When fcitx is configured this way we never receive pre-editing signals AND > we're not filtering a key event when the commit comes in. The best way to > test this is to use the mouse to click on a choice in the IM window. You'll > see a commit arrive even though no key was pressed (which is expected) and no > pre-edit signals were sent (which is unexpected). > > On the one hand according to the GTK documentation this set of conditions > should never happen. On the other hand this is Linux. > > I'll look at this code in more detail but I think you're comparing the commit > text with the keyval of the previous key event which may be unrelated. The > simplest solution is to add a flag that's only set while a key event is being > filtered. If a commit message arrives during pre-edit OR when no key event is > being filtered it should be processed as an InputMethod event. I did a quick > test of this logic and it seems to work but I did very little testing. I reverted and did the way @beldenfox explained above. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1080#discussion_r1885902898