diff options
Diffstat (limited to 'src/compositor/extensions/qwaylandwlshellintegration.cpp')
-rw-r--r-- | src/compositor/extensions/qwaylandwlshellintegration.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/compositor/extensions/qwaylandwlshellintegration.cpp b/src/compositor/extensions/qwaylandwlshellintegration.cpp index 99a2e7655..724580e24 100644 --- a/src/compositor/extensions/qwaylandwlshellintegration.cpp +++ b/src/compositor/extensions/qwaylandwlshellintegration.cpp @@ -198,7 +198,8 @@ void WlShellIntegration::handleSetPopup(QWaylandSeat *seat, QWaylandSurface *par // Find the parent item on the same output QWaylandQuickShellSurfaceItem *parentItem = nullptr; - Q_FOREACH (QWaylandView *view, parent->views()) { + const auto views = parent->views(); + for (QWaylandView *view : views) { if (view->output() == m_item->view()->output()) { QWaylandQuickShellSurfaceItem *item = qobject_cast<QWaylandQuickShellSurfaceItem*>(view->renderObject()); if (item) { @@ -288,7 +289,19 @@ void WlShellIntegration::adjustOffsetForNextFrame(const QPointF &offset) moveItem->setPosition(moveItem->position() + m_item->mapFromSurface(offset)); } -bool WlShellIntegration::mouseMoveEvent(QMouseEvent *event) +bool WlShellIntegration::eventFilter(QObject *object, QEvent *event) +{ + if (event->type() == QEvent::MouseMove) { + QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); + return filterMouseMoveEvent(mouseEvent); + } else if (event->type() == QEvent::MouseButtonRelease) { + QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); + return filterMouseReleaseEvent(mouseEvent); + } + return QWaylandQuickShellIntegration::eventFilter(object, event); +} + +bool WlShellIntegration::filterMouseMoveEvent(QMouseEvent *event) { if (grabberState == GrabberState::Resize) { Q_ASSERT(resizeState.seat == m_item->compositor()->seatFor(event)); @@ -317,7 +330,7 @@ bool WlShellIntegration::mouseMoveEvent(QMouseEvent *event) return false; } -bool WlShellIntegration::mouseReleaseEvent(QMouseEvent *event) +bool WlShellIntegration::filterMouseReleaseEvent(QMouseEvent *event) { Q_UNUSED(event); if (grabberState != GrabberState::Default) { |