diff options
| author | Paul Olav Tvete <[email protected]> | 2018-11-05 15:56:47 +0100 |
|---|---|---|
| committer | Liang Qi <[email protected]> | 2018-11-12 13:01:10 +0000 |
| commit | ac4f075274414aac1b6cf2e8e854f0f21fee0761 (patch) | |
| tree | 18a83dcd6d8ebcea5f410228d89074a326871e05 /src/widgets/kernel/qwidgetwindow.cpp | |
| parent | 79ed504f10ba49b19fe9122ae3de4cf652130320 (diff) | |
Make sure mouse release events are delivered to correct widget
The initial mouse press should create an implicit mouse grab so
that all subsequent mouse events are delivered to the widget that
was pressed first. After commit a4f7bb8733e0, every mouse press
would reset the implicit grab. This change checks the previous
button state, and does not reset the mouse grab if other buttons
are already pressed.
Fixes: QTBUG-70816
Change-Id: Icdd215c2f4aaee3c3f34607d68c1d8878155ec17
Reviewed-by: Shawn Rutledge <[email protected]>
Diffstat (limited to 'src/widgets/kernel/qwidgetwindow.cpp')
| -rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 0b2d72f3302..279c6c02823 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -642,7 +642,8 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) if (!widget) widget = m_widget; - if (event->type() == QEvent::MouseButtonPress) + const bool initialPress = event->buttons() == event->button(); + if (event->type() == QEvent::MouseButtonPress && initialPress) qt_button_down = widget; QWidget *receiver = QApplicationPrivate::pickMouseReceiver(m_widget, event->windowPos().toPoint(), &mapped, event->type(), event->buttons(), |
