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

AcrylicBlur does not work on Windows11 10.0.22631 #17684

Open
NeverMorewd opened this issue Dec 4, 2024 · 1 comment
Open

AcrylicBlur does not work on Windows11 10.0.22631 #17684

NeverMorewd opened this issue Dec 4, 2024 · 1 comment

Comments

@NeverMorewd
Copy link
Contributor

Describe the bug

Windows 11 professional edition
10.0.22631 build 22631

screenshot:
image

To Reproduce

code:
AcrylicBlurIssueWin11.zip

Expected behavior

No response

Avalonia version

11.2.2

OS

Windows

Additional context

The issue likely isn't specific to Avaloniaui, as I've encountered a similar problem in my WPF application.
Here is my code about AcrylicBlur in wpf.

var accent = new AccentPolicy
{
    AccentState = AccentState.ACCENT_ENABLE_ACRYLICBLURBEHIND,
    GradientColor = _blurColor
};
var accentPolicySize = Marshal.SizeOf(accent);
var accentPtr = Marshal.AllocHGlobal(accentPolicySize);
Marshal.StructureToPtr(accent, accentPtr, false);
try
{
    var data = new WindowCompositionAttributeData
    {
        Attribute = WindowCompositionAttribute.WCA_ACCENT_POLICY,
        SizeOfData = accentPolicySize,
        Data = accentPtr,
    };
    SetWindowCompositionAttribute(handle, ref data);
}
finally
{
    Marshal.FreeHGlobal(accentPtr);
}
@NeverMorewd NeverMorewd added the bug label Dec 4, 2024
@NeverMorewd
Copy link
Contributor Author

#6465

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

No branches or pull requests

2 participants