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