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

Add option to enable/disable WS_CLIPCHILDREN window style #3212

Merged

Conversation

amrbashir
Copy link
Contributor

@amrbashir amrbashir commented Nov 6, 2023

While working on tauri-apps/wry#1041 which allows adding the webview as a child window, I noticed that when setting the webview to be transparent, the portion of the parent behind it doesn't render properly and that was because of WS_CLIPCHILDREN

  • Tested on all platforms changed
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

While working on tauri-apps/wry#1041 which allows adding the webview as a child window, I noticed that when setting the webview to be transparent, the portion of the parent behind it doesn't render properly and that was because of `WS_CLIPCHILDREN`
@kchibisov kchibisov added this to the Version 0.29.4 milestone Nov 6, 2023
@notgull
Copy link
Member

notgull commented Nov 7, 2023

Why was WS_CLIPCHILDREN added in the first place? I'm at the gym right now so I can't do an in depth blame.

Copy link
Member

@msiglreith msiglreith left a comment

Choose a reason for hiding this comment

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

This will break child rendering in non-special cases. The parent window can now overdraw the child window.

@amrbashir
Copy link
Contributor Author

Would it make more sense to make this configurable? and what should the default behavior be?

@msiglreith
Copy link
Member

I would prefer to avoid adding a config for this as it just increases the api surface - I can try to look a bit at the weekend if there is a better solution, atm unsure how alpha blended composition is done in detail here to achieve the desired effect

@kchibisov kchibisov removed this from the Version 0.29.4 milestone Nov 23, 2023
@msiglreith
Copy link
Member

After trying various options1, getting the compositor to alpha blend a child window is quite a challenge.. unsure if it's possible in a generalized way. Therefore I'm currently leaning towards a backend specific option to disable certain style flags.

Footnotes

  1. I managed to freeze my system completely with one approach involving WS_EX_LAYERED in a reproducible way..

@kchibisov
Copy link
Member

If that will be the resolution, I'd probably suggest to put this thing on hold, until better days/0.30.0.

@amrbashir
Copy link
Contributor Author

Therefore I'm currently leaning towards a backend specific option to disable certain style flags.

I will add that once I get some time, but should WS_CLIPCHILDREN be present by default and disabled by the platform specific API or the other way around?

@msiglreith
Copy link
Member

Thanks, WS_CLIPCHILDREN should be enabled by default.

@amrbashir
Copy link
Contributor Author

alright, should be good to go now.

@amrbashir amrbashir changed the title Remove WS_CLIPCHILDREN from window style Add option to enable/disable WS_CLIPCHILDREN window style Dec 14, 2023
@msiglreith msiglreith merged commit 10a7850 into rust-windowing:master Jan 22, 2024
51 checks passed
jpedrick pushed a commit to jpedrick/winit that referenced this pull request Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants