[ozone/wayland] Text-input-v3: Deletion of surrounding text [chromium/src : main]

0 views
Skip to first unread message

Orko Garai (Gerrit)

unread,
May 8, 2025, 3:59:42 PM5/8/25
to Kramer Ge, Chromium LUCI CQ, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Kramer Ge

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Kramer Ge
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Idc76d4e4b07f311b24ef54088bf4ec4e0cbd839b
Gerrit-Change-Number: 6526370
Gerrit-PatchSet: 1
Gerrit-Owner: Orko Garai <or...@igalia.com>
Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
Gerrit-Reviewer: Orko Garai <or...@igalia.com>
Gerrit-Attention: Kramer Ge <fang...@chromium.org>
Gerrit-Comment-Date: Thu, 08 May 2025 19:59:37 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Orko Garai (Gerrit)

unread,
May 20, 2025, 8:40:54 PM5/20/25
to Kramer Ge, Chromium LUCI CQ, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Kramer Ge

Orko Garai added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Orko Garai . resolved

Noticing an issue when testing with the on-screen keyboard. Will fix and then mark it ready for review again.

Open in Gerrit

Related details

Attention is currently required from:
  • Kramer Ge
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Idc76d4e4b07f311b24ef54088bf4ec4e0cbd839b
Gerrit-Change-Number: 6526370
Gerrit-PatchSet: 2
Gerrit-Owner: Orko Garai <or...@igalia.com>
Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
Gerrit-Reviewer: Orko Garai <or...@igalia.com>
Gerrit-Attention: Kramer Ge <fang...@chromium.org>
Gerrit-Comment-Date: Wed, 21 May 2025 00:40:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Orko Garai (Gerrit)

unread,
May 27, 2025, 6:52:47 PM5/27/25
to Kramer Ge, Chromium LUCI CQ, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Kramer Ge

Orko Garai added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Orko Garai . resolved

https://crrev.com/c/6542426 revealed a bug in gnome OSK: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8426

So had to test on gnome by manually adding another enable+commit to trigger it locally.

Open in Gerrit

Related details

Attention is currently required from:
  • Kramer Ge
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Idc76d4e4b07f311b24ef54088bf4ec4e0cbd839b
Gerrit-Change-Number: 6526370
Gerrit-PatchSet: 3
Gerrit-Owner: Orko Garai <or...@igalia.com>
Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
Gerrit-Reviewer: Orko Garai <or...@igalia.com>
Gerrit-Attention: Kramer Ge <fang...@chromium.org>
Gerrit-Comment-Date: Tue, 27 May 2025 22:52:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Kramer Ge (Gerrit)

unread,
May 28, 2025, 5:48:07 PM5/28/25
to Orko Garai, Chromium LUCI CQ, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Orko Garai

Kramer Ge added 4 comments

File ui/ozone/platform/wayland/host/zwp_text_input_v3.h
Line 101, Patchset 4 (Latest): struct SendData {
bool operator==(const SendData&) const = default;
std::string text;
int32_t cursor = 0;
int32_t anchor = 0;
};
Kramer Ge . unresolved

IMO not necessary to wrap this in a struct, we can just comment separate the unsent fields like `commit_count`;

Line 41, Patchset 4 (Latest): // passed via ZwpTextInputV3::SetSurroundingText.
Kramer Ge . unresolved

Add a comment that it includes `preedit`?

