-
Notifications
You must be signed in to change notification settings - Fork 34
fix: send events after activate if available #658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Skipping CI for Draft Pull Request. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideWhen a text input gets enabled, the helper now sends all relevant input method state (surrounding text, text change cause, and content type) immediately after activation, if those features are available, before finalizing with a done event. Sequence diagram for sending input method state after activatesequenceDiagram
participant TI as TextInput
participant Helper as WInputMethodHelper
participant IM as InputMethod
TI->>Helper: handleTIEnabled()
Helper->>IM: sendActivate()
alt SurroundingText_feature_enabled
Helper->>IM: sendSurroundingText(ti.surroundingText, ti.surroundingCursor, ti.surroundingAnchor)
end
Helper->>IM: sendTextChangeCause(ti.textChangeCause)
alt ContentType_feature_enabled
Helper->>IM: sendContentType(ti.contentHints.toInt, ti.contentPurpose)
end
Helper->>IM: sendDone()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
f0a1511 to
69fe36e
Compare
https://wayland.app/protocols/input-method-unstable-v2#zwp_input_method_v2:event:activate https://github.com/hyprwm/Hyprland/blob/main/src/managers/input/TextInput.cpp#L233 Log: as title Influence: input method Signed-off-by: Yixue Wang <wangyixue@uniontech.com>
69fe36e to
258b79e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've left some high level feedback:
- Consider caching
ti->features()in a local variable before the flag checks to avoid repeated calls and make the intent of feature-gated sends clearer. - If the protocol allows
textChangeCauseto be optional, you may want to guardim->sendTextChangeCause(ti->textChangeCause())behind the corresponding feature flag (or version check) for consistency with the other conditional sends.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider caching `ti->features()` in a local variable before the flag checks to avoid repeated calls and make the intent of feature-gated sends clearer.
- If the protocol allows `textChangeCause` to be optional, you may want to guard `im->sendTextChangeCause(ti->textChangeCause())` behind the corresponding feature flag (or version check) for consistency with the other conditional sends.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the input method activation flow by sending necessary state information (surrounding text, text change cause, and content type) to the input method immediately after activation, as required by the Wayland input-method-unstable-v2 protocol specification.
Key changes:
- Send surrounding text, text change cause, and content type events after input method activation when the corresponding features are supported by the text input
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: asterwyx, zccrs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
https://wayland.app/protocols/input-method-unstable-v2#zwp_input_method_v2:event:activate
https://github.com/hyprwm/Hyprland/blob/main/src/managers/input/TextInput.cpp#L233
Log: as title
Influence: input method
Signed-off-by: Yixue Wang wangyixue@uniontech.com
Summary by Sourcery
Bug Fixes: