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

screencasting: error out when kwin isn't providing the zkde_screencast_unstable_v1

BUG: 424744
parent daab5c52
......@@ -59,6 +59,11 @@ uint RemoteDesktopPortal::CreateSession(const QDBusObjectPath &handle,
WaylandIntegration::stopAllStreaming();
});
if (!WaylandIntegration::isStreamingAvailable()) {
qCWarning(XdgDesktopPortalKdeRemoteDesktop) << "zkde_screencast_unstable_v1 does not seem to be available";
return 2;
}
return 0;
}
......
......@@ -57,6 +57,11 @@ uint ScreenCastPortal::CreateSession(const QDBusObjectPath &handle,
return 2;
}
if (!WaylandIntegration::isStreamingAvailable()) {
qCWarning(XdgDesktopPortalKdeScreenCast) << "zkde_screencast_unstable_v1 does not seem to be available";
return 2;
}
connect(session, &Session::closed, [] () {
WaylandIntegration::stopAllStreaming();
});
......
......@@ -75,6 +75,11 @@ bool WaylandIntegration::isStreamingEnabled()
return globalWaylandIntegration->isStreamingEnabled();
}
bool WaylandIntegration::isStreamingAvailable()
{
return globalWaylandIntegration->isStreamingAvailable();
}
void WaylandIntegration::startStreamingInput()
{
globalWaylandIntegration->startStreamingInput();
......@@ -223,6 +228,11 @@ bool WaylandIntegration::WaylandIntegrationPrivate::isStreamingEnabled() const
return !m_streams.isEmpty();
}
bool WaylandIntegration::WaylandIntegrationPrivate::isStreamingAvailable() const
{
return m_screencasting;
}
void WaylandIntegration::WaylandIntegrationPrivate::bindOutput(int outputName, int outputVersion)
{
KWayland::Client::Output *output = new KWayland::Client::Output(this);
......
......@@ -86,6 +86,7 @@ Q_SIGNALS:
void authenticate();
bool isStreamingEnabled();
bool isStreamingAvailable();
void startStreamingInput();
bool startStreamingOutput(quint32 outputName, Screencasting::CursorMode mode);
......
......@@ -82,6 +82,7 @@ public:
void authenticate();
bool isStreamingEnabled() const;
bool isStreamingAvailable() const;
void startStreamingInput();
......
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