From 2ce09845ae6f1adfd1ebcabe8ed2f9443ec02cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Wed, 16 Dec 2015 13:52:26 +0100 Subject: [PATCH] fix OutputDevice::edid() This patch transports the EDID data base64-encoded over the wire. Apparently, we can't just send random QByteArrays as "strings" over, it has to be encoded and decoded. So... * base64-encode the data before sending to the client * base64-decode it on the client side * document the above, fix documentation woes in the xml definition * change test accordingly The test data used was actually invalid, it's a base64 string of the actual data, so fix the tests (which actually breaks it), and encode on the server-side and decode on the client side. REVIEW:126380 --- src/wayland/autotests/client/test_wayland_outputdevice.cpp | 4 ++-- src/wayland/server/outputdevice_interface.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wayland/autotests/client/test_wayland_outputdevice.cpp b/src/wayland/autotests/client/test_wayland_outputdevice.cpp index beefc45954..fe0f9c55d3 100644 --- a/src/wayland/autotests/client/test_wayland_outputdevice.cpp +++ b/src/wayland/autotests/client/test_wayland_outputdevice.cpp @@ -110,7 +110,7 @@ void TestWaylandOutputDevice::init() m_serverOutputDevice->setCurrentMode(1); - m_edid = "AP///////wAQrBbwTExLQQ4WAQOANCB46h7Frk80sSYOUFSlSwCBgKlA0QBxTwEBAQEBAQEBKDyAoHCwI0AwIDYABkQhAAAaAAAA/wBGNTI1TTI0NUFLTEwKAAAA/ABERUxMIFUyNDEwCiAgAAAA/QA4TB5REQAKICAgICAgAToCAynxUJAFBAMCBxYBHxITFCAVEQYjCQcHZwMMABAAOC2DAQAA4wUDAQI6gBhxOC1AWCxFAAZEIQAAHgEdgBhxHBYgWCwlAAZEIQAAngEdAHJR0B4gbihVAAZEIQAAHowK0Iog4C0QED6WAAZEIQAAGAAAAAAAAAAAAAAAAAAAPg=="; + m_edid = QByteArray::fromBase64("AP///////wAQrBbwTExLQQ4WAQOANCB46h7Frk80sSYOUFSlSwCBgKlA0QBxTwEBAQEBAQEBKDyAoHCwI0AwIDYABkQhAAAaAAAA/wBGNTI1TTI0NUFLTEwKAAAA/ABERUxMIFUyNDEwCiAgAAAA/QA4TB5REQAKICAgICAgAToCAynxUJAFBAMCBxYBHxITFCAVEQYjCQcHZwMMABAAOC2DAQAA4wUDAQI6gBhxOC1AWCxFAAZEIQAAHgEdgBhxHBYgWCwlAAZEIQAAngEdAHJR0B4gbihVAAZEIQAAHowK0Iog4C0QED6WAAZEIQAAGAAAAAAAAAAAAAAAAAAAPg=="); m_serverOutputDevice->setEdid(m_edid); m_serverOutputDevice->create(); @@ -183,7 +183,7 @@ void TestWaylandOutputDevice::testRegistry() QCOMPARE(output.transform(), KWayland::Client::OutputDevice::Transform::Normal); QCOMPARE(output.enabled(), OutputDevice::Enablement::Enabled); QCOMPARE(output.edid(), QByteArray()); - QSignalSpy outputChanged(&output, &KWayland::Client::OutputDevice::changed); + QSignalSpy outputChanged(&output, &KWayland::Client::OutputDevice::done); QVERIFY(outputChanged.isValid()); output.setup(registry.bindOutputDevice(announced.first().first().value(), announced.first().last().value())); diff --git a/src/wayland/server/outputdevice_interface.cpp b/src/wayland/server/outputdevice_interface.cpp index adf65a1020..6188650d66 100644 --- a/src/wayland/server/outputdevice_interface.cpp +++ b/src/wayland/server/outputdevice_interface.cpp @@ -561,7 +561,7 @@ void KWayland::Server::OutputDeviceInterface::Private::sendEdid() { for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { org_kde_kwin_outputdevice_send_edid((*it).resource, - edid.constData()); + edid.toBase64().constData()); } }