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
This commit is contained in:
parent
042896a755
commit
18458d3252
2 changed files with 3 additions and 3 deletions
|
@ -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<quint32>(), announced.first().last().value<quint32>()));
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue