Commit 330a02d8 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

wayland: Implement wl_output version 4

wl_output version 4 adds name and description properties. Those
properties were added in wayland 1.20, which we already require.
parent a0a47239
Pipeline #227455 passed with stage
in 39 minutes and 15 seconds
......@@ -18,7 +18,7 @@
namespace KWaylandServer
{
static const int s_version = 3;
static const int s_version = 4;
class OutputInterfacePrivate : public QtWaylandServer::wl_output
{
......@@ -43,6 +43,8 @@ public:
KWin::Output::SubPixel subPixel = KWin::Output::SubPixel::Unknown;
KWin::Output::Transform transform = KWin::Output::Transform::Normal;
OutputInterface::Mode mode;
QString name;
QString description;
private:
void output_destroy_global() override;
......@@ -158,6 +160,13 @@ void OutputInterfacePrivate::output_bind_resource(Resource *resource)
return; // We are waiting for the wl_output global to be destroyed.
}
if (resource->version() >= WL_OUTPUT_NAME_SINCE_VERSION) {
send_name(name);
}
if (resource->version() >= WL_OUTPUT_DESCRIPTION_SINCE_VERSION) {
send_description(description);
}
sendMode(resource);
sendScale(resource);
sendGeometry(resource);
......@@ -242,6 +251,16 @@ void OutputInterface::setMode(const QSize &size, int refreshRate)
setMode({size, refreshRate});
}
void OutputInterface::setName(const QString &name)
{
d->name = name;
}
void OutputInterface::setDescription(const QString &description)
{
d->description = description;
}
QSize OutputInterface::physicalSize() const
{
return d->physicalSize;
......
......@@ -76,6 +76,8 @@ public:
void setTransform(KWin::Output::Transform transform);
void setMode(const Mode &mode);
void setMode(const QSize &size, int refreshRate = 60000);
void setName(const QString &name);
void setDescription(const QString &description);
/**
* @returns all wl_resources bound for the @p client
......
......@@ -20,6 +20,8 @@ WaylandOutput::WaylandOutput(Output *output, QObject *parent)
{
const QRect geometry = m_platformOutput->geometry();
m_waylandOutput->setName(output->name());
m_waylandOutput->setDescription(output->description());
m_waylandOutput->setTransform(output->transform());
m_waylandOutput->setManufacturer(output->manufacturer());
m_waylandOutput->setModel(output->model());
......
Supports Markdown
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