From e77a2db663a0a60bf75bef83de162b8528470f02 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Tue, 4 Oct 2022 08:53:12 +0800 Subject: [PATCH] Revert "fix multiple issues found by user" This reverts commit c0ce7b0f48cb23d2aa7e5d1c1c76ec0ea6db6c4f. Reason for revert: the fix is totally wrong, as it's trying to fix a bug which never exists, what's worse, the wrong fix itself is also causing critical regressions. so revert it immediately. But the QMake modifications are correct and necessary, so don't revert that part. Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- src/widgets/framelesswidgetshelper.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/widgets/framelesswidgetshelper.cpp b/src/widgets/framelesswidgetshelper.cpp index c348678..78b8694 100644 --- a/src/widgets/framelesswidgetshelper.cpp +++ b/src/widgets/framelesswidgetshelper.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -553,7 +552,7 @@ bool FramelessWidgetsHelperPrivate::isInSystemButtons(const QPoint &pos, SystemB return false; } -bool FramelessWidgetsHelperPrivate::isInTitleBarDraggableArea(const QPoint &localPos) const +bool FramelessWidgetsHelperPrivate::isInTitleBarDraggableArea(const QPoint &pos) const { const WidgetsHelperData data = getWindowData(); if (!data.titleBarWidget) { @@ -598,14 +597,7 @@ bool FramelessWidgetsHelperPrivate::isInTitleBarDraggableArea(const QPoint &loca } } } - if (!region.contains(localPos)) { - return false; - } - const QPoint globalPos = m_window->mapToGlobal(localPos); - // Don't move the window if the user is dragging something above the title bar widget, - // according to the Qt documentation, QApplication::widgetAt() can be slow, but we really - // can't avoid calling it here. - return (QApplication::widgetAt(globalPos) == data.titleBarWidget); + return region.contains(pos); } bool FramelessWidgetsHelperPrivate::shouldIgnoreMouseEvents(const QPoint &pos) const