From cfb961408b7bde47cdb3fabafed2fca5f7ca2538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Tue, 12 Mar 2024 16:14:10 +0800 Subject: [PATCH] update --- src/FluFramelessHelper.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/FluFramelessHelper.cpp b/src/FluFramelessHelper.cpp index 3bdad22c..a7f94c38 100644 --- a/src/FluFramelessHelper.cpp +++ b/src/FluFramelessHelper.cpp @@ -167,14 +167,15 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void * return true; }else if(uMsg == WM_GETMINMAXINFO && QT_VERSION < QT_VERSION_CHECK(6,0,0)){ MINMAXINFO* minmaxInfo = reinterpret_cast(lParam); + auto pixelRatio = _helper->window->devicePixelRatio(); + auto geometry = _helper->window->screen()->availableGeometry(); RECT rect; SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0); - int cx = rect.right - rect.left + offsetXY.x()*2; - int cy = rect.bottom - rect.top + offsetXY.y()*2; minmaxInfo->ptMaxPosition.x = rect.left - offsetXY.x(); minmaxInfo->ptMaxPosition.y = rect.top - offsetXY.x(); - minmaxInfo->ptMaxSize.x = cx; - minmaxInfo->ptMaxSize.y = cy; + minmaxInfo->ptMaxSize.x = geometry.width()*pixelRatio + offsetXY.x() * 2; + minmaxInfo->ptMaxSize.y = geometry.height()*pixelRatio + offsetXY.y() * 2; + }else if(uMsg == WM_NCRBUTTONDOWN){ if (wParam == HTCAPTION) { _helper->showSystemMenu(QCursor::pos());