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
shivesh-ganju merged 1 commit into
flutter-team-archive:mainfrom
shivesh-ganju:input-shield
Oct 25, 2022
Merged

shivesh-ganju merged 1 commit into
flutter-team-archive:mainfrom
shivesh-ganju:input-shield

Conversation

@shivesh-ganju

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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.

Comment thread shell/platform/fuchsia/flutter/flatland_external_view_embedder.cc Outdated
Comment thread shell/platform/fuchsia/flutter/flatland_external_view_embedder.cc
Comment thread shell/platform/fuchsia/flutter/flatland_external_view_embedder.h Outdated
@shivesh-ganju
shivesh-ganju force-pushed the input-shield branch 2 times, most recently from cbb9a5a to b1b51e9 Compare October 19, 2022 22:48
Comment thread shell/platform/fuchsia/flutter/flatland_external_view_embedder.cc Outdated
Comment thread shell/platform/fuchsia/flutter/flatland_external_view_embedder.cc Outdated
Comment thread shell/platform/fuchsia/flutter/flatland_external_view_embedder.cc Outdated
Comment thread shell/platform/fuchsia/flutter/flatland_external_view_embedder.cc Outdated
Comment thread shell/platform/fuchsia/flutter/flatland_external_view_embedder.cc Outdated
Comment thread shell/platform/fuchsia/flutter/flatland_external_view_embedder.cc
flatland_->flatland()->AddChild(root_transform_id_,
*input_interceptor_node_);

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 !

flatland_->flatland()->SetRootTransform(root_transform_id_);

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Development

Successfully merging this pull request may close these issues.

3 participants