File ui/ozone/platform/wayland/host/zwp_text_input_v3.cc
Line 424, Patchset 4 (Latest): if (index < 0) {
Kramer Ge . unresolved

I feel that this chain of if's can be simplified. like using `= ( )? : ` and `DVLOG_IF()`.

Line 454, Patchset 4 (Latest): surrounding_text->delete_around_range =
Kramer Ge . unresolved

should this include the `preedit`, or incoming `preedit` instead of (index, 0)?

Open in Gerrit

Related details

Attention is currently required from:
  • Orko Garai
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Idc76d4e4b07f311b24ef54088bf4ec4e0cbd839b
    Gerrit-Change-Number: 6526370
    Gerrit-PatchSet: 4
    Gerrit-Owner: Orko Garai <or...@igalia.com>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-Reviewer: Orko Garai <or...@igalia.com>
    Gerrit-Attention: Orko Garai <or...@igalia.com>
    Gerrit-Comment-Date: Wed, 28 May 2025 21:48:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Orko Garai (Gerrit)

    unread,
    May 29, 2025, 9:18:49 PM5/29/25
    to Kramer Ge, Chromium LUCI CQ, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
    Attention needed from Kramer Ge

    Orko Garai added 4 comments

    File ui/ozone/platform/wayland/host/zwp_text_input_v3.h
    Line 101, Patchset 4: struct SendData {

    bool operator==(const SendData&) const = default;
    std::string text;
    int32_t cursor = 0;
    int32_t anchor = 0;
    };
    Kramer Ge . resolved

    IMO not necessary to wrap this in a struct, we can just comment separate the unsent fields like `commit_count`;

    Orko Garai

    Done.

    Line 41, Patchset 4: // passed via ZwpTextInputV3::SetSurroundingText.
    Kramer Ge . resolved

    Add a comment that it includes `preedit`?

    Orko Garai

    Done

    File ui/ozone/platform/wayland/host/zwp_text_input_v3.cc
    Line 424, Patchset 4: if (index < 0) {
    Kramer Ge . resolved

    I feel that this chain of if's can be simplified. like using `= ( )? : ` and `DVLOG_IF()`.

    Orko Garai

    Done

    Line 454, Patchset 4: surrounding_text->delete_around_range =
    Kramer Ge . resolved

    should this include the `preedit`, or incoming `preedit` instead of (index, 0)?

    Orko Garai

    Great catch!

    I think it shouldn't include it when there is no incoming preedit, as the preedit part will be removed in that case.

    But when there is an incoming preedit, you're right it makes sense to include that. I didn't do that initially as I thought the double deletion is probably very unlikely anyway with the most likely scenario being `delete, done, delete, done, set_surrounding_text`. But you're right in theory there could be something like `preedit, delete, done, delete, done, set_surrounding_text`. So I've addressed that now. Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kramer Ge
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Idc76d4e4b07f311b24ef54088bf4ec4e0cbd839b
    Gerrit-Change-Number: 6526370
    Gerrit-PatchSet: 5
    Gerrit-Owner: Orko Garai <or...@igalia.com>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-Reviewer: Orko Garai <or...@igalia.com>
    Gerrit-Attention: Kramer Ge <fang...@chromium.org>
    Gerrit-Comment-Date: Fri, 30 May 2025 01:18:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Kramer Ge <fang...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kramer Ge (Gerrit)

    unread,
    May 30, 2025, 2:19:19 PM5/30/25
    to Orko Garai, Chromium LUCI CQ, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
    Attention needed from Orko Garai

    Kramer Ge voted and added 3 comments

    Votes added by Kramer Ge

    Code-Review+1

    3 comments

    Patchset-level comments
    File-level comment, Patchset 5 (Latest):
    Kramer Ge . resolved

    LGTM % 1 thing.

    File ui/ozone/platform/wayland/host/zwp_text_input_v3.cc
    Line 410, Patchset 5 (Latest): const auto preedit_data = self->pending_input_events_.preedit;
    Kramer Ge . unresolved

    nit: should this also be `const auto&`?

    Line 454, Patchset 4: surrounding_text->delete_around_range =
    Kramer Ge . resolved

    should this include the `preedit`, or incoming `preedit` instead of (index, 0)?

    Orko Garai

    Great catch!

    I think it shouldn't include it when there is no incoming preedit, as the preedit part will be removed in that case.

    But when there is an incoming preedit, you're right it makes sense to include that. I didn't do that initially as I thought the double deletion is probably very unlikely anyway with the most likely scenario being `delete, done, delete, done, set_surrounding_text`. But you're right in theory there could be something like `preedit, delete, done, delete, done, set_surrounding_text`. So I've addressed that now. Thanks!

    Kramer Ge

    To be frank I also think a sane compositor would perform 2 `done`s for each of their operations. Thanks for fixing.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Orko Garai
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Idc76d4e4b07f311b24ef54088bf4ec4e0cbd839b
    Gerrit-Change-Number: 6526370
    Gerrit-PatchSet: 5
    Gerrit-Owner: Orko Garai <or...@igalia.com>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-Reviewer: Orko Garai <or...@igalia.com>
    Gerrit-Attention: Orko Garai <or...@igalia.com>
    Gerrit-Comment-Date: Fri, 30 May 2025 18:19:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Kramer Ge <fang...@chromium.org>
    Comment-In-Reply-To: Orko Garai <or...@igalia.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Orko Garai (Gerrit)

    unread,
    May 30, 2025, 5:02:04 PM5/30/25
    to Chromium LUCI CQ, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org

    Orko Garai voted and added 1 comment

    Votes added by Orko Garai

    Commit-Queue+2

    1 comment

    File ui/ozone/platform/wayland/host/zwp_text_input_v3.cc
    Line 410, Patchset 5: const auto preedit_data = self->pending_input_events_.preedit;
    Kramer Ge . resolved

    nit: should this also be `const auto&`?

    Orko Garai

    Right! Done.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Idc76d4e4b07f311b24ef54088bf4ec4e0cbd839b
    Gerrit-Change-Number: 6526370
    Gerrit-PatchSet: 6
    Gerrit-Owner: Orko Garai <or...@igalia.com>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-Reviewer: Orko Garai <or...@igalia.com>
    Gerrit-Comment-Date: Fri, 30 May 2025 21:01:58 +0000
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    May 30, 2025, 6:06:13 PM5/30/25
    to Orko Garai, Kramer Ge, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org

    Chromium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    5 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: ui/ozone/platform/wayland/host/zwp_text_input_v3.cc
    Insertions: 1, Deletions: 1.

    @@ -407,7 +407,7 @@
    }
    auto& surrounding_text = self->committed_ime_data_.surrounding_text;
    const auto& commit_string = self->pending_input_events_.commit;
    - const auto preedit_data = self->pending_input_events_.preedit;
    + const auto& preedit_data = self->pending_input_events_.preedit;
    const auto& delete_surrounding_text =
    self->pending_input_events_.delete_surrounding_text;
    if (surrounding_text && delete_surrounding_text &&
    ```

    Change information

    Commit message:
    [ozone/wayland] Text-input-v3: Deletion of surrounding text

    Implement text-input-v3 `delete_surrounding_text` event.
    Fixed: 409585882, 351244345
    Change-Id: Idc76d4e4b07f311b24ef54088bf4ec4e0cbd839b
    Reviewed-by: Kramer Ge <fang...@chromium.org>
    Commit-Queue: Orko Garai <or...@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#1467690}
    Files:
    • M ui/ozone/platform/wayland/host/wayland_input_method_context.cc
    • M ui/ozone/platform/wayland/host/zwp_text_input_v1.h
    • M ui/ozone/platform/wayland/host/zwp_text_input_v3.cc
    • M ui/ozone/platform/wayland/host/zwp_text_input_v3.h
    • M ui/ozone/platform/wayland/host/zwp_text_input_v3_unittest.cc
    • M ui/ozone/platform/wayland/test/mock_zwp_text_input_v3_client.h
    Change size: L
    Delta: 6 files changed, 502 insertions(+), 28 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Kramer Ge
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Idc76d4e4b07f311b24ef54088bf4ec4e0cbd839b
    Gerrit-Change-Number: 6526370
    Gerrit-PatchSet: 7
    Gerrit-Owner: Orko Garai <or...@igalia.com>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-Reviewer: Orko Garai <or...@igalia.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages