From 62aead3855dc38f922d3e526c5d7f5709d13b8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Tue, 27 Feb 2024 14:02:02 +0800 Subject: [PATCH] fix bug --- src/FluFramelessHelper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FluFramelessHelper.cpp b/src/FluFramelessHelper.cpp index 835fda36..6dd0ea9c 100644 --- a/src/FluFramelessHelper.cpp +++ b/src/FluFramelessHelper.cpp @@ -116,7 +116,8 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void * short y = HIWORD(msg->lParam); int margins = _helper->getMargins(); QPointer win = _helper->window; - QPoint pos = win->mapFromGlobal(QPoint(x, y)); + qreal dp = _helper->window->devicePixelRatio(); + QPoint pos = win->mapFromGlobal(QPoint(x/dp, y/dp)); bool left = pos.x() < margins; bool right = pos.x() > win->width() - margins; bool top = pos.y() < margins;