Disable undocumented Acrylic effect; Users are complaining about performance

main
Peter Repukat 3 years ago
parent 76a6f182a7
commit 86d9a172db

@ -104,29 +104,29 @@ int main(int argc, char* argv[])
bb.hRgnBlur = nullptr;
DwmEnableBlurBehindWindow(hwnd, &bb);
if (IsWindows10OrGreater()) {
// undoc stuff for aero >= Win10
int color = (0 << 24) + (0x21 << 16) + (0x11 << 8) + (0x11);
AccentPolicy accPol{};
accPol.AccentState = ACCENT_ENABLE_ACRYLICBLURBEHIND;
accPol.AccentFlags = 2;
accPol.GradientColor = color;
accPol.AnimationId = 0;
WindowCompositionAttributeData data{};
data.Attribute = WindowCompositionAttribute::WCA_ACCENT_POLICY;
data.Data = &accPol;
data.SizeOfData = sizeof(accPol);
auto user32dll = GetModuleHandle(L"user32.dll");
if (user32dll) {
PSetWindowCompositionAttribute SetWindowCompositionAttribute = (reinterpret_cast<PSetWindowCompositionAttribute>(GetProcAddress(user32dll, "SetWindowCompositionAttribute")));
if (SetWindowCompositionAttribute) {
auto res = SetWindowCompositionAttribute(hwnd, &data);
if (SUCCEEDED(res)) {
uimodel.setAcrylicEffect(true);
}
}
}
}
//if (IsWindows10OrGreater()) {
// // undoc stuff for aero >= Win10
// int color = (0 << 24) + (0x21 << 16) + (0x11 << 8) + (0x11);
// AccentPolicy accPol{};
// accPol.AccentState = ACCENT_ENABLE_ACRYLICBLURBEHIND;
// accPol.AccentFlags = 2;
// accPol.GradientColor = color;
// accPol.AnimationId = 0;
// WindowCompositionAttributeData data{};
// data.Attribute = WindowCompositionAttribute::WCA_ACCENT_POLICY;
// data.Data = &accPol;
// data.SizeOfData = sizeof(accPol);
// auto user32dll = GetModuleHandle(L"user32.dll");
// if (user32dll) {
// PSetWindowCompositionAttribute SetWindowCompositionAttribute = (reinterpret_cast<PSetWindowCompositionAttribute>(GetProcAddress(user32dll, "SetWindowCompositionAttribute")));
// if (SetWindowCompositionAttribute) {
// auto res = SetWindowCompositionAttribute(hwnd, &data);
// if (SUCCEEDED(res)) {
// uimodel.setAcrylicEffect(true);
// }
// }
// }
//}
// extend the frame fully into the client area => draw all outside the window frame.
MARGINS margins = {-1};

Loading…
Cancel
Save