engine
engine copied to clipboard
Add platform view support for linux
This pull request is part of #24169. For framework API, see https://github.com/flutter/flutter/pull/74814.
This pull request adds platform view API to Linux shell, without support for touch events and clipping mutations, which are splitted and proposed later when this PR get landed.
Code changes:
-
FlPlatformView
to wrap a GtkWidget, owned byFlPlatformViewsPlugin
. This abstraction allows us to owning aFlMethodChannel
inFlPlatformView
for communication with dart codes. -
FlPlatformViewFactory
for creating platform views for specific view type. Flutter Framework will call functions ofFlPlatformViewFactory
when creating a new platform view. -
FlPlatformViewsPlugin
for implementingSystemChannels.platform_views
from Flutter services library.
A working demo with webview: https://github.com/wechat-miniprogram/gtktest.
This pr does not support applying mutations on the platform views yet. I will open a PR later to implement that feature.
This pr is part of platform view implementation on Linux, related issue: flutter/flutter#41724.
Pre-launch Checklist
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I read the Tree Hygiene wiki page, which explains my responsibilities.
- [x] I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
- [x] I listed at least one issue that this PR fixes in the description above.
- [x] 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.
- [x] I updated/added relevant documentation (doc comments with
///
). - [x] I signed the CLA.
- [x] All existing and new tests are passing.
- [ ] The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
@robert-ancell @iskakaushik This PR contains parts other than FlGestureHelper
and FlClippingView
from #24169. Changes on FlView
are simplified.
cc @gw280 as well. I know you are looking at the Mac side of things but it may be a good idea to go over this once to look for common patterns.
when will it be merged?
why does it blocked here
@robert-ancell Please take a look at this pr.
anything blocked?
anything blocked?
It seems that few people can review this and the dart side pull requests. And these people have no time.
Maybe cc @cbracken and @gspencergoog ?
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.
@huanghongxun it's been a long while, but is this patch something you're willing to get rebased and tests fixed or would you like someone to pick this up and continue with it? Unfortunately we've been pretty short on people who could spend the appropriate amount of review time on this (and https://github.com/flutter/flutter/pull/74814) but I've got time to take a look.
@cbracken rebased on main.
Added some comments to https://github.com/flutter/flutter/pull/74814 covering the framework side of this work.
I think the embedder side is much less likely to be affected by the framework-side design work. I've pulled this patch down locally and am playing with it a bit to get a feel for it while I review. Thanks again for your patience on this.
I'm going to close this for the time being, in order to get it off the review queue until we've worked out the right approach to consolidating the API in a way that works for all platforms. That's a problem being actively hacked out right now on macOS and Windows/Linux are on our agenda next. I do think that some of the consolidation work in the framework PR is something we want to followup on though.
Once we're set with macOS, we will absolutely want to get back to landing platform views for Linux.