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

[Windows] Make the engine own the PlatformHandler #37855

Merged
merged 1 commit into from
Dec 5, 2022

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented Nov 22, 2022

The Windows PlatformHandler is a singleton, however, it is owned by the view. This makes the PlatformHandler owned by the engine to prepare for a multi-view world.

Part of flutter/flutter#115611

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.

const FlutterWindowsView* view = engine_->view();
if (view == nullptr) {
result->Error(kClipboardError,
"Clipboard is not available in Windows headless mode");
Copy link
Member Author

Choose a reason for hiding this comment

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

This message mirrors the GLFW message:

if (!window_) {
result->Error(kNoWindowError,
"Clipboard is not available in GLFW headless mode.");
return;
}

Please let me know if you have suggestions though!

@chinmaygarde
Copy link
Member

This seems good to go. Can we land it?

@loic-sharma loic-sharma force-pushed the windows_platform_handler branch from f427b3a to 51e4e32 Compare December 5, 2022 18:46
@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 5, 2022
@loic-sharma
Copy link
Member Author

Yup. Apologies for the delay, I was out last week!

@auto-submit auto-submit bot merged commit e2b1919 into flutter:main Dec 5, 2022
@loic-sharma loic-sharma deleted the windows_platform_handler branch December 5, 2022 20:29
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 5, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 5, 2022
…116547)

* 3f997f01c Roll Skia from 1a8a0e1113da to e9c0d4b83ca4 (2 revisions) (flutter/engine#38077)

* e2b1919a7 [Windows] Make the engine own PlatformHandler (flutter/engine#37855)
mit-mit pushed a commit to mit-mit/flutter that referenced this pull request Dec 6, 2022
…lutter#116547)

* 3f997f01c Roll Skia from 1a8a0e1113da to e9c0d4b83ca4 (2 revisions) (flutter/engine#38077)

* e2b1919a7 [Windows] Make the engine own PlatformHandler (flutter/engine#37855)
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
…lutter#116547)

* 3f997f01c Roll Skia from 1a8a0e1113da to e9c0d4b83ca4 (2 revisions) (flutter/engine#38077)

* e2b1919a7 [Windows] Make the engine own PlatformHandler (flutter/engine#37855)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…lutter#116547)

* 3f997f01c Roll Skia from 1a8a0e1113da to e9c0d4b83ca4 (2 revisions) (flutter/engine#38077)

* e2b1919a7 [Windows] Make the engine own PlatformHandler (flutter/engine#37855)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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