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

Merge branch 'Plasma/5.18'

parents 134cd6e2 cdd01df4
......@@ -268,6 +268,20 @@ void RemoteDesktopPortal::NotifyKeyboardKeycode(const QDBusObjectPath &session_h
int keycode,
uint state)
{
qCDebug(XdgDesktopPortalKdeRemoteDesktop) << "NotifyKeyboardKeycode called with parameters:";
qCDebug(XdgDesktopPortalKdeRemoteDesktop) << " session_handle: " << session_handle.path();
qCDebug(XdgDesktopPortalKdeRemoteDesktop) << " options: " << options;
qCDebug(XdgDesktopPortalKdeRemoteDesktop) << " keycode: " << keycode;
qCDebug(XdgDesktopPortalKdeRemoteDesktop) << " state: " << state;
RemoteDesktopSession *session = qobject_cast<RemoteDesktopSession*>(Session::getSession(session_handle.path()));
if (!session) {
qCWarning(XdgDesktopPortalKdeRemoteDesktop) << "Tried to call NotifyKeyboardKeycode on non-existing session " << session_handle.path();
return;
}
WaylandIntegration::requestKeyboardKeycode(keycode, state != 0);
}
void RemoteDesktopPortal::NotifyTouchDown(const QDBusObjectPath &session_handle,
......
......@@ -111,6 +111,11 @@ void WaylandIntegration::requestPointerAxisDiscrete(Qt::Orientation axis, qreal
globalWaylandIntegration->requestPointerAxisDiscrete(axis, delta);
}
void WaylandIntegration::requestKeyboardKeycode(int keycode, bool state)
{
globalWaylandIntegration->requestKeyboardKeycode(keycode, state);
}
QMap<quint32, WaylandIntegration::WaylandOutput> WaylandIntegration::screens()
{
return globalWaylandIntegration->screens();
......@@ -375,6 +380,17 @@ void WaylandIntegration::WaylandIntegrationPrivate::requestPointerAxisDiscrete(Q
}
}
void WaylandIntegration::WaylandIntegrationPrivate::requestKeyboardKeycode(int keycode, bool state)
{
if (m_streamInput && m_fakeInput) {
if (state) {
m_fakeInput->requestKeyboardKeyPress(keycode);
} else {
m_fakeInput->requestKeyboardKeyRelease(keycode);
}
}
}
QMap<quint32, WaylandIntegration::WaylandOutput> WaylandIntegration::WaylandIntegrationPrivate::screens()
{
return m_outputMap;
......
......@@ -94,6 +94,8 @@ Q_SIGNALS:
void requestPointerMotionAbsolute(const QPointF &pos);
void requestPointerAxisDiscrete(Qt::Orientation axis, qreal delta);
void requestKeyboardKeycode(int keycode, bool state);
QMap<quint32, WaylandOutput> screens();
QVariant streams();
......
......@@ -79,6 +79,7 @@ public:
void requestPointerMotion(const QSizeF &delta);
void requestPointerMotionAbsolute(const QPointF &pos);
void requestPointerAxisDiscrete(Qt::Orientation axis, qreal delta);
void requestKeyboardKeycode(int keycode, bool state);
QMap<quint32, WaylandOutput> screens();
QVariant streams();
......
Markdown is supported
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