Skip to content

Add DWMWA_SYSTEMBACKDROP_TYPE support on Windows - #3257

Merged
msiglreith merged 10 commits into
rust-windowing:masterfrom
Dubzer:master
Jan 25, 2024
Merged

msiglreith merged 10 commits into
rust-windowing:masterfrom
Dubzer:master

Conversation

@Dubzer

@Dubzer Dubzer commented Dec 5, 2023 •

Copy link
Copy Markdown
Contributor
  • 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
@madsmtm madsmtm added the DS - win32 Affects the Win32/Windows backend label Dec 5, 2023
@Dubzer

Dubzer commented Jan 8, 2024 •

Copy link
Copy Markdown
Contributor Author

@msiglreith would you mind taking a look? 👀

@msiglreith msiglreith left a comment

Copy link
Copy Markdown
Member

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

madsmtm commented Jan 9, 2024

Copy link
Copy Markdown
Member

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

Dubzer commented Jan 24, 2024

Copy link
Copy Markdown
Contributor Author

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

@msiglreith

Copy link
Copy Markdown
Member

@Dubzer yes, please!

# Conflicts:
#	src/platform/windows.rs
#	src/platform_impl/windows/mod.rs
#	src/platform_impl/windows/window.rs
@Dubzer

Dubzer commented Jan 25, 2024

Copy link
Copy Markdown
Contributor Author

@Dubzer yes, please!

Done

@MarijnS95

Copy link
Copy Markdown
Member

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

@Dubzer

Dubzer commented Jul 30, 2024 •

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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

Dubzer commented Aug 1, 2024 •

Copy link
Copy Markdown
Contributor Author

@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

Labels

DS - win32 Affects the Win32/Windows backend

Development

Successfully merging this pull request may close these issues.

4 participants