From af797125f8cb0ced8eb0e6f721f40dbd9910bbf5 Mon Sep 17 00:00:00 2001 From: Altair Wei Date: Wed, 6 Oct 2021 17:02:15 +0800 Subject: [PATCH] fix bug when resizing on handler's edge on Linux --- CMakeLists.txt | 1 + framelesshelper.cpp | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e93555b..c0b64b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,6 +96,7 @@ else() else() target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::X11Extras + X11 ) endif() endif() diff --git a/framelesshelper.cpp b/framelesshelper.cpp index 8f8463f..7fa9416 100644 --- a/framelesshelper.cpp +++ b/framelesshelper.cpp @@ -508,16 +508,13 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event) startMove(ev->globalPos()); ev->accept(); filterOut = true; - } else if (isClickResizeHandler() && isHoverResizeHandler()) { + } else if (isClickResizeHandler()) { // Start system resize - startResize(ev->globalPos(), m_hoveredFrameSection); - ev->accept(); - filterOut = true; - } - - // This case takes into account that the mouse moves outside the window boundary - QRect windowRect(0, 0, windowSize().width(), windowSize().height()); - if (isClickResizeHandler() && !windowRect.contains(ev->pos())) { + // + // When mouse moves outside resize handler, m_hoveredFrameSection will be + // set to Qt::NoSection , so we use m_clickedFrameSection instead. This + // case also takes into account that the mouse moves outside the window + // boundary. startResize(ev->globalPos(), m_clickedFrameSection); ev->accept(); filterOut = true;