-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[Embedder] Wire view focus event and focus request #163930
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
5ddec48 to
4507bbf
Compare
4507bbf to
d1aa858
Compare
d1aa858 to
cdb9c1b
Compare
bea686b to
cbbf1db
Compare
cbbf1db to
0a94164
Compare
| /// @brief Notify the delegate that platform view focus state has changed. | ||
| /// | ||
| /// @param[in] event The focus event describing the change. | ||
| virtual void OnPlatformViewSendViewFocusEvent( |
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.
Should we just default this OOL to be a no-op? You won't have to patch the mocks.
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.
No other delegate method has default implementation. If the inconsistency is not an issue we can do it.
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.
Yeah, I don't think we had that many mocks. This is fine. But we can probably also clean up in a later patch.
mattkae
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.
A few things, but this mostly look sensible to me 🎉
| // Focus state of a View. | ||
| // Must match ViewFocusState in ui/platform_dispatcher.dart. | ||
| enum class ViewFocusState : int64_t { | ||
| kUnfocused = 0, |
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.
Nit: = 0 is redundant.
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 like to have explicit value when mapping to values from another language. It is also used in key_data.h and possibly other places so I'd leave it there for consistency.
|
The embedder API and the engine updates LGTM. But it looks like @mattkae has some feedback on the API. I'll defer to them for the approval. Thanks! |
80739ed to
b8f4a03
Compare
| void PlatformConfigurationNativeApi::RequestViewFocusChange(int64_t view_id, | ||
| int64_t state, | ||
| int64_t direction) { | ||
| ViewFocusChangeRequest request{view_id, // |
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.
Missing comment or should the // be removed?
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.
The comment is there to force line break. Otherwise clang format puts first two argument in same line which doesn't look very readable. It's used in other parts of the engine as well.
|
Hey, shouldn't the enum members be namespaced, like the rest of the identifiers? I actually got a build breakage because of this, because I use |
This wires
PlatformDispatcher.onViewFocusChangeandPlatformDispatches.requestViewFocusChangethrough embedder API.If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.