fix bug when resizing on handler's edge on Linux

This commit is contained in:
Altair Wei 2021-10-06 17:02:15 +08:00
parent cefae7950d
commit af797125f8
2 changed files with 7 additions and 9 deletions

View File

@ -96,6 +96,7 @@ else()
else() else()
target_link_libraries(${PROJECT_NAME} PRIVATE target_link_libraries(${PROJECT_NAME} PRIVATE
Qt${QT_VERSION_MAJOR}::X11Extras Qt${QT_VERSION_MAJOR}::X11Extras
X11
) )
endif() endif()
endif() endif()

View File

@ -508,16 +508,13 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
startMove(ev->globalPos()); startMove(ev->globalPos());
ev->accept(); ev->accept();
filterOut = true; filterOut = true;
} else if (isClickResizeHandler() && isHoverResizeHandler()) { } else if (isClickResizeHandler()) {
// Start system resize // Start system resize
startResize(ev->globalPos(), m_hoveredFrameSection); //
ev->accept(); // When mouse moves outside resize handler, m_hoveredFrameSection will be
filterOut = true; // set to Qt::NoSection , so we use m_clickedFrameSection instead. This
} // case also takes into account that the mouse moves outside the window
// boundary.
// 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())) {
startResize(ev->globalPos(), m_clickedFrameSection); startResize(ev->globalPos(), m_clickedFrameSection);
ev->accept(); ev->accept();
filterOut = true; filterOut = true;