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()
target_link_libraries(${PROJECT_NAME} PRIVATE
Qt${QT_VERSION_MAJOR}::X11Extras
X11
)
endif()
endif()

View File

@ -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;