wayland: Switch to SeatInterface::notifyPointerButton()

This commit is contained in:
Vlad Zahorodnii 2021-03-15 20:10:34 +02:00
parent ade861d6de
commit 5c15cca190

View file

@ -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: