Fix FloatingWindow::isInDragArea() returning false even with HTCAPTION

If the last clicked position is HTCAPTION then we're sure we're
dragging. Problem with comparing the rect is that mouse events are
async, and by the time we use the mouse event pos the window is already
somewhere else. So just use HTCAPTION, which is 100% correct.

Fixes #103
This commit is contained in:
Sergio Martins
2021-01-17 16:25:24 +00:00
parent de3ca6dba5
commit a4f6b72157
2 changed files with 3 additions and 2 deletions

View File

@@ -8,6 +8,7 @@
- Added Config::Flag_CloseOnlyCurrentTab
- PySide6 support
- Layout restorer now restores maximzied/minimized state too (#81)
- Fixed dock indicators sometimes not appearing on Windows (#103)
* v1.2.1 (unreleased)
- Support for resizing dock widgets when they are in overlay/popup mode (autohide/sidebar feature)

View File

@@ -301,8 +301,8 @@ bool FloatingWindow::isInDragArea(QPoint globalPoint) const
// A click near the border will still send a Qt::NonClientMousePressEvent. We shouldn't
// interpret that as a drag, as it's for a native resize.
// Keep track of how we handled the WM_NCHITTEST
if (m_lastHitTest != 0 && m_lastHitTest != HTCAPTION)
return false;
if (usesAeroSnapWithCustomDecos())
return m_lastHitTest == HTCAPTION;
#endif
return dragRect().contains(globalPoint);