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

[Windows] Introduce an accessibility plugin #50975

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented Feb 26, 2024

This is the same pull request as #50898. GitHub broke on the previous pull request so I re-created it

This moves the logic to handle flutter/accessibility messages to a new type, AccessibilityPlugin.

Notable changes:

  1. Windows app no longer crashes if it receives accessibility events it does not support
  2. Windows app no longer crashes if it receives accessibility events while in headless mode

@yaakovschectman After playing around with this, I ended up using a different pattern than what what I suggested on #50598 (comment). This message handler is simple enough that splitting into a child/base types felt like unnecessary boilerplate. The key thing is separating messaging and implementation logic, which was achieved through the SetUp method. Let me know what you think, and sorry for all my flip-flopping on this topic! 😅

This is preparation for: flutter/flutter#143765

Sample app for manual testing: flutter/flutter#113059

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 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.

const auto* message = std::get_if<std::string>(&message_itr->second);
if (!message) {
return;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@yaakovschectman following up on this conversation: #50898 (comment)

I added error logs for malformed top-level type and data properties. I kept the plugin "flexible" on the announcement message's inner message data property, similar to other embedders' logic.

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.

Nice -- so much cleaner!

LGTM stamp from a Japanese personal seal

@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 27, 2024
@auto-submit auto-submit bot merged commit 24c7b03 into flutter:main Feb 27, 2024
@loic-sharma loic-sharma deleted the windows_accessibility_plugin branch February 27, 2024 21:01
auto-submit bot pushed a commit that referenced this pull request Feb 28, 2024
…#51024)

#50975 made the Windows embedder a bit more defensive on accessibility event messages and introduced an error if it received an event it does not support. This change reduces that error to a warning as it can be triggered by hovering over the counter app's `+` button.

Fixes flutter/flutter#144274

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Feb 28, 2024
c79117b706 [Windows] Remove TODONE (flutter/engine#51005)
24c7b03ef0 [Windows] Introduce an accessibility plugin (flutter/engine#50975)
c805e43957 Roll Skia from 1beae57ea0dd to c8703c91675e (1 revision) (flutter/engine#51014)
17dff87ef3 [Impeller] various StC fixes for GPU -> CPU readback plus BufferBindingGLES error (flutter/engine#50951)
8457d10473 Roll Dart SDK from be6be2b9ba6e to a0e3c16eea3e (3 revisions) (flutter/engine#51015)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects: desktop autosubmit Merge PR when tree becomes green via auto submit App platform-windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants