summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandwlshellintegration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/extensions/qwaylandwlshellintegration.cpp')
-rw-r--r--src/compositor/extensions/qwaylandwlshellintegration.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/compositor/extensions/qwaylandwlshellintegration.cpp b/src/compositor/extensions/qwaylandwlshellintegration.cpp
index b732069c4..724580e24 100644
--- a/src/compositor/extensions/qwaylandwlshellintegration.cpp
+++ b/src/compositor/extensions/qwaylandwlshellintegration.cpp
@@ -289,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));
@@ -318,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) {