From e77341d1285cdfbe306493b5fc9c276dbcec0012 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Thu, 8 Dec 2022 15:36:27 +0800 Subject: [PATCH] win: adjust one version condition It's decided that the fix will not be cherry-picked to the 6.2 branch. Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- src/core/framelesshelper_win.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/framelesshelper_win.cpp b/src/core/framelesshelper_win.cpp index 98b4344..8ba95bd 100644 --- a/src/core/framelesshelper_win.cpp +++ b/src/core/framelesshelper_win.cpp @@ -1125,11 +1125,11 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me windowPos->flags |= SWP_NOCOPYBITS; } break; #endif -#if ((QT_VERSION <= QT_VERSION_CHECK(6, 2, 7)) || ((QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)) && (QT_VERSION <= QT_VERSION_CHECK(6, 4, 2)))) +#if (QT_VERSION <= QT_VERSION_CHECK(6, 4, 2)) case WM_GETDPISCALEDSIZE: { // QtBase commit 2cfca7fd1911cc82a22763152c04c65bc05bc19a introduced a bug // which caused the custom margins is ignored during the handling of the - // WM_GETDPISCALEDSIZE message, it was shipped with Qt 6.2.1 ~ 6.2.7 & 6.3 ~ 6.4.2. + // WM_GETDPISCALEDSIZE message, it was shipped with Qt 6.2.1 ~ 6.4.2. // We workaround it by overriding the wrong handling directly. RECT clientRect = {}; if (GetClientRect(hWnd, &clientRect) == FALSE) { @@ -1162,7 +1162,7 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me *result = TRUE; // We have set our preferred window size, don't use the default linear DPI scaling. return true; // Jump over Qt's wrong handling logic. } -#endif // ((QT_VERSION <= QT_VERSION_CHECK(6, 2, 7)) || ((QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)) && (QT_VERSION <= QT_VERSION_CHECK(6, 4, 2)))) +#endif // (QT_VERSION <= QT_VERSION_CHECK(6, 4, 2)) case WM_DPICHANGED: { const Dpi dpi = {UINT(LOWORD(wParam)), UINT(HIWORD(wParam))}; DEBUG.noquote() << "New DPI for window" << hwnd2str(hWnd) << "is" << dpi;