From 5c15cca190f4fa2c538b945d1ad7aa8506b6405f Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 15 Mar 2021 20:10:34 +0200 Subject: [PATCH] wayland: Switch to SeatInterface::notifyPointerButton() --- src/input.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index bd5ffc9fec..1b88d65b9e 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -292,11 +292,10 @@ public: if (pointerSurfaceAllowed()) { // TODO: can we leak presses/releases here when we move the mouse in between from an allowed surface to // disallowed one or vice versa? - if (event->type() == QEvent::MouseButtonPress) { - seat->notifyPointerPress(nativeButton); - } else { - seat->notifyPointerRelease(nativeButton); - } + const auto state = event->type() == QEvent::MouseButtonPress + ? KWaylandServer::PointerButtonState::Pressed + : KWaylandServer::PointerButtonState::Released; + seat->notifyPointerButton(nativeButton, state); seat->notifyPointerFrame(); } } @@ -1409,11 +1408,11 @@ public: break; } case QEvent::MouseButtonPress: - seat->notifyPointerPress(nativeButton); + seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Pressed); seat->notifyPointerFrame(); break; case QEvent::MouseButtonRelease: - seat->notifyPointerRelease(nativeButton); + seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Released); seat->notifyPointerFrame(); break; default: @@ -1917,11 +1916,11 @@ public: break; } case QEvent::MouseButtonPress: - seat->notifyPointerPress(nativeButton); + seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Pressed); seat->notifyPointerFrame(); break; case QEvent::MouseButtonRelease: - seat->notifyPointerRelease(nativeButton); + seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Released); seat->notifyPointerFrame(); break; default: