Fix direct link build for WNEF.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
e1656a9636
commit
c95e8fc806
|
@ -2306,9 +2306,7 @@ bool WinNativeEventFilter::setAcrylicEffectEnabled(void *handle, const bool enab
|
|||
Q_ASSERT(handle);
|
||||
const auto hwnd = reinterpret_cast<HWND>(handle);
|
||||
if (WNEF_EXECUTE_WINAPI_RETURN(IsWindow, FALSE, hwnd)) {
|
||||
DWM_BLURBEHIND dwmBB;
|
||||
SecureZeroMemory(&dwmBB, sizeof(dwmBB));
|
||||
dwmBB.dwFlags = DWM_BB_ENABLE;
|
||||
if (isWin8OrGreater() && coreData()->m_lpSetWindowCompositionAttribute) {
|
||||
ACCENT_POLICY accentPolicy;
|
||||
SecureZeroMemory(&accentPolicy, sizeof(accentPolicy));
|
||||
WINDOWCOMPOSITIONATTRIBDATA wcaData;
|
||||
|
@ -2326,22 +2324,19 @@ bool WinNativeEventFilter::setAcrylicEffectEnabled(void *handle, const bool enab
|
|||
// Windows 10, version 1507 (10.0.10240)
|
||||
// The initial version of Win10.
|
||||
accentPolicy.AccentState = ACCENT_ENABLE_BLURBEHIND;
|
||||
} else if (isWin8OrGreater()) {
|
||||
} else {
|
||||
// Windows 8 and 8.1.
|
||||
accentPolicy.AccentState = ACCENT_ENABLE_TRANSPARENTGRADIENT;
|
||||
} else {
|
||||
// Windows 7
|
||||
dwmBB.fEnable = TRUE;
|
||||
}
|
||||
} else {
|
||||
if (isWin8OrGreater()) {
|
||||
accentPolicy.AccentState = ACCENT_DISABLED;
|
||||
} else {
|
||||
dwmBB.fEnable = FALSE;
|
||||
}
|
||||
}
|
||||
if (isWin8OrGreater()) {
|
||||
return WNEF_EXECUTE_WINAPI_RETURN(SetWindowCompositionAttribute, FALSE, hwnd, &wcaData);
|
||||
return coreData()->m_lpSetWindowCompositionAttribute(hwnd, &wcaData);
|
||||
} else {
|
||||
DWM_BLURBEHIND dwmBB;
|
||||
SecureZeroMemory(&dwmBB, sizeof(dwmBB));
|
||||
dwmBB.dwFlags = DWM_BB_ENABLE;
|
||||
dwmBB.fEnable = enabled ? TRUE : FALSE;
|
||||
return SUCCEEDED(
|
||||
WNEF_EXECUTE_WINAPI_RETURN(DwmEnableBlurBehindWindow, E_FAIL, hwnd, &dwmBB));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue