Merge branch '1.1'

This commit is contained in:
Sergio Martins
2020-12-10 21:39:54 +00:00
3 changed files with 17 additions and 0 deletions

View File

@@ -297,6 +297,14 @@ MultiSplitter *FloatingWindow::multiSplitter() const
bool FloatingWindow::isInDragArea(QPoint globalPoint) const
{
#ifdef Q_OS_WIN
// 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;
#endif
return dragRect().contains(globalPoint);
}

View File

@@ -55,6 +55,11 @@ public:
const Frame::List frames() const;
DropArea *dropArea() const { return m_dropArea; }
#ifdef Q_OS_WIN
void setLastHitTest(int hitTest) {
m_lastHitTest = hitTest;
}
#endif
/**
* @brief Returns the title bar.
*
@@ -153,6 +158,9 @@ private:
bool m_updatingTitleBarVisibility = false;
QMetaObject::Connection m_layoutDestroyedConnection;
QAbstractNativeEventFilter *m_nchittestFilter = nullptr;
#ifdef Q_OS_WIN
int m_lastHitTest = 0;
#endif
};
}

View File

@@ -257,6 +257,7 @@ bool WidgetResizeHandler::handleWindowsNativeEvent(FloatingWindow *w, const QByt
}
}
w->setLastHitTest(*result);
return *result != 0;
} else if (msg->message == WM_NCLBUTTONDBLCLK) {
if ((Config::self().flags() & Config::Flag_DoubleClickMaximizes)) {