The DWM workaround is not needed when DWM composition is disabled

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-01-03 11:03:24 +08:00
parent 9904a5077a
commit c3c5ef0d5d
1 changed files with 58 additions and 56 deletions

View File

@ -376,7 +376,8 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
// is not correct. It confuses QPA's internal logic.
clientRect->bottom += 1;
#endif
// Dirty hack to workaround the DWM flicker.
if (Utilities::isDwmCompositionAvailable()) {
// Dirty hack to workaround the resize flicker caused by DWM.
LARGE_INTEGER freq = {};
if (QueryPerformanceFrequency(&freq) == FALSE) {
qWarning() << Utilities::getSystemErrorMessage(QStringLiteral("QueryPerformanceFrequency"));
@ -433,6 +434,7 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
qWarning() << "timeEndPeriod() failed.";
break;
}
}
// We cannot return WVR_REDRAW otherwise Windows exhibits bugs where
// client pixels and child windows are mispositioned by the width/height
// of the upper-left nonclient area.