screencast: Support screencast of regions

This commit is contained in:
Aleix Pol 2022-03-03 01:45:52 +01:00
parent 215de363e8
commit 124c78cb4b
2 changed files with 18 additions and 1 deletions

View file

@ -9,12 +9,13 @@
#include "output_interface.h"
#include <QDebug>
#include <QRect>
#include "qwayland-server-zkde-screencast-unstable-v1.h"
namespace KWaylandServer
{
static int s_version = 2;
static int s_version = 3;
class ScreencastStreamV1InterfacePrivate : public QtWaylandServer::zkde_screencast_stream_unstable_v1
{
@ -111,6 +112,21 @@ public:
ScreencastV1Interface::CursorMode(pointer));
}
void zkde_screencast_unstable_v1_stream_region(QtWaylandServer::zkde_screencast_unstable_v1::Resource *resource,
uint32_t stream,
int32_t x,
int32_t y,
uint32_t width,
uint32_t height,
wl_fixed_t scale,
uint32_t pointer) override
{
Q_EMIT q->regionScreencastRequested(createStream(resource, stream),
{x, y, int(width), int(height)},
wl_fixed_to_double(scale),
ScreencastV1Interface::CursorMode(pointer));
}
void zkde_screencast_unstable_v1_destroy(Resource *resource) override
{
wl_resource_destroy(resource->handle);

View file

@ -58,6 +58,7 @@ Q_SIGNALS:
void outputScreencastRequested(ScreencastStreamV1Interface *stream, OutputInterface *output, CursorMode mode);
void virtualOutputScreencastRequested(ScreencastStreamV1Interface *stream, const QString &name, const QSize &size, double scaling, CursorMode mode);
void windowScreencastRequested(ScreencastStreamV1Interface *stream, const QString &winid, CursorMode mode);
void regionScreencastRequested(ScreencastStreamV1Interface *stream, const QRect &geometry, qreal scaling, CursorMode mode);
private:
QScopedPointer<ScreencastV1InterfacePrivate> d;