backends/fakeinput: fix time

This commit is contained in:
Xaver Hugl 2022-12-21 02:13:02 +01:00
parent f6b6d3051b
commit 1a8c796536

View file

@ -20,23 +20,22 @@ FakeInputDevice::FakeInputDevice(KWaylandServer::FakeInputDevice *device, QObjec
device->setAuthentication(true); device->setAuthentication(true);
}); });
connect(device, &KWaylandServer::FakeInputDevice::pointerMotionRequested, this, [this](const QPointF &delta) { connect(device, &KWaylandServer::FakeInputDevice::pointerMotionRequested, this, [this](const QPointF &delta) {
// TODO: Fix time const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT pointerMotion(delta, delta, std::chrono::microseconds::zero(), this); Q_EMIT pointerMotion(delta, delta, time, this);
}); });
connect(device, &KWaylandServer::FakeInputDevice::pointerMotionAbsoluteRequested, this, [this](const QPointF &pos) { connect(device, &KWaylandServer::FakeInputDevice::pointerMotionAbsoluteRequested, this, [this](const QPointF &pos) {
// TODO: Fix time const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT pointerMotionAbsolute(pos, std::chrono::microseconds::zero(), this); Q_EMIT pointerMotionAbsolute(pos, time, this);
}); });
connect(device, &KWaylandServer::FakeInputDevice::pointerButtonPressRequested, this, [this](quint32 button) { connect(device, &KWaylandServer::FakeInputDevice::pointerButtonPressRequested, this, [this](quint32 button) {
// TODO: Fix time const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT pointerButtonChanged(button, InputRedirection::PointerButtonPressed, std::chrono::microseconds::zero(), this); Q_EMIT pointerButtonChanged(button, InputRedirection::PointerButtonPressed, time, this);
}); });
connect(device, &KWaylandServer::FakeInputDevice::pointerButtonReleaseRequested, this, [this](quint32 button) { connect(device, &KWaylandServer::FakeInputDevice::pointerButtonReleaseRequested, this, [this](quint32 button) {
// TODO: Fix time const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT pointerButtonChanged(button, InputRedirection::PointerButtonReleased, std::chrono::microseconds::zero(), this); Q_EMIT pointerButtonChanged(button, InputRedirection::PointerButtonReleased, time, this);
}); });
connect(device, &KWaylandServer::FakeInputDevice::pointerAxisRequested, this, [this](Qt::Orientation orientation, qreal delta) { connect(device, &KWaylandServer::FakeInputDevice::pointerAxisRequested, this, [this](Qt::Orientation orientation, qreal delta) {
// TODO: Fix time
InputRedirection::PointerAxis axis; InputRedirection::PointerAxis axis;
switch (orientation) { switch (orientation) {
case Qt::Horizontal: case Qt::Horizontal:
@ -49,20 +48,20 @@ FakeInputDevice::FakeInputDevice(KWaylandServer::FakeInputDevice *device, QObjec
Q_UNREACHABLE(); Q_UNREACHABLE();
break; break;
} }
// TODO: Fix time const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT pointerAxisChanged(axis, delta, 0, InputRedirection::PointerAxisSourceUnknown, std::chrono::microseconds::zero(), this); Q_EMIT pointerAxisChanged(axis, delta, 0, InputRedirection::PointerAxisSourceUnknown, time, this);
}); });
connect(device, &KWaylandServer::FakeInputDevice::touchDownRequested, this, [this](qint32 id, const QPointF &pos) { connect(device, &KWaylandServer::FakeInputDevice::touchDownRequested, this, [this](qint32 id, const QPointF &pos) {
// TODO: Fix time const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT touchDown(id, pos, std::chrono::microseconds::zero(), this); Q_EMIT touchDown(id, pos, time, this);
}); });
connect(device, &KWaylandServer::FakeInputDevice::touchMotionRequested, this, [this](qint32 id, const QPointF &pos) { connect(device, &KWaylandServer::FakeInputDevice::touchMotionRequested, this, [this](qint32 id, const QPointF &pos) {
// TODO: Fix time const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT touchMotion(id, pos, std::chrono::microseconds::zero(), this); Q_EMIT touchMotion(id, pos, time, this);
}); });
connect(device, &KWaylandServer::FakeInputDevice::touchUpRequested, this, [this](qint32 id) { connect(device, &KWaylandServer::FakeInputDevice::touchUpRequested, this, [this](qint32 id) {
// TODO: Fix time const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT touchUp(id, std::chrono::microseconds::zero(), this); Q_EMIT touchUp(id, time, this);
}); });
connect(device, &KWaylandServer::FakeInputDevice::touchCancelRequested, this, [this]() { connect(device, &KWaylandServer::FakeInputDevice::touchCancelRequested, this, [this]() {
Q_EMIT touchCanceled(this); Q_EMIT touchCanceled(this);
@ -71,12 +70,12 @@ FakeInputDevice::FakeInputDevice(KWaylandServer::FakeInputDevice *device, QObjec
Q_EMIT touchFrame(this); Q_EMIT touchFrame(this);
}); });
connect(device, &KWaylandServer::FakeInputDevice::keyboardKeyPressRequested, this, [this](quint32 button) { connect(device, &KWaylandServer::FakeInputDevice::keyboardKeyPressRequested, this, [this](quint32 button) {
// TODO: Fix time const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT keyChanged(button, InputRedirection::KeyboardKeyPressed, std::chrono::microseconds::zero(), this); Q_EMIT keyChanged(button, InputRedirection::KeyboardKeyPressed, time, this);
}); });
connect(device, &KWaylandServer::FakeInputDevice::keyboardKeyReleaseRequested, this, [this](quint32 button) { connect(device, &KWaylandServer::FakeInputDevice::keyboardKeyReleaseRequested, this, [this](quint32 button) {
// TODO: Fix time const auto time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch());
Q_EMIT keyChanged(button, InputRedirection::KeyboardKeyReleased, std::chrono::microseconds::zero(), this); Q_EMIT keyChanged(button, InputRedirection::KeyboardKeyReleased, time, this);
}); });
} }