Skip to content
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

Fix macOS text composing #49314

Merged
merged 6 commits into from
Jan 9, 2024

Conversation

LongCatIsLooong
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong commented Dec 21, 2023

Fixes flutter/flutter#68547 (almost, this requires an oneliner framework patch to work).

The selection wasn't being updated correctly before this so there were no highlights. Now the selection is properly highlighted (although it seems the styling has been updated in sonoma but it's better than offering no visual feedback):

Screen.Recording.2023-12-21.at.12.00.38.AM.mov

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@LongCatIsLooong LongCatIsLooong marked this pull request as ready for review December 21, 2023 08:18
cursor_pos += active_model_->composing_range().start();
active_model_->UpdateComposingText(text);
active_model_->SetSelection(TextRange(cursor_pos, cursor_pos));
active_model_->UpdateComposingText(text, TextRange(cursor_pos, cursor_pos));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really related to this change, but isn't the composing text being added twice here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean between AddText as well as UpdateComposingText? It sort of looks like it, though perhaps we're relying on a side effect of one or the other?

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great! Thanks for fixing this.

LGTM stamp from a Japanese personal seal

shell/platform/common/text_input_model.cc Show resolved Hide resolved
cursor_pos += active_model_->composing_range().start();
active_model_->UpdateComposingText(text);
active_model_->SetSelection(TextRange(cursor_pos, cursor_pos));
active_model_->UpdateComposingText(text, TextRange(cursor_pos, cursor_pos));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean between AddText as well as UpdateComposingText? It sort of looks like it, though perhaps we're relying on a side effect of one or the other?

@LongCatIsLooong LongCatIsLooong added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 9, 2024
@auto-submit auto-submit bot merged commit 542fea9 into flutter:main Jan 9, 2024
27 checks passed
zijiehe-google-com pushed a commit to zijiehe-google-com/engine that referenced this pull request Jan 9, 2024
Fixes flutter/flutter#68547 (almost, this requires an oneliner framework patch to work).

The selection wasn't being updated correctly before this so there were no highlights. Now the selection is properly highlighted (although it seems the styling has been updated in sonoma but it's better than offering no visual feedback):

https://github.com/flutter/engine/assets/31859944/ab8557f4-7215-46de-8a9d-c2e3982695eb

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
@LongCatIsLooong LongCatIsLooong deleted the fix-macos-text-composing branch January 9, 2024 23:18
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 9, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jan 10, 2024
…141217)

flutter/engine@8c1501f...542fea9

2024-01-09 31859944+LongCatIsLooong@users.noreply.github.com Fix macOS text composing (flutter/engine#49314)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC bdero@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: desktop autosubmit Merge PR when tree becomes green via auto submit App platform-macos platform-windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Active subrange within composing range should be visually highlighted in Flutter
2 participants