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

Conversation

@huanghongxun
Copy link
Contributor

This pull request aims at supporting platform views on Linux.

To support platform views:

  1. We replaced original FlRenderer implementation (creating EGLSurface and EGLContext by X11 and Wayland) with a new and platform-independent implementation (creating OpenGL context by GdkGLContext, and draw textures to FlGLArea)
  2. Now Flutter Linux window may have multiple FlGLAreas as backing store layer and GtkWidgets from plugins as platform view layer. They are stacked in FlView which extends GtkContainer now.
  3. We deal with gestures like the way in iOS. First we listen to gtk pointer events, send it to Flutter framework side, accept gesture if gesture detector test hit positively on the platform view, and finally embedder will send all stored pointer events to platform view(GtkWidget) by gtk_widget_event.
  4. No longer requires EGL, wayland-client, x11 now. libepoxy is added for GL operations, such as creating Framebuffers and textures, and procs for Skia.

This pr closes flutter/flutter#41724.

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.
  • 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
Copy link
Contributor

Thanks @huanghongxun! Can you split this PR into smaller PRs, perhaps starting with the FlGLArea change? It's a lot of changes to review at once.

@robert-ancell
Copy link
Contributor

@wmww - I think we'll need some of your help reviewing this.

@wmww
Copy link
Contributor

wmww commented Jan 28, 2021

Not a full review, but I tested and the default demo app works on Wayland (both Sway and Mir). It removes my dirty hacks for Wayland and seems to make resizing a little less flickery. Only oddity is

Status 8cd5

is dumped to the terminal repeatedly.

@huanghongxun
Copy link
Contributor Author

For FlGLArea changes, please see #24011

@huanghongxun
Copy link
Contributor Author

For platform view implementation, please see #24169.

@chinmaygarde
Copy link
Member

I am a bit confused about whether this or #24169 is the right issue to track the implementation of platform views on Linux. Based on the review activity, it seems like the other one is the way to go? If so, can we close this one please?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement PlatformView support on Linux

4 participants