On Sun, 15 Dec 2024 20:26:22 GMT, Thiago Milczarek Sayao <tsa...@openjdk.org> 
wrote:

>> This option sets if editing happens on the application or in the IME window.
>> 
>> Application:
>> ![image](https://github.com/user-attachments/assets/d44364ad-4090-4e1d-9fcf-5fa7fbd8a306)
>> 
>> 
>> IME Window:
>> ![image](https://github.com/user-attachments/assets/692536bf-e8d2-467d-9332-0a6f04f1eb9a)
>
> 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.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1080#discussion_r1885860305

Reply via email to