Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@knopp
Copy link
Member

@knopp knopp commented Mar 8, 2021

flutter/flutter#77545

Depends on flutter/flutter#77608

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 Hixie said 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.
  • The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.

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

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@knopp
Copy link
Member Author

knopp commented Mar 8, 2021

flutter/flutter#30660

} else if ([method isEqualToString:@"TextInput.setEditableSizeAndTransform"]) {
NSDictionary* state = call.arguments;
[self setEditableTransform:state[@"transform"]];
} else if ([method isEqualToString:@"TextInput.setCaretRect"]) {
Copy link
Member

Choose a reason for hiding this comment

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

Added comments on flutter/flutter#77608. I'd have thought that TextInput.setMarkedTextRect should be sufficient here -- despite its name, it should emit the current caret rect when the composing range is empty.

Copy link
Member Author

Choose a reason for hiding this comment

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

As noted in flutter/flutter#77608, TextInput.setMarkedTextRect only works while compositing. So we need another method for caret position.

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.

Thanks for sending this! I think if you add a handler for TextInput.setMarkedTextRect you should be able to get away without the new message. You'll want to invalidate/re-cache the transformed rect on each update of either the setMarkedTextRect or setEditableSizeAndTransform message.

@stuartmorgan-g stuartmorgan-g removed their request for review March 10, 2021 15:10
@chinmaygarde
Copy link
Member

@knopp Any updates on @cbracken last comment? If progress is not likely soon, maybe we can close this for now and reopen later?

@knopp
Copy link
Member Author

knopp commented Mar 18, 2021

@chinmaygarde, sorry, missed the notifications on this one. I fixed the typo. However this PR does depend on flutter/flutter#77608.

@chinmaygarde
Copy link
Member

The linked PR has landed. Are there issues with the order in which the commits need to be landed?

@knopp
Copy link
Member Author

knopp commented Mar 26, 2021

@cbracken, @chinmaygarde, TextInput.setMarkedTextRect doesn't work because it is only valid during compositing. However we need cared position even outside of compositing. This has been discussed in flutter/flutter#77608. I'm not sure what you mean by the linked PR having landed, this depend on flutter/flutter#77608 which hasn't landed yet.

@cbracken
Copy link
Member

cbracken commented Mar 29, 2021

To be clear -- for future archaeologists s/compositing/composing/ in the discussions above. setMarkedTextRect is used for IME composing mode and is unrelated to compositing.

To summarise previous discussions elsewhere with @knopp and offline with @LongCatIsLooong, this and setMarkedTextRect cover slightly different but overlapping usecases:

When using a composing IME such as for Chinese, Japanese, Korean input, we need the mark rect since the candidates dropdown menu should remain fixed to the bottom-left of the composing region (depending on platform) until the composing text is committed.

This patch covers non-composing use-cases where an OS-provided accent-selection popup is used to inject an accented character (é, è, ê, etc.) and should move with the caret. I'd actually forgotten this use-case existed as I'd apparently disabled it using defaults at some point -- I communicate a fair bit in French but use option-{e,i,u,`} dead-keys for input :(

I did some local testing on macOS, and it appears that when IME composing is active; long-press accent selection is disabled, so there should be no risk of the two behaviours interfering with each 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.

This LGTM. Apologies for the delay -- this fell off my radar while I dealt with a regression to IME composing on macOS after the key event patches landed.

@knopp knopp force-pushed the macos_accent_popup_location branch from fd82053 to eaf9587 Compare March 29, 2021 20:03
@GreenLim
Copy link

GreenLim commented Apr 1, 2021

flutter/flutter#77608 has been merged. so these commits can be landed now? it's import for input.

CGRectApplyAffineTransform(_caretRect, CATransform3DGetAffineTransform(_editableTransform));

// flip and convert to screen coordinates
double viewHeight = self.flutterViewController.view.bounds.size.height;
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

@knopp knopp Apr 13, 2021

Choose a reason for hiding this comment

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

I noticed that :)

Should be fixed in #25524 .

duanqz pushed a commit to duanqz/engine that referenced this pull request Apr 16, 2021
* Position accent popup window next to caret

flutter/flutter#77545

* Fix typo
@knopp knopp deleted the macos_accent_popup_location branch July 17, 2021 09:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants