Partly Revert "Support xdg_activation_v1 on SNI invokations"

This reverts commit changes that didn't belong in
6545d5584d.
wilder-5.24
Aleix Pol 5 years ago
parent e782a1248d
commit fcde10714a
  1. 12
      libnotificationmanager/server.cpp
  2. 1
      libnotificationmanager/server_p.h
  3. 8
      libtaskmanager/declarative/pipewiresourceitem.cpp
  4. 6
      libtaskmanager/declarative/pipewiresourceitem.h
  5. 15
      libtaskmanager/declarative/pipewiresourcestream.cpp
  6. 9
      libtaskmanager/declarative/pipewiresourcestream.h

@ -26,7 +26,6 @@
#include "debug.h" #include "debug.h"
#include <KWindowSystem>
#include <QDebug> #include <QDebug>
using namespace NotificationManager; using namespace NotificationManager;
@ -78,18 +77,7 @@ void Server::closeNotification(uint notificationId, CloseReason reason)
void Server::invokeAction(uint notificationId, const QString &actionName) void Server::invokeAction(uint notificationId, const QString &actionName)
{ {
QWindow *window = nullptr;
const int launchedSerial = KWindowSystem::lastInputSerial(window);
connect(KWindowSystem::self(),
&KWindowSystem::xdgActivationTokenArrived,
this,
[this, launchedSerial, notificationId, actionName](int tokenSerial, const QString &token) {
if (tokenSerial == launchedSerial) {
emit d->ActivationToken(notificationId, token);
emit d->ActionInvoked(notificationId, actionName); emit d->ActionInvoked(notificationId, actionName);
}
});
KWindowSystem::requestXdgActivationToken(window, launchedSerial, {});
} }
void Server::reply(const QString &dbusService, uint notificationId, const QString &text) void Server::reply(const QString &dbusService, uint notificationId, const QString &text)

@ -80,7 +80,6 @@ Q_SIGNALS:
// DBus // DBus
void NotificationClosed(uint id, uint reason); void NotificationClosed(uint id, uint reason);
void ActionInvoked(uint id, const QString &actionKey); void ActionInvoked(uint id, const QString &actionKey);
void ActivationToken(uint id, const QString &activationToken);
// non-standard // non-standard
// This is manually emitted as targeted signal in sendReplyText() // This is manually emitted as targeted signal in sendReplyText()
void NotificationReplied(uint id, const QString &text); void NotificationReplied(uint id, const QString &text);

@ -119,7 +119,7 @@ void PipeWireSourceItem::setNodeId(uint nodeId)
return nullptr; return nullptr;
}; };
} else { } else {
m_stream.reset(new PipeWireSourceStream(true, this)); m_stream.reset(new PipeWireSourceStream(this));
m_stream->createStream(m_nodeId); m_stream->createStream(m_nodeId);
if (!m_stream->error().isEmpty()) { if (!m_stream->error().isEmpty()) {
m_stream.reset(nullptr); m_stream.reset(nullptr);
@ -130,7 +130,6 @@ void PipeWireSourceItem::setNodeId(uint nodeId)
connect(m_stream.data(), &PipeWireSourceStream::dmabufTextureReceived, this, &PipeWireSourceItem::updateTextureDmaBuf); connect(m_stream.data(), &PipeWireSourceStream::dmabufTextureReceived, this, &PipeWireSourceItem::updateTextureDmaBuf);
connect(m_stream.data(), &PipeWireSourceStream::imageTextureReceived, this, &PipeWireSourceItem::updateTextureImage); connect(m_stream.data(), &PipeWireSourceStream::imageTextureReceived, this, &PipeWireSourceItem::updateTextureImage);
connect(m_stream.data(), &PipeWireSourceStream::streamChanged, this, &PipeWireSourceItem::streamChanged);
} }
Q_EMIT nodeIdChanged(nodeId); Q_EMIT nodeIdChanged(nodeId);
@ -304,8 +303,3 @@ void PipeWireSourceItem::componentComplete()
m_stream->setActive(isVisible()); m_stream->setActive(isVisible());
QQuickItem::componentComplete(); QQuickItem::componentComplete();
} }
QSize PipeWireSourceItem::sourceSize() const
{
return m_stream ? m_stream->size() : QSize();
}

