2020-03-15 15:19:28 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
2014-08-19 14:08:02 +00:00
|
|
|
|
2020-03-15 15:19:28 +00:00
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
2014-08-19 14:08:02 +00:00
|
|
|
// Qt
|
2023-07-03 19:28:19 +00:00
|
|
|
#include <QSignalSpy>
|
|
|
|
#include <QTest>
|
2014-08-19 14:08:02 +00:00
|
|
|
// KWin
|
2022-04-22 09:27:33 +00:00
|
|
|
#include "wayland/display.h"
|
2023-09-13 05:52:59 +00:00
|
|
|
#include "wayland/output.h"
|
2022-04-22 09:27:33 +00:00
|
|
|
|
2020-04-29 13:59:23 +00:00
|
|
|
#include "KWayland/Client/connection_thread.h"
|
2021-08-29 05:11:06 +00:00
|
|
|
#include "KWayland/Client/event_queue.h"
|
2020-04-29 13:59:23 +00:00
|
|
|
#include "KWayland/Client/output.h"
|
|
|
|
#include "KWayland/Client/registry.h"
|
2022-04-22 09:27:33 +00:00
|
|
|
|
2023-10-24 17:23:33 +00:00
|
|
|
#include "../../../tests/fakeoutput.h"
|
2022-08-25 08:02:48 +00:00
|
|
|
|
2014-08-19 14:08:02 +00:00
|
|
|
// Wayland
|
|
|
|
#include <wayland-client-protocol.h>
|
|
|
|
|
|
|
|
class TestWaylandOutput : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit TestWaylandOutput(QObject *parent = nullptr);
|
|
|
|
private Q_SLOTS:
|
|
|
|
void init();
|
|
|
|
void cleanup();
|
|
|
|
|
|
|
|
void testRegistry();
|
2021-04-04 17:05:10 +00:00
|
|
|
void testModeChange();
|
2014-08-26 14:07:39 +00:00
|
|
|
void testScaleChange();
|
2014-08-19 14:08:02 +00:00
|
|
|
|
2014-08-26 14:07:39 +00:00
|
|
|
void testSubPixel_data();
|
|
|
|
void testSubPixel();
|
|
|
|
|
|
|
|
void testTransform_data();
|
|
|
|
void testTransform();
|
2014-08-19 14:08:02 +00:00
|
|
|
|
|
|
|
private:
|
2023-09-13 17:59:29 +00:00
|
|
|
KWin::Display *m_display;
|
2014-09-17 14:17:26 +00:00
|
|
|
KWayland::Client::ConnectionThread *m_connection;
|
2015-05-12 11:16:57 +00:00
|
|
|
KWayland::Client::EventQueue *m_queue;
|
2014-08-26 14:07:39 +00:00
|
|
|
QThread *m_thread;
|
2014-08-19 14:08:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const QString s_socketName = QStringLiteral("kwin-test-wayland-output-0");
|
|
|
|
|
|
|
|
TestWaylandOutput::TestWaylandOutput(QObject *parent)
|
|
|
|
: QObject(parent)
|
2014-08-26 14:07:39 +00:00
|
|
|
, m_display(nullptr)
|
|
|
|
, m_connection(nullptr)
|
|
|
|
, m_thread(nullptr)
|
2014-08-19 14:08:02 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestWaylandOutput::init()
|
|
|
|
{
|
2014-08-26 14:07:39 +00:00
|
|
|
delete m_display;
|
2023-09-13 17:59:29 +00:00
|
|
|
m_display = new KWin::Display(this);
|
2020-10-19 15:52:56 +00:00
|
|
|
m_display->addSocketName(s_socketName);
|
2014-08-26 14:07:39 +00:00
|
|
|
m_display->start();
|
|
|
|
QVERIFY(m_display->isRunning());
|
|
|
|
|
|
|
|
// setup connection
|
2014-09-17 14:17:26 +00:00
|
|
|
m_connection = new KWayland::Client::ConnectionThread;
|
2021-02-25 13:48:11 +00:00
|
|
|
QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected);
|
2014-08-26 14:07:39 +00:00
|
|
|
m_connection->setSocketName(s_socketName);
|
|
|
|
|
|
|
|
m_thread = new QThread(this);
|
|
|
|
m_connection->moveToThread(m_thread);
|
|
|
|
m_thread->start();
|
|
|
|
|
|
|
|
m_connection->initConnection();
|
|
|
|
QVERIFY(connectedSpy.wait());
|
2015-05-12 11:16:57 +00:00
|
|
|
|
|
|
|
m_queue = new KWayland::Client::EventQueue(this);
|
|
|
|
QVERIFY(!m_queue->isValid());
|
|
|
|
m_queue->setup(m_connection);
|
|
|
|
QVERIFY(m_queue->isValid());
|
2014-08-19 14:08:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestWaylandOutput::cleanup()
|
|
|
|
{
|
2015-05-12 11:16:57 +00:00
|
|
|
if (m_queue) {
|
|
|
|
delete m_queue;
|
|
|
|
m_queue = nullptr;
|
|
|
|
}
|
2014-08-26 14:07:39 +00:00
|
|
|
if (m_thread) {
|
|
|
|
m_thread->quit();
|
|
|
|
m_thread->wait();
|
|
|
|
delete m_thread;
|
|
|
|
m_thread = nullptr;
|
|
|
|
}
|
|
|
|
delete m_connection;
|
|
|
|
m_connection = nullptr;
|
|
|
|
|
|
|
|
delete m_display;
|
|
|
|
m_display = nullptr;
|
2014-08-19 14:08:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestWaylandOutput::testRegistry()
|
|
|
|
{
|
2022-10-15 11:52:22 +00:00
|
|
|
auto outputHandle = std::make_unique<FakeOutput>();
|
|
|
|
outputHandle->setMode(QSize(1024, 768), 60000);
|
|
|
|
outputHandle->moveTo(QPoint(100, 50));
|
|
|
|
outputHandle->setPhysicalSize(QSize(200, 100));
|
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
auto outputInterface = std::make_unique<KWin::OutputInterface>(m_display, outputHandle.get());
|
2014-08-19 14:08:02 +00:00
|
|
|
|
2014-09-17 14:17:26 +00:00
|
|
|
KWayland::Client::Registry registry;
|
2021-02-25 13:48:11 +00:00
|
|
|
QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced);
|
2014-08-26 14:07:39 +00:00
|
|
|
registry.create(m_connection->display());
|
2014-08-19 14:08:02 +00:00
|
|
|
QVERIFY(registry.isValid());
|
|
|
|
registry.setup();
|
2014-08-26 14:07:39 +00:00
|
|
|
wl_display_flush(m_connection->display());
|
2014-08-19 14:08:02 +00:00
|
|
|
QVERIFY(announced.wait());
|
|
|
|
|
2014-09-17 14:17:26 +00:00
|
|
|
KWayland::Client::Output output;
|
2014-08-19 14:08:02 +00:00
|
|
|
QVERIFY(!output.isValid());
|
|
|
|
QCOMPARE(output.geometry(), QRect());
|
|
|
|
QCOMPARE(output.globalPosition(), QPoint());
|
|
|
|
QCOMPARE(output.manufacturer(), QString());
|
|
|
|
QCOMPARE(output.model(), QString());
|
|
|
|
QCOMPARE(output.physicalSize(), QSize());
|
|
|
|
QCOMPARE(output.pixelSize(), QSize());
|
|
|
|
QCOMPARE(output.refreshRate(), 0);
|
|
|
|
QCOMPARE(output.scale(), 1);
|
2014-09-17 14:17:26 +00:00
|
|
|
QCOMPARE(output.subPixel(), KWayland::Client::Output::SubPixel::Unknown);
|
|
|
|
QCOMPARE(output.transform(), KWayland::Client::Output::Transform::Normal);
|
2014-08-19 14:08:02 +00:00
|
|
|
|
2021-02-25 13:48:11 +00:00
|
|
|
QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed);
|
2016-08-22 08:02:28 +00:00
|
|
|
auto o = registry.bindOutput(announced.first().first().value<quint32>(), announced.first().last().value<quint32>());
|
|
|
|
QVERIFY(!KWayland::Client::Output::get(o));
|
|
|
|
output.setup(o);
|
|
|
|
QCOMPARE(KWayland::Client::Output::get(o), &output);
|
2014-08-26 14:07:39 +00:00
|
|
|
wl_display_flush(m_connection->display());
|
2014-08-19 14:08:02 +00:00
|
|
|
QVERIFY(outputChanged.wait());
|
|
|
|
|
2014-08-26 14:07:39 +00:00
|
|
|
QCOMPARE(output.geometry(), QRect(100, 50, 1024, 768));
|
|
|
|
QCOMPARE(output.globalPosition(), QPoint(100, 50));
|
2022-10-15 11:52:22 +00:00
|
|
|
QCOMPARE(output.manufacturer(), QString());
|
|
|
|
QCOMPARE(output.model(), QString());
|
2014-08-26 14:07:39 +00:00
|
|
|
QCOMPARE(output.physicalSize(), QSize(200, 100));
|
2014-08-19 14:08:02 +00:00
|
|
|
QCOMPARE(output.pixelSize(), QSize(1024, 768));
|
|
|
|
QCOMPARE(output.refreshRate(), 60000);
|
|
|
|
QCOMPARE(output.scale(), 1);
|
|
|
|
// for xwayland output it's unknown
|
2014-09-17 14:17:26 +00:00
|
|
|
QCOMPARE(output.subPixel(), KWayland::Client::Output::SubPixel::Unknown);
|
2014-08-19 14:08:02 +00:00
|
|
|
// for xwayland transform is normal
|
2014-09-17 14:17:26 +00:00
|
|
|
QCOMPARE(output.transform(), KWayland::Client::Output::Transform::Normal);
|
2014-08-19 14:08:02 +00:00
|
|
|
}
|
|
|
|
|
2021-04-04 17:05:10 +00:00
|
|
|
void TestWaylandOutput::testModeChange()
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
2022-10-15 11:52:22 +00:00
|
|
|
auto outputHandle = std::make_unique<FakeOutput>();
|
|
|
|
outputHandle->setMode(QSize(1024, 768), 60000);
|
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
auto outputInterface = std::make_unique<KWin::OutputInterface>(m_display, outputHandle.get());
|
2022-10-15 11:52:22 +00:00
|
|
|
|
2014-09-17 14:17:26 +00:00
|
|
|
KWayland::Client::Registry registry;
|
2021-02-25 13:48:11 +00:00
|
|
|
QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced);
|
2015-05-12 11:16:57 +00:00
|
|
|
registry.setEventQueue(m_queue);
|
2014-08-26 14:07:39 +00:00
|
|
|
registry.create(m_connection->display());
|
|
|
|
QVERIFY(registry.isValid());
|
|
|
|
registry.setup();
|
|
|
|
wl_display_flush(m_connection->display());
|
|
|
|
QVERIFY(announced.wait());
|
|
|
|
|
2014-09-17 14:17:26 +00:00
|
|
|
KWayland::Client::Output output;
|
2021-02-25 13:48:11 +00:00
|
|
|
QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed);
|
|
|
|
QSignalSpy modeAddedSpy(&output, &KWayland::Client::Output::modeAdded);
|
2014-08-26 14:07:39 +00:00
|
|
|
output.setup(registry.bindOutput(announced.first().first().value<quint32>(), announced.first().last().value<quint32>()));
|
|
|
|
wl_display_flush(m_connection->display());
|
|
|
|
QVERIFY(outputChanged.wait());
|
2021-04-04 17:05:10 +00:00
|
|
|
QCOMPARE(modeAddedSpy.count(), 1);
|
2022-11-08 21:15:17 +00:00
|
|
|
QCOMPARE(modeAddedSpy.at(0).first().value<KWayland::Client::Output::Mode>().size, QSize(1024, 768));
|
|
|
|
QCOMPARE(modeAddedSpy.at(0).first().value<KWayland::Client::Output::Mode>().refreshRate, 60000);
|
|
|
|
QCOMPARE(modeAddedSpy.at(0).first().value<KWayland::Client::Output::Mode>().flags, KWayland::Client::Output::Mode::Flags(KWayland::Client::Output::Mode::Flag::Current));
|
|
|
|
QCOMPARE(modeAddedSpy.at(0).first().value<KWayland::Client::Output::Mode>().output, QPointer<KWayland::Client::Output>(&output));
|
2014-08-26 14:07:39 +00:00
|
|
|
QCOMPARE(output.pixelSize(), QSize(1024, 768));
|
2021-04-04 17:05:10 +00:00
|
|
|
QCOMPARE(output.refreshRate(), 60000);
|
2014-08-26 14:07:39 +00:00
|
|
|
|
|
|
|
// change once more
|
2022-10-15 11:52:22 +00:00
|
|
|
outputHandle->setMode(QSize(1280, 1024), 90000);
|
2021-04-04 17:05:10 +00:00
|
|
|
QVERIFY(outputChanged.wait());
|
|
|
|
QCOMPARE(modeAddedSpy.count(), 2);
|
2022-11-08 21:15:17 +00:00
|
|
|
QCOMPARE(modeAddedSpy.at(1).first().value<KWayland::Client::Output::Mode>().size, QSize(1280, 1024));
|
|
|
|
QCOMPARE(modeAddedSpy.at(1).first().value<KWayland::Client::Output::Mode>().refreshRate, 90000);
|
|
|
|
QCOMPARE(modeAddedSpy.at(1).first().value<KWayland::Client::Output::Mode>().flags, KWayland::Client::Output::Mode::Flags(KWayland::Client::Output::Mode::Flag::Current));
|
|
|
|
QCOMPARE(modeAddedSpy.at(1).first().value<KWayland::Client::Output::Mode>().output, QPointer<KWayland::Client::Output>(&output));
|
2014-08-26 14:07:39 +00:00
|
|
|
QCOMPARE(output.pixelSize(), QSize(1280, 1024));
|
2021-04-04 17:05:10 +00:00
|
|
|
QCOMPARE(output.refreshRate(), 90000);
|
2014-08-26 14:07:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestWaylandOutput::testScaleChange()
|
|
|
|
{
|
2022-10-15 11:52:22 +00:00
|
|
|
auto outputHandle = std::make_unique<FakeOutput>();
|
|
|
|
outputHandle->setMode(QSize(1024, 768), 60000);
|
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
auto outputInterface = std::make_unique<KWin::OutputInterface>(m_display, outputHandle.get());
|
2022-10-15 11:52:22 +00:00
|
|
|
|
2014-09-17 14:17:26 +00:00
|
|
|
KWayland::Client::Registry registry;
|
2021-02-25 13:48:11 +00:00
|
|
|
QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced);
|
2014-08-26 14:07:39 +00:00
|
|
|
registry.create(m_connection->display());
|
|
|
|
QVERIFY(registry.isValid());
|
|
|
|
registry.setup();
|
|
|
|
wl_display_flush(m_connection->display());
|
|
|
|
QVERIFY(announced.wait());
|
|
|
|
|
2014-09-17 14:17:26 +00:00
|
|
|
KWayland::Client::Output output;
|
2021-02-25 13:48:11 +00:00
|
|
|
QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed);
|
2014-08-26 14:07:39 +00:00
|
|
|
output.setup(registry.bindOutput(announced.first().first().value<quint32>(), announced.first().last().value<quint32>()));
|
|
|
|
wl_display_flush(m_connection->display());
|
|
|
|
QVERIFY(outputChanged.wait());
|
|
|
|
QCOMPARE(output.scale(), 1);
|
|
|
|
|
|
|
|
// change the scale
|
|
|
|
outputChanged.clear();
|
2022-10-15 11:52:22 +00:00
|
|
|
outputHandle->setScale(2);
|
2014-08-26 14:07:39 +00:00
|
|
|
QVERIFY(outputChanged.wait());
|
|
|
|
QCOMPARE(output.scale(), 2);
|
2016-06-13 17:19:06 +00:00
|
|
|
// changing to same value should not trigger
|
2022-10-15 11:52:22 +00:00
|
|
|
outputHandle->setScale(2);
|
2016-06-13 17:19:06 +00:00
|
|
|
QVERIFY(!outputChanged.wait(100));
|
2014-08-26 14:07:39 +00:00
|
|
|
|
|
|
|
// change once more
|
|
|
|
outputChanged.clear();
|
2022-10-15 11:52:22 +00:00
|
|
|
outputHandle->setScale(4);
|
2014-08-26 14:07:39 +00:00
|
|
|
QVERIFY(outputChanged.wait());
|
|
|
|
QCOMPARE(output.scale(), 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestWaylandOutput::testSubPixel_data()
|
|
|
|
{
|
2014-09-17 14:17:26 +00:00
|
|
|
QTest::addColumn<KWayland::Client::Output::SubPixel>("expected");
|
2022-05-17 13:33:03 +00:00
|
|
|
QTest::addColumn<KWin::Output::SubPixel>("actual");
|
2014-08-26 14:07:39 +00:00
|
|
|
|
2022-11-08 21:15:17 +00:00
|
|
|
QTest::newRow("none") << KWayland::Client::Output::SubPixel::None << KWin::Output::SubPixel::None;
|
|
|
|
QTest::newRow("horizontal/rgb") << KWayland::Client::Output::SubPixel::HorizontalRGB << KWin::Output::SubPixel::Horizontal_RGB;
|
|
|
|
QTest::newRow("horizontal/bgr") << KWayland::Client::Output::SubPixel::HorizontalBGR << KWin::Output::SubPixel::Horizontal_BGR;
|
|
|
|
QTest::newRow("vertical/rgb") << KWayland::Client::Output::SubPixel::VerticalRGB << KWin::Output::SubPixel::Vertical_RGB;
|
|
|
|
QTest::newRow("vertical/bgr") << KWayland::Client::Output::SubPixel::VerticalBGR << KWin::Output::SubPixel::Vertical_BGR;
|
2014-08-26 14:07:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestWaylandOutput::testSubPixel()
|
|
|
|
{
|
2022-10-15 11:52:22 +00:00
|
|
|
QFETCH(KWin::Output::SubPixel, actual);
|
|
|
|
|
|
|
|
auto outputHandle = std::make_unique<FakeOutput>();
|
|
|
|
outputHandle->setMode(QSize(1024, 768), 60000);
|
|
|
|
outputHandle->setSubPixel(actual);
|
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
auto outputInterface = std::make_unique<KWin::OutputInterface>(m_display, outputHandle.get());
|
2022-10-15 11:52:22 +00:00
|
|
|
|
2014-09-17 14:17:26 +00:00
|
|
|
KWayland::Client::Registry registry;
|
2021-02-25 13:48:11 +00:00
|
|
|
QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced);
|
2014-08-26 14:07:39 +00:00
|
|
|
registry.create(m_connection->display());
|
|
|
|
QVERIFY(registry.isValid());
|
|
|
|
registry.setup();
|
|
|
|
wl_display_flush(m_connection->display());
|
|
|
|
QVERIFY(announced.wait());
|
|
|
|
|
2014-09-17 14:17:26 +00:00
|
|
|
KWayland::Client::Output output;
|
2021-02-25 13:48:11 +00:00
|
|
|
QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed);
|
2014-08-26 14:07:39 +00:00
|
|
|
output.setup(registry.bindOutput(announced.first().first().value<quint32>(), announced.first().last().value<quint32>()));
|
|
|
|
wl_display_flush(m_connection->display());
|
|
|
|
if (outputChanged.isEmpty()) {
|
|
|
|
QVERIFY(outputChanged.wait());
|
|
|
|
}
|
|
|
|
|
|
|
|
QTEST(output.subPixel(), "expected");
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestWaylandOutput::testTransform_data()
|
|
|
|
{
|
2014-09-17 14:17:26 +00:00
|
|
|
QTest::addColumn<KWayland::Client::Output::Transform>("expected");
|
2023-07-10 10:57:57 +00:00
|
|
|
QTest::addColumn<KWin::OutputTransform::Kind>("actual");
|
2023-07-10 10:33:09 +00:00
|
|
|
|
|
|
|
QTest::newRow("90") << KWayland::Client::Output::Transform::Rotated90 << KWin::OutputTransform::Rotated90;
|
|
|
|
QTest::newRow("180") << KWayland::Client::Output::Transform::Rotated180 << KWin::OutputTransform::Rotated180;
|
|
|
|
QTest::newRow("270") << KWayland::Client::Output::Transform::Rotated270 << KWin::OutputTransform::Rotated270;
|
|
|
|
QTest::newRow("Flipped") << KWayland::Client::Output::Transform::Flipped << KWin::OutputTransform::Flipped;
|
|
|
|
QTest::newRow("Flipped 90") << KWayland::Client::Output::Transform::Flipped90 << KWin::OutputTransform::Flipped90;
|
|
|
|
QTest::newRow("Flipped 180") << KWayland::Client::Output::Transform::Flipped180 << KWin::OutputTransform::Flipped180;
|
|
|
|
QTest::newRow("Flipped 280") << KWayland::Client::Output::Transform::Flipped270 << KWin::OutputTransform::Flipped270;
|
2014-08-26 14:07:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestWaylandOutput::testTransform()
|
|
|
|
{
|
2023-07-10 10:57:57 +00:00
|
|
|
QFETCH(KWin::OutputTransform::Kind, actual);
|
2022-10-15 11:52:22 +00:00
|
|
|
|
|
|
|
auto outputHandle = std::make_unique<FakeOutput>();
|
|
|
|
outputHandle->setMode(QSize(1024, 768), 60000);
|
|
|
|
outputHandle->setTransform(actual);
|
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
auto outputInterface = std::make_unique<KWin::OutputInterface>(m_display, outputHandle.get());
|
2022-10-15 11:52:22 +00:00
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
using namespace KWin;
|
2014-08-26 14:07:39 +00:00
|
|
|
|
2014-09-17 14:17:26 +00:00
|
|
|
KWayland::Client::Registry registry;
|
2021-02-25 13:48:11 +00:00
|
|
|
QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced);
|
2014-08-26 14:07:39 +00:00
|
|
|
registry.create(m_connection->display());
|
|
|
|
QVERIFY(registry.isValid());
|
|
|
|
registry.setup();
|
|
|
|
wl_display_flush(m_connection->display());
|
|
|
|
QVERIFY(announced.wait());
|
|
|
|
|
2014-09-19 08:42:44 +00:00
|
|
|
KWayland::Client::Output *output = registry.createOutput(announced.first().first().value<quint32>(), announced.first().last().value<quint32>(), ®istry);
|
2021-02-25 13:48:11 +00:00
|
|
|
QSignalSpy outputChanged(output, &KWayland::Client::Output::changed);
|
2014-08-26 14:07:39 +00:00
|
|
|
wl_display_flush(m_connection->display());
|
|
|
|
if (outputChanged.isEmpty()) {
|
|
|
|
QVERIFY(outputChanged.wait());
|
|
|
|
}
|
|
|
|
|
2014-09-19 08:42:44 +00:00
|
|
|
QTEST(output->transform(), "expected");
|
2014-08-26 14:07:39 +00:00
|
|
|
|
|
|
|
// change back to normal
|
|
|
|
outputChanged.clear();
|
2023-07-10 10:33:09 +00:00
|
|
|
outputHandle->setTransform(KWin::OutputTransform::Normal);
|
2014-08-26 14:07:39 +00:00
|
|
|
if (outputChanged.isEmpty()) {
|
|
|
|
QVERIFY(outputChanged.wait());
|
|
|
|
}
|
2022-11-08 21:15:17 +00:00
|
|
|
QCOMPARE(output->transform(), KWayland::Client::Output::Transform::Normal);
|
2014-08-26 14:07:39 +00:00
|
|
|
}
|
|
|
|
|
2014-09-23 10:00:17 +00:00
|
|
|
QTEST_GUILESS_MAIN(TestWaylandOutput)
|
2014-08-19 14:08:02 +00:00
|
|
|
#include "test_wayland_output.moc"
|