Allow dragging of a floating dockwidget on macOS with a custom titlebar

This amends 3224c6d7d150164241c13ccf7d47377a39c0a6bb to account for the
case when the dockwidget is already floating.

Task-number: QTBUG-70137
Change-Id: If8b345565b11b44beb3fb4b697cfe812c29c6396
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ba3e1fe09b7d921985e21d857a1d566465095e69)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Andy Shaw 2021-08-02 14:43:21 +02:00 committed by Qt Cherry-pick Bot
parent a609761b71
commit 31afbef68c

View File

@ -972,7 +972,7 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event)
> QApplication::startDragDistance()) {
#ifdef Q_OS_MACOS
if (windowHandle()) {
if (windowHandle() && !q->isFloating()) {
// When using native widgets on mac, we have not yet been successful in
// starting a drag on an NSView that belongs to one window (QMainWindow),
// but continue the drag on another (QDockWidget). This is what happens if