@ -40,9 +40,6 @@ class PipeWireSourceItem : public QQuickItem
Q_OBJECT Q_OBJECT
/// Specify the pipewire node id that we want to play /// Specify the pipewire node id that we want to play
Q_PROPERTY(uint nodeId READ nodeId WRITE setNodeId NOTIFY nodeIdChanged) Q_PROPERTY(uint nodeId READ nodeId WRITE setNodeId NOTIFY nodeIdChanged)
/// Reports the original size of the stream
Q_PROPERTY(QSize sourceSize READ sourceSize NOTIFY streamChanged)
public: public:
PipeWireSourceItem(QQuickItem *parent = nullptr); PipeWireSourceItem(QQuickItem *parent = nullptr);
~PipeWireSourceItem() override; ~PipeWireSourceItem() override;
@ -55,19 +52,18 @@ public:
{ {
return m_nodeId; return m_nodeId;
} }
QSize sourceSize() const;
void componentComplete() override; void componentComplete() override;
void releaseResources() override; void releaseResources() override;
Q_SIGNALS: Q_SIGNALS:
void streamChanged();
void nodeIdChanged(uint nodeId); void nodeIdChanged(uint nodeId);
private: private:
void itemChange(ItemChange change, const ItemChangeData &data) override; void itemChange(ItemChange change, const ItemChangeData &data) override;
void updateTextureDmaBuf(const QVector<DmaBufPlane> &plane, uint32_t format); void updateTextureDmaBuf(const QVector<DmaBufPlane> &plane, uint32_t format);
void updateTextureImage(const QImage &image); void updateTextureImage(const QImage &image);
void setSize(const QSize &size);
uint m_nodeId = 0; uint m_nodeId = 0;
std::function<QSGTexture *()> m_createNextTexture; std::function<QSGTexture *()> m_createNextTexture;

@ -81,10 +81,6 @@ void PipeWireSourceStream::onStreamParamChanged(void *data, uint32_t id, const s
uint8_t paramsBuffer[1024]; uint8_t paramsBuffer[1024];
spa_pod_builder pod_builder = SPA_POD_BUILDER_INIT(paramsBuffer, sizeof(paramsBuffer)); spa_pod_builder pod_builder = SPA_POD_BUILDER_INIT(paramsBuffer, sizeof(paramsBuffer));
int extraTypes = 0;
if (pw->m_dmaBufSupported) {
extraTypes += 1 << SPA_DATA_DmaBuf;
}
const spa_pod *param = (spa_pod *)spa_pod_builder_add_object(&pod_builder, const spa_pod *param = (spa_pod *)spa_pod_builder_add_object(&pod_builder,
SPA_TYPE_OBJECT_ParamBuffers, SPA_TYPE_OBJECT_ParamBuffers,
SPA_PARAM_Buffers, SPA_PARAM_Buffers,
@ -99,9 +95,8 @@ void PipeWireSourceStream::onStreamParamChanged(void *data, uint32_t id, const s
SPA_PARAM_BUFFERS_align, SPA_PARAM_BUFFERS_align,
SPA_POD_Int(16), SPA_POD_Int(16),
SPA_PARAM_BUFFERS_dataType, SPA_PARAM_BUFFERS_dataType,
SPA_POD_Int((1 << SPA_DATA_MemPtr) | (1 << SPA_DATA_MemFd) | extraTypes)); SPA_POD_Int((1 << SPA_DATA_MemPtr) | (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_DmaBuf)));
pw_stream_update_params(pw->pwStream, &param, 1); pw_stream_update_params(pw->pwStream, &param, 1);
Q_EMIT pw->streamChanged();
} }
static void onProcess(void *data) static void onProcess(void *data)
@ -110,14 +105,8 @@ static void onProcess(void *data)
stream->process(); stream->process();
} }
QSize PipeWireSourceStream::size() const PipeWireSourceStream::PipeWireSourceStream(QObject *parent)
{
return QSize(videoFormat.size.width, videoFormat.size.height);
}
PipeWireSourceStream::PipeWireSourceStream(bool dmaBufSupported, QObject *parent)
: QObject(parent) : QObject(parent)
, m_dmaBufSupported(dmaBufSupported)
{ {
pwStreamEvents.version = PW_VERSION_STREAM_EVENTS; pwStreamEvents.version = PW_VERSION_STREAM_EVENTS;
pwStreamEvents.process = &onProcess; pwStreamEvents.process = &onProcess;

@ -54,7 +54,7 @@ class PipeWireSourceStream : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit PipeWireSourceStream(bool dmaBufSupported, QObject *parent); explicit PipeWireSourceStream(QObject *parent);
~PipeWireSourceStream(); ~PipeWireSourceStream();
static void onStreamParamChanged(void *data, uint32_t id, const struct spa_pod *format); static void onStreamParamChanged(void *data, uint32_t id, const struct spa_pod *format);
@ -67,7 +67,10 @@ public:
return m_error; return m_error;
} }
QSize size() const; QSize size() const
{
return QSize(videoFormat.size.width, videoFormat.size.height);
}
bool createStream(uint nodeid); bool createStream(uint nodeid);
void stop(); void stop();
void setActive(bool active); void setActive(bool active);
@ -79,7 +82,6 @@ Q_SIGNALS:
void streamReady(); void streamReady();
void startStreaming(); void startStreaming();
void stopStreaming(); void stopStreaming();
void streamChanged();
void dmabufTextureReceived(const QVector<DmaBufPlane> &planes, uint32_t format); void dmabufTextureReceived(const QVector<DmaBufPlane> &planes, uint32_t format);
void imageTextureReceived(const QImage &image); void imageTextureReceived(const QImage &image);
@ -96,6 +98,5 @@ private:
bool m_stopped = false; bool m_stopped = false;
spa_video_info_raw videoFormat; spa_video_info_raw videoFormat;
const bool m_dmaBufSupported = false;
QString m_error; QString m_error;
}; };

Loading…
Cancel
Save