-
Notifications
You must be signed in to change notification settings - Fork 6k
Position accent popup window next to caret #24867
Conversation
|
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. |
| } else if ([method isEqualToString:@"TextInput.setEditableSizeAndTransform"]) { | ||
| NSDictionary* state = call.arguments; | ||
| [self setEditableTransform:state[@"transform"]]; | ||
| } else if ([method isEqualToString:@"TextInput.setCaretRect"]) { |
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.
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.
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.
As noted in flutter/flutter#77608, TextInput.setMarkedTextRect only works while compositing. So we need another method for caret position.
shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm
Outdated
Show resolved
Hide resolved
cbracken
left a comment
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.
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.
|
@chinmaygarde, sorry, missed the notifications on this one. I fixed the typo. However this PR does depend on flutter/flutter#77608. |
|
The linked PR has landed. Are there issues with the order in which the commits need to be landed? |
|
@cbracken, @chinmaygarde, |
|
To be clear -- for future archaeologists 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 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. |
cbracken
left a comment
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.
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.
fd82053 to
eaf9587
Compare
|
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; |
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.
self.flutterViewController will be null here ref https://github.com/flutter/engine/pull/23469/files#r612811988
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.
I noticed that :)
Should be fixed in #25524 .
* Position accent popup window next to caret flutter/flutter#77545 * Fix typo
flutter/flutter#77545
Depends on flutter/flutter#77608
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.