Skip to content
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

Set GLArea.has-alpha = true #54053

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Set GLArea.has-alpha = true #54053

merged 1 commit into from
Jul 26, 2024

Conversation

darkwater
Copy link
Contributor

GLArea.has-alpha defaults to false, which makes it impossible for a Flutter app to be transparent.

The additional change to glClearColor is to prevent a black flash when the application starts, before Flutter widgets become visible. This will also affect applications that aren't transparent, by showing the default GTK background color instead of black. This will not make the window transparent, because the developer currently has to add some code to their linux/my_application.cc to support transparency.

Fixes flutter/flutter#152154

Transparent windows were possible before #50754. Would it be ok to add a test for this to prevent breaking transparency again in the future?

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 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.

The additional change to glClearColor is to prevent a black flash when
the application starts, before Flutter widgets become visible.
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Contributor

@robert-ancell robert-ancell left a comment

Choose a reason for hiding this comment

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

Great! I hadn't noticed that.

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

Oh nice! We were just discussing this issue other day! Thanks for the fix. lgtm!

LGTM stamp from a Japanese personal seal

@cbracken cbracken added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 26, 2024
@auto-submit auto-submit bot merged commit 0844c0a into flutter:main Jul 26, 2024
27 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 26, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 26, 2024
…152388)

flutter/engine@354abf2...e28f875

2024-07-26 [email protected] [DisplayList] Optimize ClipRRect and ClipPath to ClipOval when appropriate (flutter/engine#54088)
2024-07-26 [email protected] Set GLArea.has-alpha = true (flutter/engine#54053)

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],[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
@Hixie
Copy link
Contributor

Hixie commented Jul 28, 2024

This will also affect applications that aren't transparent, by showing the default GTK background color instead of black.

This is a regression -- the default behaviour of a Flutter app that paints nothing is a black window. This breaks applications that depend on the default background being black.

@Hixie
Copy link
Contributor

Hixie commented Jul 28, 2024

Can we revert this? It landed without tests and with no test exemption and regressed behaviour.

@cbracken
Copy link
Member

Reason for revert: Regression no tests. Must have been at the end of a long day, cause I missed the missing test and glaring warning about that.

@darkwater see the MacOS implementation (On FlutterViewController) and the tests in shell/platform/darwin/macos/framework/Source/FlutterEngineTest.mm for how you might approach testing this. It's fine to offer the ability to set the background colour of the view via API exposed to the Runner, but the default should remain black.

@cbracken cbracken added the revert Label used to revert changes in a closed and merged pull request. label Jul 29, 2024
Copy link
Contributor

auto-submit bot commented Jul 29, 2024

Time to revert pull request flutter/engine/54053 has elapsed.
You need to open the revert manually and process as a regular pull request.

@auto-submit auto-submit bot removed the revert Label used to revert changes in a closed and merged pull request. label Jul 29, 2024
cbracken added a commit to cbracken/flutter_engine that referenced this pull request Jul 29, 2024
Reason for revert: Regression   no tests. Must have been at the end of a
long day, cause I missed the missing test and glaring warning about
that.

This reverts commit 0844c0a.
@cbracken
Copy link
Member

Revert out in #54190

auto-submit bot pushed a commit that referenced this pull request Jul 29, 2024
Reason for revert: Regression   no tests. Must have been at the end of a long day, cause I missed the missing test and glaring warning about that.

This reverts commit 0844c0a.

Re-opens flutter/flutter#152154

[C  , Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…lutter#152388)

flutter/engine@354abf2...e28f875

2024-07-26 [email protected] [DisplayList] Optimize ClipRRect and ClipPath to ClipOval when appropriate (flutter/engine#54088)
2024-07-26 [email protected] Set GLArea.has-alpha = true (flutter/engine#54053)

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],[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
@robert-ancell
Copy link
Contributor

This was fixes as part of #54575

Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…lutter#152388)

flutter/engine@354abf2...e28f875

2024-07-26 [email protected] [DisplayList] Optimize ClipRRect and ClipPath to ClipOval when appropriate (flutter/engine#54088)
2024-07-26 [email protected] Set GLArea.has-alpha = true (flutter/engine#54053)

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],[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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: desktop autosubmit Merge PR when tree becomes green via auto submit App platform-linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can no longer make windows transparent on Linux in Flutter 3.22
4 participants