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

[fuchsia][scenic] Add input shield flag support in Flatland. #36880

Merged
merged 1 commit into from
Oct 25, 2022

Conversation

shivesh-ganju
Copy link
Contributor

@shivesh-ganju shivesh-ganju commented Oct 19, 2022

This CL adds support for "intercept_all_input" flag in flutter_runner_config for flatland.

Test: This code path will be tested once the flatland config is enabled for flutter embedder tests. This patch is a prereq for the test to roll.

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.

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 (don't just cc him here, he won't see it! He's on Discord!).

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.

@shivesh-ganju shivesh-ganju force-pushed the input-shield branch 2 times, most recently from cbb9a5a to b1b51e9 Compare October 19, 2022 22:48
flatland_->flatland()->AddChild(root_transform_id_,
*input_interceptor_node_);

// Attach full-screen hit testing shield. Note that since the hit-region
Copy link
Contributor

Choose a reason for hiding this comment

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

You can set this once in ctor and forget.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, i think i see - create the transform and attach the hit region to it, once. Then add-child this transform to child_transforms_ on each frame submit. Right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that is correct. I initially thought that a transform had to be added as a child before setting its hit region. Turns out I was wrong. Fixed !

@@ -36,6 +36,20 @@ FlatlandExternalViewEmbedder::FlatlandExternalViewEmbedder(
root_transform_id_ = flatland_->NextTransformId();
flatland_->flatland()->CreateTransform(root_transform_id_);
flatland_->flatland()->SetRootTransform(root_transform_id_);

if (intercept_all_input) {
input_interceptor_node_ = flatland_->NextTransformId();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we call it input_interceptor_transform_ instead? Node is a gfx specific resource.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

{{{0, 0, kMaxHitRegionSize, kMaxHitRegionSize},
fuchsia::ui::composition::HitTestInteraction::
SEMANTICALLY_INVISIBLE}});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Gfx is adding the child here, so lets just follow that? We should also add it to child_transforms_.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

This CL adds support for "intercept_all_input" flag in
flutter_runner_config for flatland.

Test: flutter-embedder-test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants