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 DWMWA_SYSTEMBACKDROP_TYPE support on Windows #3257

Merged
merged 10 commits into from
Jan 25, 2024
Merged

Add DWMWA_SYSTEMBACKDROP_TYPE support on Windows #3257

merged 10 commits into from
Jan 25, 2024

Conversation

Dubzer
Copy link
Contributor

@Dubzer Dubzer commented Dec 5, 2023

  • 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

With this code, it will be possible to apply the Acrylic and the Mica backdrop material effect

Tested on Windows 11 build 22631.2715, using new API in the Alacritty source code.

image

@Dubzer Dubzer requested a review from msiglreith as a code owner December 5, 2023 10:35
@Dubzer
Copy link
Contributor Author

Dubzer commented Jan 8, 2024

@msiglreith would you mind taking a look? 👀

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.

Thanks, lgtm - unable to test it as I don't have Windows 11 installed, on older builds it returns an unsupported parameter error but doesn't cause any issues.

Keeping it on hold (similar to other PRs with backend specific extensions) as there is a larger API change planned for the next version #3367

@madsmtm
Copy link
Member

madsmtm commented Jan 9, 2024

larger API change planned for the next version #3367

I don't think you should block on that, we still need to do a lot more discussion before we're prepared to do the API rework.

@Dubzer
Copy link
Contributor Author

Dubzer commented Jan 24, 2024

@msiglreith would you like for me to resolve merge conflicts?

@msiglreith
Copy link
Member

@Dubzer yes, please!

# Conflicts:
#	src/platform/windows.rs
#	src/platform_impl/windows/mod.rs
#	src/platform_impl/windows/window.rs
@Dubzer
Copy link
Contributor Author

Dubzer commented Jan 25, 2024

@Dubzer yes, please!

Done

@msiglreith msiglreith merged commit 98d3391 into rust-windowing:master Jan 25, 2024
51 checks passed
jpedrick pushed a commit to jpedrick/winit that referenced this pull request Jan 25, 2024
@MarijnS95
Copy link
Member

@Dubzer since you tested this inside Alacritty, did you ever open a PR to enable it? Perhaps behind [window] blur?

@Dubzer
Copy link
Contributor Author

Dubzer commented Jul 30, 2024

@MarijnS95 actually I didn't. I was waiting for the winit version to be updated and then I forgot lol. It should be pretty easy to add such a flag if you want to contribute it yourself.

@MarijnS95
Copy link
Member

@Dubzer the plan is to back this platform extension out entirely "lol". There's an API-agnostic set_blur() that's currently only implemented on MacOS, which should be generalized and use DWM SBD implemented here (or one of the many other Windows fallbacks on older versions... Thanks Windows). Then we can finally close #538 for real.

@Dubzer
Copy link
Contributor Author

Dubzer commented Aug 1, 2024

@MarijnS95 Sorry, I'm out of context and not really sure about the current plans for set_blur.
The reason I made SBD as a platform extension is because DWM on modern Windows versions does not implement the background blur effect. Instead, currently there are two different effects: Acrylic and Mica (also Mica Alt variation)

Acrylic is similar to blur in that it shows what's behind the window on the z-axis. But it's still a different, more complex effect. Here's a breakdown of it from the design docs:

image

And Mica doesn't show what's behind a window at all. It blends the desktop background into the window background:

image

Given all these factors, I'm not sure how you want to integrate DWM SBD into the set_blur API without creating unexpected results for the user and keeping all the material selection options available

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