From a4f6b7215741cd4e64c8a2c8a66989010e7cb652 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Sun, 17 Jan 2021 16:25:24 +0000 Subject: [PATCH] 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 --- Changelog | 1 + src/private/FloatingWindow.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 8d7a99bf..7b0634db 100644 --- a/Changelog +++ b/Changelog @@ -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) diff --git a/src/private/FloatingWindow.cpp b/src/private/FloatingWindow.cpp index 73b4fa2c..45e52bd1 100644 --- a/src/private/FloatingWindow.cpp +++ b/src/private/FloatingWindow.cpp @@ -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);