diff options
Diffstat (limited to 'community/kwayland-server/0001-kde_outputconfiguration_v2-update-to-version-2.patch')
-rw-r--r-- | community/kwayland-server/0001-kde_outputconfiguration_v2-update-to-version-2.patch | 390 |
1 files changed, 0 insertions, 390 deletions
diff --git a/community/kwayland-server/0001-kde_outputconfiguration_v2-update-to-version-2.patch b/community/kwayland-server/0001-kde_outputconfiguration_v2-update-to-version-2.patch deleted file mode 100644 index e9963b83ebc..00000000000 --- a/community/kwayland-server/0001-kde_outputconfiguration_v2-update-to-version-2.patch +++ /dev/null @@ -1,390 +0,0 @@ -From 6cc37268302afc332d3f4e2e3a0c6817363bdd08 Mon Sep 17 00:00:00 2001 -From: Aleix Pol <aleixpol@kde.org> -Date: Mon, 25 Oct 2021 02:04:04 +0200 -Subject: [PATCH] Update to changes in Plasma WaylandProtocols to support - primary displays - -Adds support for kde-primary-output. -Ports to changes in kde-output-management-v2. ---- - src/server/CMakeLists.txt | 7 +++ - .../outputconfiguration_v2_interface.cpp | 21 +++++++ - src/server/outputconfiguration_v2_interface.h | 3 + - src/server/outputdevice_v2_interface.cpp | 32 +++++++++- - src/server/outputdevice_v2_interface.h | 5 ++ - src/server/outputmanagement_v2_interface.cpp | 3 +- - src/server/primaryoutput_v1_interface.cpp | 61 +++++++++++++++++++ - src/server/primaryoutput_v1_interface.h | 37 +++++++++++ - 8 files changed, 165 insertions(+), 4 deletions(-) - create mode 100644 src/server/primaryoutput_v1_interface.cpp - create mode 100644 src/server/primaryoutput_v1_interface.h - -diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt -index 6b280d0e..3b98a01b 100644 ---- a/src/server/CMakeLists.txt -+++ b/src/server/CMakeLists.txt -@@ -42,6 +42,7 @@ set(SERVER_LIB_SRCS - pointer_interface.cpp - pointerconstraints_v1_interface.cpp - pointergestures_v1_interface.cpp -+ primaryoutput_v1_interface.cpp - primaryselectiondevice_v1_interface.cpp - primaryselectiondevicemanager_v1_interface.cpp - primaryselectionoffer_v1_interface.cpp -@@ -90,6 +91,11 @@ ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS - BASENAME kde-output-device-v2 - ) - -+ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS -+ PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/kde-primary-output-v1.xml -+ BASENAME kde-primary-output-v1 -+) -+ - ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS - PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/kde-output-management-v2.xml - BASENAME kde-output-management-v2 -@@ -363,6 +369,7 @@ set(SERVER_LIB_HEADERS - pointer_interface.h - pointerconstraints_v1_interface.h - pointergestures_v1_interface.h -+ primaryoutput_v1_interface.h - primaryselectiondevice_v1_interface.h - primaryselectiondevicemanager_v1_interface.h - primaryselectionoffer_v1_interface.h -diff --git a/src/server/outputconfiguration_v2_interface.cpp b/src/server/outputconfiguration_v2_interface.cpp -index 4cb24d1b..9c8d9364 100644 ---- a/src/server/outputconfiguration_v2_interface.cpp -+++ b/src/server/outputconfiguration_v2_interface.cpp -@@ -14,6 +14,8 @@ - #include "qwayland-server-kde-output-management-v2.h" - #include "qwayland-server-kde-output-device-v2.h" - -+#include <optional> -+ - namespace KWaylandServer - { - class OutputConfigurationV2InterfacePrivate : public QtWaylandServer::kde_output_configuration_v2 -@@ -31,6 +33,7 @@ public: - - OutputManagementV2Interface *outputManagement; - QHash<OutputDeviceV2Interface *, OutputChangeSetV2 *> changes; -+ std::optional<OutputDeviceV2Interface *> primaryOutput; - OutputConfigurationV2Interface *q; - - protected: -@@ -45,6 +48,7 @@ protected: - void kde_output_configuration_v2_overscan(Resource *resource, wl_resource *outputdevice, uint32_t overscan) override; - void kde_output_configuration_v2_set_vrr_policy(Resource *resource, struct ::wl_resource *outputdevice, uint32_t policy) override; - void kde_output_configuration_v2_set_rgb_range(Resource *resource, wl_resource *outputdevice, uint32_t rgbRange) override; -+ void kde_output_configuration_v2_set_primary_output(Resource *resource, struct ::wl_resource *output) override; - }; - - void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_enable(Resource *resource, wl_resource *outputdevice, int32_t enable) -@@ -155,6 +159,12 @@ void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_set_rgb_ - pendingChanges(output)->d->rgbRange = static_cast<OutputDeviceV2Interface::RgbRange>(rgbRange); - } - -+void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_set_primary_output(Resource *resource, struct ::wl_resource *output) -+{ -+ Q_UNUSED(resource); -+ primaryOutput = OutputDeviceV2Interface::get(output); -+} -+ - void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_destroy(Resource *resource) - { - wl_resource_destroy(resource->handle); -@@ -183,6 +193,17 @@ QHash<OutputDeviceV2Interface*, OutputChangeSetV2*> OutputConfigurationV2Interfa - return d->changes; - } - -+bool OutputConfigurationV2Interface::primaryChanged() const -+{ -+ return d->primaryOutput.has_value(); -+} -+ -+OutputDeviceV2Interface *OutputConfigurationV2Interface::primary() const -+{ -+ Q_ASSERT(d->primaryOutput.has_value()); -+ return *d->primaryOutput; -+} -+ - void OutputConfigurationV2Interface::setApplied() - { - d->clearPendingChanges(); -diff --git a/src/server/outputconfiguration_v2_interface.h b/src/server/outputconfiguration_v2_interface.h -index 45251b53..d3d300f6 100644 ---- a/src/server/outputconfiguration_v2_interface.h -+++ b/src/server/outputconfiguration_v2_interface.h -@@ -60,6 +60,9 @@ public: - */ - QHash<OutputDeviceV2Interface *, OutputChangeSetV2 *> changes() const; - -+ bool primaryChanged() const; -+ OutputDeviceV2Interface *primary() const; -+ - public Q_SLOTS: - /** - * Called by the compositor once the changes have successfully been applied. -diff --git a/src/server/outputdevice_v2_interface.cpp b/src/server/outputdevice_v2_interface.cpp -index e34c6871..750b6828 100644 ---- a/src/server/outputdevice_v2_interface.cpp -+++ b/src/server/outputdevice_v2_interface.cpp -@@ -19,8 +19,7 @@ - - namespace KWaylandServer - { -- --static const quint32 s_version = 1; -+static const quint32 s_version = 2; - - class OutputDeviceV2InterfacePrivate : public QtWaylandServer::kde_output_device_v2 - { -@@ -49,6 +48,7 @@ public: - void sendEnabled(Resource *resource); - void sendScale(Resource *resource); - void sendEisaId(Resource *resource); -+ void sendName(Resource *resource); - void sendSerialNumber(Resource *resource); - void sendCapabilities(Resource *resource); - void sendOverscan(Resource *resource); -@@ -62,6 +62,7 @@ public: - qreal scale = 1.0; - QString serialNumber; - QString eisaId; -+ QString name; - OutputDeviceV2Interface::SubPixel subPixel = OutputDeviceV2Interface::SubPixel::Unknown; - OutputDeviceV2Interface::Transform transform = OutputDeviceV2Interface::Transform::Normal; - -@@ -270,6 +271,7 @@ void OutputDeviceV2InterfacePrivate::kde_output_device_v2_bind_resource(Resource - sendGeometry(resource); - sendScale(resource); - sendEisaId(resource); -+ sendName(resource); - sendSerialNumber(resource); - - auto currentModeIt = modes.end(); -@@ -345,6 +347,13 @@ void OutputDeviceV2InterfacePrivate::sendEisaId(Resource *resource) - send_eisa_id(resource->handle, eisaId); - } - -+void OutputDeviceV2InterfacePrivate::sendName(Resource *resource) -+{ -+ if (resource->version() >= KDE_OUTPUT_DEVICE_V2_NAME_SINCE_VERSION) { -+ send_name(resource->handle, name); -+ } -+} -+ - void OutputDeviceV2InterfacePrivate::sendDone(Resource *resource) - { - send_done(resource->handle); -@@ -422,6 +431,15 @@ void OutputDeviceV2Interface::setEisaId(const QString &arg) - Q_EMIT eisaIdChanged(d->eisaId); - } - -+void OutputDeviceV2Interface::setName(const QString &arg) -+{ -+ if (d->name == arg) { -+ return; -+ } -+ d->name = arg; -+ Q_EMIT nameChanged(d->name); -+} -+ - void OutputDeviceV2Interface::setSubPixel(SubPixel arg) - { - if (d->subPixel == arg) { -@@ -479,6 +497,11 @@ QString OutputDeviceV2Interface::eisaId() const - return d->eisaId; - } - -+QString OutputDeviceV2Interface::name() const -+{ -+ return d->name; -+} -+ - qreal OutputDeviceV2Interface::scale() const - { - return d->scale; -@@ -747,6 +770,11 @@ void OutputDeviceV2InterfacePrivate::updateRgbRange() - } - } - -+wl_resource *OutputDeviceV2Interface::resource() const -+{ -+ return d->resource()->handle; -+} -+ - OutputDeviceV2Interface *OutputDeviceV2Interface::get(wl_resource *native) - { - if (auto devicePrivate = resource_cast<OutputDeviceV2InterfacePrivate *>(native)) { -diff --git a/src/server/outputdevice_v2_interface.h b/src/server/outputdevice_v2_interface.h -index de968c71..f92ba3c6 100644 ---- a/src/server/outputdevice_v2_interface.h -+++ b/src/server/outputdevice_v2_interface.h -@@ -41,6 +41,7 @@ class KWAYLANDSERVER_EXPORT OutputDeviceV2Interface : public QObject - Q_PROPERTY(QString model READ model WRITE setModel NOTIFY modelChanged) - Q_PROPERTY(QString serialNumber READ serialNumber WRITE setSerialNumber NOTIFY serialNumberChanged) - Q_PROPERTY(QString eisaId READ eisaId WRITE setEisaId NOTIFY eisaIdChanged) -+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) - Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged) - Q_PROPERTY(QByteArray edid READ edid WRITE setEdid NOTIFY edidChanged) - Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) -@@ -101,6 +102,7 @@ public: - QString model() const; - QString serialNumber() const; - QString eisaId() const; -+ QString name() const; - QSize pixelSize() const; - int refreshRate() const; - -@@ -123,6 +125,7 @@ public: - void setModel(const QString &model); - void setSerialNumber(const QString &serialNumber); - void setEisaId(const QString &eisaId); -+ void setName(const QString &name); - - void setScale(qreal scale); - void setSubPixel(SubPixel subPixel); -@@ -146,6 +149,7 @@ public: - void setVrrPolicy(VrrPolicy policy); - void setRgbRange(RgbRange rgbRange); - -+ wl_resource *resource() const; - static OutputDeviceV2Interface *get(wl_resource *native); - - Q_SIGNALS: -@@ -155,6 +159,7 @@ Q_SIGNALS: - void modelChanged(const QString&); - void serialNumberChanged(const QString&); - void eisaIdChanged(const QString &); -+ void nameChanged(const QString &name); - void scaleChanged(qreal); - void subPixelChanged(SubPixel); - void transformChanged(Transform); -diff --git a/src/server/outputmanagement_v2_interface.cpp b/src/server/outputmanagement_v2_interface.cpp -index 92c2294e..8194d66c 100644 ---- a/src/server/outputmanagement_v2_interface.cpp -+++ b/src/server/outputmanagement_v2_interface.cpp -@@ -15,8 +15,7 @@ - - namespace KWaylandServer - { -- --static const quint32 s_version = 1; -+static const quint32 s_version = 2; - - class OutputManagementV2InterfacePrivate : public QtWaylandServer::kde_output_management_v2 - { -diff --git a/src/server/primaryoutput_v1_interface.cpp b/src/server/primaryoutput_v1_interface.cpp -new file mode 100644 -index 00000000..6f009431 ---- /dev/null -+++ b/src/server/primaryoutput_v1_interface.cpp -@@ -0,0 +1,61 @@ -+/* -+ SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@kde.org> -+ -+ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -+*/ -+ -+#include "primaryoutput_v1_interface.h" -+ -+#include "display.h" -+#include "outputconfiguration_v2_interface.h" -+#include "outputmanagement_v2_interface.h" -+ -+#include "qwayland-server-kde-primary-output-v1.h" -+#include <wayland-server.h> -+ -+#include <QHash> -+ -+namespace KWaylandServer -+{ -+static const quint32 s_version = 1; -+ -+class PrimaryOutputV1InterfacePrivate : public QtWaylandServer::kde_primary_output_v1 -+{ -+public: -+ PrimaryOutputV1InterfacePrivate(Display *display) -+ : QtWaylandServer::kde_primary_output_v1(*display, s_version) -+ { -+ } -+ -+ void kde_primary_output_v1_bind_resource(Resource *resource) override -+ { -+ if (!m_outputName.isEmpty()) { -+ send_primary_output(resource->handle, m_outputName); -+ } -+ } -+ -+ QString m_outputName; -+}; -+ -+PrimaryOutputV1Interface::PrimaryOutputV1Interface(KWaylandServer::Display *display, QObject *parent) -+ : QObject(parent) -+ , d(new PrimaryOutputV1InterfacePrivate(display)) -+{ -+} -+ -+PrimaryOutputV1Interface::~PrimaryOutputV1Interface() = default; -+ -+void PrimaryOutputV1Interface::setPrimaryOutput(const QString &outputName) -+{ -+ if (outputName == d->m_outputName) { -+ return; -+ } -+ d->m_outputName = outputName; -+ -+ const auto resources = d->resourceMap(); -+ for (auto *resource : resources) { -+ d->send_primary_output(resource->handle, outputName); -+ } -+} -+ -+} -diff --git a/src/server/primaryoutput_v1_interface.h b/src/server/primaryoutput_v1_interface.h -new file mode 100644 -index 00000000..a0d3e66c ---- /dev/null -+++ b/src/server/primaryoutput_v1_interface.h -@@ -0,0 +1,37 @@ -+/* -+ SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@kde.org> -+ -+ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -+*/ -+#pragma once -+ -+#include <QObject> -+ -+#include <KWaylandServer/kwaylandserver_export.h> -+ -+namespace KWaylandServer -+{ -+class Display; -+class OutputDeviceV2Interface; -+class PrimaryOutputV1InterfacePrivate; -+ -+class KWAYLANDSERVER_EXPORT PrimaryOutputV1Interface : public QObject -+{ -+ Q_OBJECT -+ -+public: -+ explicit PrimaryOutputV1Interface(Display *display, QObject *parent = nullptr); -+ ~PrimaryOutputV1Interface() override; -+ -+ /** -+ * Sets a primary output's @p outputName for the current display configuration -+ * -+ * It's up to the compositor to decide what the semantics are for it. -+ */ -+ void setPrimaryOutput(const QString &outputName); -+ -+private: -+ QScopedPointer<PrimaryOutputV1InterfacePrivate> d; -+}; -+ -+} --- -GitLab - |