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

Loading…
Cancel
Save