Commit b7a6d509 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

RemoteDesktop: Implement touch

parent 1df10772
......@@ -264,12 +264,39 @@ void RemoteDesktopPortal::NotifyKeyboardKeycode(const QDBusObjectPath &session_h
void RemoteDesktopPortal::NotifyTouchDown(const QDBusObjectPath &session_handle, const QVariantMap &options, uint stream, uint slot, int x, int y)
{
Q_UNUSED(options)
Q_UNUSED(stream)
RemoteDesktopSession *session = qobject_cast<RemoteDesktopSession *>(Session::getSession(session_handle.path()));
if (!session) {
qCWarning(XdgDesktopPortalKdeRemoteDesktop) << "Tried to call NotifyPointerAxisDiscrete on non-existing session " << session_handle.path();
return;
}
WaylandIntegration::requestTouchDown(slot, QPoint(x, y));
}
void RemoteDesktopPortal::NotifyTouchMotion(const QDBusObjectPath &session_handle, const QVariantMap &options, uint stream, uint slot, int x, int y)
{
Q_UNUSED(options)
Q_UNUSED(stream)
RemoteDesktopSession *session = qobject_cast<RemoteDesktopSession *>(Session::getSession(session_handle.path()));
if (!session) {
qCWarning(XdgDesktopPortalKdeRemoteDesktop) << "Tried to call NotifyPointerAxisDiscrete on non-existing session " << session_handle.path();
return;
}
WaylandIntegration::requestTouchMotion(slot, QPoint(x, y));
}
void RemoteDesktopPortal::NotifyTouchUp(const QDBusObjectPath &session_handle, const QVariantMap &options, uint slot)
{
Q_UNUSED(options)
RemoteDesktopSession *session = qobject_cast<RemoteDesktopSession *>(Session::getSession(session_handle.path()));
if (!session) {
qCWarning(XdgDesktopPortalKdeRemoteDesktop) << "Tried to call NotifyPointerAxisDiscrete on non-existing session " << session_handle.path();
return;
}
WaylandIntegration::requestTouchUp(slot);
}
......@@ -170,6 +170,21 @@ void WaylandIntegration::requestKeyboardKeycode(int keycode, bool state)
globalWaylandIntegration->requestKeyboardKeycode(keycode, state);
}
void WaylandIntegration::requestTouchDown(quint32 touchPoint, const QPointF &pos)
{
globalWaylandIntegration->requestTouchDown(touchPoint, pos);
}
void WaylandIntegration::requestTouchMotion(quint32 touchPoint, const QPointF &pos)
{
globalWaylandIntegration->requestTouchMotion(touchPoint, pos);
}
void WaylandIntegration::requestTouchUp(quint32 touchPoint)
{
globalWaylandIntegration->requestTouchUp(touchPoint);
}
QMap<quint32, WaylandIntegration::WaylandOutput> WaylandIntegration::screens()
{
return globalWaylandIntegration->screens();
......@@ -429,6 +444,27 @@ void WaylandIntegration::WaylandIntegrationPrivate::requestKeyboardKeycode(int k
}
}
void WaylandIntegration::WaylandIntegrationPrivate::requestTouchDown(quint32 touchPoint, const QPointF &pos)
{
if (m_streamInput && m_fakeInput) {
m_fakeInput->requestTouchDown(touchPoint, pos);
}
}
void WaylandIntegration::WaylandIntegrationPrivate::requestTouchMotion(quint32 touchPoint, const QPointF &pos)
{
if (m_streamInput && m_fakeInput) {
m_fakeInput->requestTouchMotion(touchPoint, pos);
}
}
void WaylandIntegration::WaylandIntegrationPrivate::requestTouchUp(quint32 touchPoint)
{
if (m_streamInput && m_fakeInput) {
m_fakeInput->requestTouchUp(touchPoint);
}
}
QMap<quint32, WaylandIntegration::WaylandOutput> WaylandIntegration::WaylandIntegrationPrivate::screens()
{
return m_outputMap;
......
......@@ -145,6 +145,10 @@ void requestPointerAxisDiscrete(Qt::Orientation axis, qreal delta);
void requestKeyboardKeycode(int keycode, bool state);
void requestTouchDown(quint32 touchPoint, const QPointF &pos);
void requestTouchMotion(quint32 touchPoint, const QPointF &pos);
void requestTouchUp(quint32 touchPoint);
QMap<quint32, WaylandOutput> screens();
void setParentWindow(QWindow *window, const QString &parentWindow);
......
......@@ -77,6 +77,9 @@ public:
void requestPointerMotionAbsolute(const QPointF &pos);
void requestPointerAxisDiscrete(Qt::Orientation axis, qreal delta);
void requestKeyboardKeycode(int keycode, bool state);
void requestTouchDown(quint32 touchPoint, const QPointF &pos);
void requestTouchMotion(quint32 touchPoint, const QPointF &pos);
void requestTouchUp(quint32 touchPoint);
QMap<quint32, WaylandOutput> screens();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment