-
Notifications
You must be signed in to change notification settings - Fork 6k
Allow the default background color to be changed #54575
Allow the default background color to be changed #54575
Conversation
Note when using a transparent background from Flutter and using glBlitFramebuffer the background is not shown, and instead the background is always black. This may mean we cannot use glBlitFramebuffer in this case. Setting the background color with an alpha value less than 1.0 doesn't currently show the GTK background. This needs more investigation. The above two issues will tracked as separate issues/fixes. Fixes flutter/flutter#149920
|
To enable this is an application edit GdkRGBA background_color;
gdk_rgba_parse(&background_color, "#ff0000");
fl_view_set_background_color(view, &background_color); |
|
This doesn't solve all the issues with background, but might be useful for those who want to immediately minimize the black background shown when an application starts. |
|
@loic-sharma this might also affect the Windows embedder - it seems like you should be allowed to set the background for an app (e.g. red) and Flutter can have a transparent background (e.g. with |
cbracken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loic-sharma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Agreed. We'll definitely need to fix this before we can support platform views on Windows. |
Co-authored-by: Chris Bracken <[email protected]>
|
The bug with the background not showing through is a bug in GTK version in Ubuntu, which is fixed upstream. So I've re-enabled the transparency in this change. |
|
Interestingly when using a fixed version of GTK, the blit does seem to work with alpha. I'm not sure if that's correct OpenGL behaviour or driver specific. |
…153724) flutter/engine@30ffbfa...9d7e3a6 2024-08-19 [email protected] Allow the default background color to be changed (flutter/engine#54575) 2024-08-19 [email protected] Roll Skia from d528658273db to 318b7958f748 (4 revisions) (flutter/engine#54620) 2024-08-19 [email protected] [Impeller] use paragraphs instead of bullet points in the FAQ. (flutter/engine#54622) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
|
Talking to another developer the Blit alpha behaviour might be Mesa specific, so when testing on NVIDIA it might not work. |
…lutter#153724) flutter/engine@30ffbfa...9d7e3a6 2024-08-19 [email protected] Allow the default background color to be changed (flutter/engine#54575) 2024-08-19 [email protected] Roll Skia from d528658273db to 318b7958f748 (4 revisions) (flutter/engine#54620) 2024-08-19 [email protected] [Impeller] use paragraphs instead of bullet points in the FAQ. (flutter/engine#54622) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Fixes flutter/flutter#149920