Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
TBH, this seems to be a compositor bug that should be fixed on hyprland side. I'm not really against the change though, because it seems to be align with what I do in kwin. |
|
If you want to get it merged please get it out of draft so I know it's ready |
|
I did some test. I don't think this really helps. You'd better file a bug at chromium. |
certain compositor may not send done. As this the behavior that kwin implemented in v3, it should be generally safe to update current preedit on focus in. Close #1689
certain compositor may not send done. As this the behavior that kwin implemented in v3, it should be generally safe to update current preedit on focus in. Close #1689
|
Thanks for looking at this, and for #1690. I reran the same Electron 43.6.0 textarea test on Hyprland 0.56.2 with the preload workaround disabled. The textarea itself worked in all three runs; I was checking whether its updated surrounding text reached fcitx.
So #1690 helps with activation, but it doesn’t resolve the case this PR addresses. I agree with your earlier point that Hyprland’s relay is the better place for the underlying fix: it currently sends the client’s I kept this PR in draft while checking whether it actually helped. The comparison confirms it does for this case. If you’re open to keeping the fcitx change as a compatibility workaround, I’ll mark it ready for review. I can share the reduced protocol traces and test harness. |
|
I don't think your & mine has much difference, except your might check last commit serial, which could only make it commit less, instead of more (note I updated 1690 once please use the latested one). So upon activate, the log I saw is like this: Chrome No surrounding update at all. I think it's still on compositor side. Actually, chromium seems doesn't want to send unchanged surrounding, while hyprland doesn't send the cached surrounding upon activation. Actually for chrome you can easily see its initial sequence of event is like this: The set surrounding is before the first enable, but fcitx doesn't get any surrounding later. In this case, seems the most problematic one is chrome. compositor doesn't have responsibliity to hold any "last send" surrounding after disable. |
|
Which means, chromium is responsible to set the surrounding together with the text-input-v3.enable(), Otherwise the value is invalidated automatically. |
|
Filed the bug, FYI https://issues.chromium.org/issues/565066842 |
|
Comparing to qt's text-input-v3, or gtk, the issue is obvious. The inital surrounding should be come together with activate. |
|
Ok I see the difference here, you're trying to have commit on every done (if needed) So two separate issues here, one is chrome never send surrounding upon focus-in. No way to workaround it. Second would be the some compositor doesn't "actively" reply text-input-v3.done for commit if input method doesn't do so. I guess it somewhat related to the fact that kwin/mutter has to handle these because zwp_v1 or ibus dbus protocol doesn't have 1:1 match for this commit done thing. So it's no surprise that it's mainly on input method v2 compositor. The if last != serial doesn't help much here if you want to save useless calls, because serial is increment upon the done event. It will always hold. |
certain compositor may not send done. As this the behavior that kwin implemented in v3, it should be generally safe to update current preedit on focus in. Close #1689
certain compositor may not send done. As this the behavior that kwin implemented in v3, it should be generally safe to update current preedit on focus in. Close #1689
certain compositor may not send done. As this the behavior that kwin implemented in v3, it should be generally safe to update current preedit on focus in. Close #1689
On Hyprland 0.56.2 with Electron 43.6.0 using text-input-v3, editing a textarea with fcitx5's keyboard input method can leave surrounding text unavailable to add-ons.
Chromium queues field updates until it receives a matching
done. Hyprland sends that reply when the input method commits. Forwarding keys alone can leave the exchange stalled.This proposes publishing the current preedit state after
donewhen focused, unless a commit was already sent for that serial. It reuses the existing preedit path and skips inactive contexts.The protocol does not require acknowledging every
done; feedback on whether fcitx5 is the right place to resolve this interaction is welcome.Validation:
échecked.