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

fixed transparent windows #833

Merged
merged 1 commit into from
Nov 2, 2023
Merged

fixed transparent windows #833

merged 1 commit into from
Nov 2, 2023

Conversation

Icekey
Copy link
Contributor

@Icekey Icekey commented Nov 1, 2023

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

Checklist

  • This PR will resolve #___
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary
  • It can be built on all targets and pass CI/CD.

Other information

This fix was found in a old unmerged winit pullrequest. This fix removes the buggy inital white background from transparent windows and fixes transparent fullscreen windows too. I tested it on Win10.

@Icekey Icekey requested a review from a team as a code owner November 1, 2023 16:52
@dklassic
Copy link
Contributor

dklassic commented Nov 2, 2023

Does seem to work, thanks for your contribution!

@dklassic dklassic merged commit eedbad3 into tauri-apps:dev Nov 2, 2023
9 checks passed
@amrbashir
Copy link
Member

This PR shouldn't have been merged and should be reverted asap, Layered Windows is complex and has special attributes, in cases, it might be even invisible and cannot be embedded as a child window, so setting this style is not the fix for transparency in this crate. Also Layered Windows delegates the alpha blending to the compositor which is more performant but might conflict with crates like egui, wgpu and so on.

Note that the window is actually transparent, but the surface has not been cleared so you see a white artifact, and to fix this, if you're using a drawing crate like wgpu or egui, you can just clear the surface.

The main problem is that when adding wry to a tao window, you will still see a white background and I think it is the responsibility of wry to clear the surface and I am working on that so the next release of wry should have this fixed and transitively tauri.

@amrbashir
Copy link
Member

Also one of the reasons that transparent example might have artifacts until you resize, is because we enable shadows by default for undecorated window, you can disable that when creating the window and then enabling it back up later and the surface should be clear.

@dklassic
Copy link
Contributor

dklassic commented Nov 2, 2023

@amrbashir sorry about that I'll submit a revert immediately.

dklassic added a commit to dklassic/tao that referenced this pull request Nov 2, 2023
dklassic added a commit to dklassic/tao that referenced this pull request Nov 2, 2023
dklassic added a commit to dklassic/tao that referenced this pull request Nov 2, 2023
amrbashir pushed a commit that referenced this pull request Nov 2, 2023
@Icekey
Copy link
Contributor Author

Icekey commented Nov 2, 2023

@amrbashir good to know that you working on a proper fix. I hope that it will also solve the issue with the buggy tao title, as that is currently main problem when creating an overlay with tauri.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants