New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement PlatformView support on Linux #41724
Comments
It will be hard to do with GTK, because it wants access to X/Wayland server through GDK. So you cannot simply make an opengl context to render GTK there. Qt seems to work in custom opengl contexts, although i never used that. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@jeanluc243 You're looking for #41726; this issue is about platform view support in general. |
The goal of PlatformView is not to render GTK controls into a texture, it's to embed actual GTK views. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
If there were updates, they would have been posted here. Please see https://github.com/flutter/flutter/wiki/Issue-hygiene#when-will-my-bug-be-fixed If a bug has no assignee or milestone, pinging for updates is not constructive; it just spams people subscribed to the issue. |
Where would one find resources to learn more about how flutter integrates with native things? I'd love to help and I have some mild experience with OpenGL, but none with Skia.... |
I'm thinking if I can get an OpenGL context to render in, I could get a video player working easily. |
The source for the Linux embedding is at https://github.com/flutter/engine/tree/master/shell/platform/linux. I'm not sure if that's what you mean by "integrates with native things".
I wouldn't expect implementing |
Thank you @huanghongxun for doing the work on this. |
If I've correctly understood this issue's activity, it was pretty close to landing with #74814 and flutter/engine#26288 before it was decided to do some API consolidation. A Linux PlatformView is still very relevant. Just wondering if now would be a good time to revive this issue and possibly those PRs? Because some time has now passed since that decision was taken. |
@cbracken there weren't any issues linked in your comments on that linked prwhere the MacOS work you were doing is, would you have a pointer to issues to subscribe to to track that work? |
Given that flutter/engine#39473 has been merged, which means that approaches like flutter/engine#26288 won't work any more. So I guess the only option left for us is to do off-screen rendering for the platform view (via |
Off-screen rendering has had significant drawbacks on other platforms. I'm not familiar with the context of the simplification PR above, but on other platforms we do on-demand separation of Flutter content into multiple layers in the specific case of showing platform views, and it's likely that we will want to (re-?)introduce whatever structure is needed to make that possible as part of implementing platform view support. It looks like part of the issue being resolved there was the existence of complexity without a use case, which wouldn't be the case once there's concrete platform view support in progress. |
I tried reverting those PRs and merged flutter/engine#26288 into 3.10.5 and managed to get But I noticed a serious performance issue with this approach. That is the application runs at extremely low frame rate (10 fps-ish on my laptop) when the
I can also confirm the issue by using the stable branch of Flutter without using the platform view, and simply place the Although I can't find a source supporting this statement. But if it's true, I think this will have to be addressed in order to implement platform view support on Linux. Several options I can think of:
For my specific scenario, the only way to go fo now, is to put the |
For anyone who's still looking for a pratical and performant workaround for embedding platform views, if you're not limited to GTK, please take a look at Qt's QQuickRenderControl, which allows you to render Qt scenegraphs to any external texture, be it OpenGL, Vulkan, Metal, or Direct 3D. My Linux Flutter app finally gets its properly functioning webview. |
Hello! I am writing a PC cross-platform software with flutter, which has a lot of webview applications. I'm totally unfamiliar with both qt and gtk. Is there a demo or some information about your solution? Thank you very much |
@leisu1 You'll need to write a native plugin to embed Qt's webview into a Flutter application. This can be done with the following steps:
Some useful links:
|
Please use another forum for any detailed discussion of alternate approaches to rendering content; see https://github.com/flutter/flutter/wiki/Issue-hygiene#comments-providing-workarounds |
We'll want to support embedding native views in a Flutter view, as is currently supported on mobile.
This is of course blocked on #30729 since until we have a view-based toolkit implementation for Linux, there's no concept of a "view" to embed.The text was updated successfully, but these errors were encountered: