FIX #92 do not call startSystemMove2 in MousePressEvent (#105)

* FIX #92 do not call startSystemMove2 in MousePressEvent

* Add same fix for QtQuick

Co-authored-by: Julien Maille <julien.maille@data-pixel.com>
This commit is contained in:
Julien 2022-03-29 09:38:20 +02:00 committed by GitHub
parent c49b971983
commit 06c23aaba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 14 deletions

View File

@ -62,7 +62,7 @@ public:
Q_INVOKABLE void showEventHandler(QShowEvent *event); Q_INVOKABLE void showEventHandler(QShowEvent *event);
Q_INVOKABLE void changeEventHandler(QEvent *event); Q_INVOKABLE void changeEventHandler(QEvent *event);
Q_INVOKABLE void paintEventHandler(QPaintEvent *event); Q_INVOKABLE void paintEventHandler(QPaintEvent *event);
Q_INVOKABLE void mousePressEventHandler(QMouseEvent *event); Q_INVOKABLE void mouseMoveEventHandler(QMouseEvent *event);
Q_INVOKABLE void mouseReleaseEventHandler(QMouseEvent *event); Q_INVOKABLE void mouseReleaseEventHandler(QMouseEvent *event);
Q_INVOKABLE void mouseDoubleClickEventHandler(QMouseEvent *event); Q_INVOKABLE void mouseDoubleClickEventHandler(QMouseEvent *event);

View File

@ -280,9 +280,9 @@ bool FramelessQuickWindowPrivate::eventFilter(QObject *object, QEvent *event)
const auto showEvent = static_cast<QShowEvent *>(event); const auto showEvent = static_cast<QShowEvent *>(event);
showEventHandler(showEvent); showEventHandler(showEvent);
} break; } break;
case QEvent::MouseButtonPress: { case QEvent::MouseMove: {
const auto mouseEvent = static_cast<QMouseEvent *>(event); const auto mouseEvent = static_cast<QMouseEvent *>(event);
mousePressEventHandler(mouseEvent); mouseMoveEventHandler(mouseEvent);
} break; } break;
case QEvent::MouseButtonRelease: { case QEvent::MouseButtonRelease: {
const auto mouseEvent = static_cast<QMouseEvent *>(event); const auto mouseEvent = static_cast<QMouseEvent *>(event);
@ -550,7 +550,7 @@ void FramelessQuickWindowPrivate::showEventHandler(QShowEvent *event)
} }
} }
void FramelessQuickWindowPrivate::mousePressEventHandler(QMouseEvent *event) void FramelessQuickWindowPrivate::mouseMoveEventHandler(QMouseEvent *event)
{ {
Q_ASSERT(event); Q_ASSERT(event);
if (!event) { if (!event) {
@ -559,9 +559,6 @@ void FramelessQuickWindowPrivate::mousePressEventHandler(QMouseEvent *event)
if (m_settings.options & Option::DisableDragging) { if (m_settings.options & Option::DisableDragging) {
return; return;
} }
if (event->button() != Qt::LeftButton) {
return;
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
const QPoint scenePos = event->scenePosition().toPoint(); const QPoint scenePos = event->scenePosition().toPoint();
#else #else

View File

@ -63,7 +63,7 @@ public:
Q_INVOKABLE Q_NODISCARD QQuickAnchorLine getTopBorderVerticalCenter() const; Q_INVOKABLE Q_NODISCARD QQuickAnchorLine getTopBorderVerticalCenter() const;
Q_INVOKABLE void showEventHandler(QShowEvent *event); Q_INVOKABLE void showEventHandler(QShowEvent *event);
Q_INVOKABLE void mousePressEventHandler(QMouseEvent *event); Q_INVOKABLE void mouseMoveEventHandler(QMouseEvent *event);
Q_INVOKABLE void mouseReleaseEventHandler(QMouseEvent *event); Q_INVOKABLE void mouseReleaseEventHandler(QMouseEvent *event);
Q_INVOKABLE void mouseDoubleClickEventHandler(QMouseEvent *event); Q_INVOKABLE void mouseDoubleClickEventHandler(QMouseEvent *event);

View File

@ -260,7 +260,7 @@ void FramelessWidgetsHelper::paintEventHandler(QPaintEvent *event)
painter.restore(); painter.restore();
} }
void FramelessWidgetsHelper::mousePressEventHandler(QMouseEvent *event) void FramelessWidgetsHelper::mouseMoveEventHandler(QMouseEvent *event)
{ {
Q_ASSERT(event); Q_ASSERT(event);
if (!event) { if (!event) {
@ -269,9 +269,6 @@ void FramelessWidgetsHelper::mousePressEventHandler(QMouseEvent *event)
if (m_settings.options & Option::DisableDragging) { if (m_settings.options & Option::DisableDragging) {
return; return;
} }
if (event->button() != Qt::LeftButton) {
return;
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
const QPoint scenePos = event->scenePosition().toPoint(); const QPoint scenePos = event->scenePosition().toPoint();
#else #else
@ -739,9 +736,9 @@ bool FramelessWidgetsHelper::eventFilter(QObject *object, QEvent *event)
const auto paintEvent = static_cast<QPaintEvent *>(event); const auto paintEvent = static_cast<QPaintEvent *>(event);
paintEventHandler(paintEvent); paintEventHandler(paintEvent);
} break; } break;
case QEvent::MouseButtonPress: { case QEvent::MouseMove: {
const auto mouseEvent = static_cast<QMouseEvent *>(event); const auto mouseEvent = static_cast<QMouseEvent *>(event);
mousePressEventHandler(mouseEvent); mouseMoveEventHandler(mouseEvent);
} break; } break;
case QEvent::MouseButtonRelease: { case QEvent::MouseButtonRelease: {
const auto mouseEvent = static_cast<QMouseEvent *>(event); const auto mouseEvent = static_cast<QMouseEvent *>(event);