From c9c737f2fcd9a134f0693aa6dbf890bde3d9ad35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Tue, 16 Apr 2024 12:36:41 +0800 Subject: [PATCH] update --- src/FluFrameless.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/FluFrameless.cpp b/src/FluFrameless.cpp index 0dd19e39..95687548 100644 --- a/src/FluFrameless.cpp +++ b/src/FluFrameless.cpp @@ -161,11 +161,11 @@ void FluFrameless::componentComplete() { if (!isCompositionEnabled()) { offsetSize = 0; } - if (!isMaximum) { + if (!isMaximum || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) { clientRect->top = originalTop + offsetSize; - clientRect->bottom = originalBottom; - clientRect->left = originalLeft; - clientRect->right = originalRight; + clientRect->bottom = originalBottom - offsetSize; + clientRect->left = originalLeft + offsetSize; + clientRect->right = originalRight - offsetSize; } _setMaximizeHovered(false); *result = WVR_REDRAW; @@ -243,6 +243,12 @@ void FluFrameless::componentComplete() { return true; } else if (uMsg == WM_GETMINMAXINFO) { auto *minmaxInfo = reinterpret_cast(lParam); +#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) + minmaxInfo->ptMaxPosition.x = 0; + minmaxInfo->ptMaxPosition.y = 0; + minmaxInfo->ptMaxSize.x = 0; + minmaxInfo->ptMaxSize.y = 0; +#else auto pixelRatio = window()->devicePixelRatio(); auto geometry = window()->screen()->availableGeometry(); RECT rect; @@ -251,6 +257,7 @@ void FluFrameless::componentComplete() { minmaxInfo->ptMaxPosition.y = rect.top - offsetXY.x(); minmaxInfo->ptMaxSize.x = qRound(geometry.width() * pixelRatio) + offsetXY.x() * 2; minmaxInfo->ptMaxSize.y = qRound(geometry.height() * pixelRatio) + offsetXY.y() * 2; +#endif return false; } else if (uMsg == WM_NCRBUTTONDOWN) { if (wParam == HTCAPTION) {