Commit 146af48f authored by Martin Flöser's avatar Martin Flöser
Browse files

waylandServer()->backend() replaced by kwinApp()->platform()

parent 58b59d3e
......@@ -60,8 +60,8 @@ void DebugConsoleTest::initTestCase()
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(waylandServer()->backend(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(kwinApp()->platform(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
waylandServer()->init(s_socketName.toLocal8Bit());
kwinApp()->start();
......
......@@ -74,13 +74,13 @@ private:
};
#define MOTION(target) \
waylandServer()->backend()->pointerMotion(target, timestamp++)
kwinApp()->platform()->pointerMotion(target, timestamp++)
#define PRESS \
waylandServer()->backend()->pointerButtonPressed(BTN_LEFT, timestamp++)
kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++)
#define RELEASE \
waylandServer()->backend()->pointerButtonReleased(BTN_LEFT, timestamp++)
kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++)
AbstractClient *DecorationInputTest::showWindow()
{
......@@ -130,8 +130,8 @@ void DecorationInputTest::initTestCase()
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(waylandServer()->backend(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(kwinApp()->platform(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
waylandServer()->init(s_socketName.toLocal8Bit());
// change some options
......@@ -254,13 +254,13 @@ void DecorationInputTest::testAxis()
// TODO: mouse wheel direction looks wrong to me
// simulate wheel
waylandServer()->backend()->pointerAxisVertical(5.0, timestamp++);
kwinApp()->platform()->pointerAxisVertical(5.0, timestamp++);
QVERIFY(c->keepBelow());
QVERIFY(!c->keepAbove());
waylandServer()->backend()->pointerAxisVertical(-5.0, timestamp++);
kwinApp()->platform()->pointerAxisVertical(-5.0, timestamp++);
QVERIFY(!c->keepBelow());
QVERIFY(!c->keepAbove());
waylandServer()->backend()->pointerAxisVertical(-5.0, timestamp++);
kwinApp()->platform()->pointerAxisVertical(-5.0, timestamp++);
QVERIFY(!c->keepBelow());
QVERIFY(c->keepAbove());
}
......
......@@ -71,7 +71,7 @@ void DontCrashCancelAnimationFromAnimationEndedTest::initTestCase()
qRegisterMetaType<KWin::Deleted*>();
qRegisterMetaType<KWin::ShellClient*>();
qRegisterMetaType<KWin::AbstractClient*>();
waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024));
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
waylandServer()->init(s_socketName.toLocal8Bit());
kwinApp()->start();
QVERIFY(Compositor::self());
......
......@@ -46,7 +46,7 @@ void DontCrashGlxgearsTest::initTestCase()
qRegisterMetaType<KWin::Deleted*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024));
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
waylandServer()->init(s_socketName.toLocal8Bit());
kwinApp()->start();
QVERIFY(workspaceCreatedSpy.wait());
......
......@@ -73,8 +73,8 @@ void InputStackingOrderTest::initTestCase()
qRegisterMetaType<KWin::Deleted*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(waylandServer()->backend(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(kwinApp()->platform(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
waylandServer()->init(s_socketName.toLocal8Bit());
kwinApp()->start();
......@@ -220,7 +220,7 @@ void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange()
QCOMPARE(window1->geometry(), window2->geometry());
// enter
waylandServer()->backend()->pointerMotion(QPointF(25, 25), 1);
kwinApp()->platform()->pointerMotion(QPointF(25, 25), 1);
QVERIFY(enteredSpy.wait());
QCOMPARE(enteredSpy.count(), 1);
// window 2 should have focus
......
......@@ -142,8 +142,8 @@ void InternalWindowTest::initTestCase()
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(waylandServer()->backend(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(kwinApp()->platform(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
waylandServer()->init(s_socketName.toLocal8Bit());
kwinApp()->start();
......@@ -182,14 +182,14 @@ void InternalWindowTest::testEnterLeave()
QVERIFY(moveSpy.isValid());
quint32 timestamp = 1;
waylandServer()->backend()->pointerMotion(QPoint(50, 50), timestamp++);
kwinApp()->platform()->pointerMotion(QPoint(50, 50), timestamp++);
QTRY_COMPARE(enterSpy.count(), 1);
waylandServer()->backend()->pointerMotion(QPoint(60, 50), timestamp++);
kwinApp()->platform()->pointerMotion(QPoint(60, 50), timestamp++);
QTRY_COMPARE(moveSpy.count(), 1);
QCOMPARE(moveSpy.first().first().toPoint(), QPoint(60, 50));
waylandServer()->backend()->pointerMotion(QPoint(101, 50), timestamp++);
kwinApp()->platform()->pointerMotion(QPoint(101, 50), timestamp++);
QTRY_COMPARE(leaveSpy.count(), 1);
}
......@@ -209,11 +209,11 @@ void InternalWindowTest::testPointerPressRelease()
QCOMPARE(clientAddedSpy.count(), 1);
quint32 timestamp = 1;
waylandServer()->backend()->pointerMotion(QPoint(50, 50), timestamp++);
kwinApp()->platform()->pointerMotion(QPoint(50, 50), timestamp++);
waylandServer()->backend()->pointerButtonPressed(BTN_LEFT, timestamp++);
kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++);
QTRY_COMPARE(pressSpy.count(), 1);
waylandServer()->backend()->pointerButtonReleased(BTN_LEFT, timestamp++);
kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++);
QTRY_COMPARE(releaseSpy.count(), 1);
}
......@@ -230,11 +230,11 @@ void InternalWindowTest::testPointerAxis()
QCOMPARE(clientAddedSpy.count(), 1);
quint32 timestamp = 1;
waylandServer()->backend()->pointerMotion(QPoint(50, 50), timestamp++);
kwinApp()->platform()->pointerMotion(QPoint(50, 50), timestamp++);
waylandServer()->backend()->pointerAxisVertical(5.0, timestamp++);
kwinApp()->platform()->pointerAxisVertical(5.0, timestamp++);
QTRY_COMPARE(wheelSpy.count(), 1);
waylandServer()->backend()->pointerAxisHorizontal(5.0, timestamp++);
kwinApp()->platform()->pointerAxisHorizontal(5.0, timestamp++);
QTRY_COMPARE(wheelSpy.count(), 2);
}
......@@ -262,12 +262,12 @@ void InternalWindowTest::testKeyboard()
quint32 timestamp = 1;
QFETCH(QPoint, cursorPos);
waylandServer()->backend()->pointerMotion(cursorPos, timestamp++);
kwinApp()->platform()->pointerMotion(cursorPos, timestamp++);
waylandServer()->backend()->keyboardKeyPressed(KEY_A, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_A, timestamp++);
QTRY_COMPARE(pressSpy.count(), 1);
QCOMPARE(releaseSpy.count(), 0);
waylandServer()->backend()->keyboardKeyReleased(KEY_A, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_A, timestamp++);
QTRY_COMPARE(releaseSpy.count(), 1);
QCOMPARE(pressSpy.count(), 1);
}
......
......@@ -55,7 +55,7 @@ WaylandTestApplication::WaylandTestApplication(int &argc, char **argv)
WaylandTestApplication::~WaylandTestApplication()
{
waylandServer()->backend()->setOutputsEnabled(false);
kwinApp()->platform()->setOutputsEnabled(false);
destroyWorkspace();
waylandServer()->dispatch();
// need to unload all effects prior to destroying X connection as they might do X calls
......@@ -94,7 +94,7 @@ void WaylandTestApplication::performStartup()
void WaylandTestApplication::createBackend()
{
AbstractBackend *backend = waylandServer()->backend();
AbstractBackend *backend = kwinApp()->platform();
connect(backend, &AbstractBackend::screensQueried, this, &WaylandTestApplication::continueStartupWithScreens);
connect(backend, &AbstractBackend::initFailed, this,
[] () {
......@@ -107,7 +107,7 @@ void WaylandTestApplication::createBackend()
void WaylandTestApplication::continueStartupWithScreens()
{
disconnect(waylandServer()->backend(), &AbstractBackend::screensQueried, this, &WaylandTestApplication::continueStartupWithScreens);
disconnect(kwinApp()->platform(), &AbstractBackend::screensQueried, this, &WaylandTestApplication::continueStartupWithScreens);
createScreens();
waylandServer()->initOutputs();
......
......@@ -128,19 +128,19 @@ Q_SIGNALS:
QVERIFY(!waylandServer()->isScreenLocked());
#define MOTION(target) \
waylandServer()->backend()->pointerMotion(target, timestamp++)
kwinApp()->platform()->pointerMotion(target, timestamp++)
#define PRESS \
waylandServer()->backend()->pointerButtonPressed(BTN_LEFT, timestamp++)
kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++)
#define RELEASE \
waylandServer()->backend()->pointerButtonReleased(BTN_LEFT, timestamp++)
kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++)
#define KEYPRESS( key ) \
waylandServer()->backend()->keyboardKeyPressed(key, timestamp++)
kwinApp()->platform()->keyboardKeyPressed(key, timestamp++)
#define KEYRELEASE( key ) \
waylandServer()->backend()->keyboardKeyReleased(key, timestamp++)
kwinApp()->platform()->keyboardKeyReleased(key, timestamp++)
void LockScreenTest::unlock()
{
......@@ -196,8 +196,8 @@ void LockScreenTest::initTestCase()
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(waylandServer()->backend(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(kwinApp()->platform(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
waylandServer()->init(s_socketName.toLocal8Bit());
kwinApp()->start();
......@@ -390,24 +390,24 @@ void LockScreenTest::testPointerAxis()
quint32 timestamp = 1;
MOTION(c->geometry().center());
// and simulate axis
waylandServer()->backend()->pointerAxisHorizontal(5.0, timestamp++);
kwinApp()->platform()->pointerAxisHorizontal(5.0, timestamp++);
QVERIFY(axisChangedSpy.wait());
LOCK
// and simulate axis
waylandServer()->backend()->pointerAxisHorizontal(5.0, timestamp++);
kwinApp()->platform()->pointerAxisHorizontal(5.0, timestamp++);
QVERIFY(!axisChangedSpy.wait(100));
waylandServer()->backend()->pointerAxisVertical(5.0, timestamp++);
kwinApp()->platform()->pointerAxisVertical(5.0, timestamp++);
QVERIFY(!axisChangedSpy.wait(100));
// and unlock
UNLOCK
// and move axis again
waylandServer()->backend()->pointerAxisHorizontal(5.0, timestamp++);
kwinApp()->platform()->pointerAxisHorizontal(5.0, timestamp++);
QVERIFY(axisChangedSpy.wait());
waylandServer()->backend()->pointerAxisVertical(5.0, timestamp++);
kwinApp()->platform()->pointerAxisVertical(5.0, timestamp++);
QVERIFY(axisChangedSpy.wait());
}
......@@ -621,32 +621,32 @@ void LockScreenTest::testMoveWindow()
workspace()->slotWindowMove();
QCOMPARE(workspace()->getMovingClient(), c);
QVERIFY(c->isMove());
waylandServer()->backend()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
waylandServer()->backend()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
QEXPECT_FAIL("", "First event is ignored", Continue);
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
// TODO adjust once the expected fail is fixed
waylandServer()->backend()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
waylandServer()->backend()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
// while locking our window should continue to be in move resize
LOCK
QCOMPARE(workspace()->getMovingClient(), c);
QVERIFY(c->isMove());
waylandServer()->backend()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
waylandServer()->backend()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
UNLOCK
QCOMPARE(workspace()->getMovingClient(), c);
QVERIFY(c->isMove());
waylandServer()->backend()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
waylandServer()->backend()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
QCOMPARE(clientStepUserMovedResizedSpy.count(), 2);
waylandServer()->backend()->keyboardKeyPressed(KEY_ESC, timestamp++);
waylandServer()->backend()->keyboardKeyReleased(KEY_ESC, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_ESC, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_ESC, timestamp++);
QVERIFY(!c->isMove());
}
......@@ -661,12 +661,12 @@ void LockScreenTest::testPointerShortcut()
// try to trigger the shortcut
quint32 timestamp = 1;
#define PERFORM(expectedCount) \
waylandServer()->backend()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++); \
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++); \
PRESS; \
QCoreApplication::instance()->processEvents(); \
QCOMPARE(actionSpy.count(), expectedCount); \
RELEASE; \
waylandServer()->backend()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++); \
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++); \
QCoreApplication::instance()->processEvents(); \
QCOMPARE(actionSpy.count(), expectedCount);
......@@ -713,14 +713,14 @@ void LockScreenTest::testAxisShortcut()
// try to trigger the shortcut
quint32 timestamp = 1;
#define PERFORM(expectedCount) \
waylandServer()->backend()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++); \
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++); \
if (direction == Qt::Vertical) \
waylandServer()->backend()->pointerAxisVertical(sign * 5.0, timestamp++); \
kwinApp()->platform()->pointerAxisVertical(sign * 5.0, timestamp++); \
else \
waylandServer()->backend()->pointerAxisHorizontal(sign * 5.0, timestamp++); \
kwinApp()->platform()->pointerAxisHorizontal(sign * 5.0, timestamp++); \
QCoreApplication::instance()->processEvents(); \
QCOMPARE(actionSpy.count(), expectedCount); \
waylandServer()->backend()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++); \
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++); \
QCoreApplication::instance()->processEvents(); \
QCOMPARE(actionSpy.count(), expectedCount);
......@@ -792,24 +792,24 @@ void LockScreenTest::testTouch()
QVERIFY(pointRemovedSpy.isValid());
quint32 timestamp = 1;
waylandServer()->backend()->touchDown(1, QPointF(25, 25), timestamp++);
kwinApp()->platform()->touchDown(1, QPointF(25, 25), timestamp++);
QVERIFY(sequenceStartedSpy.wait());
QCOMPARE(sequenceStartedSpy.count(), 1);
LOCK
QVERIFY(cancelSpy.wait());
waylandServer()->backend()->touchUp(1, timestamp++);
kwinApp()->platform()->touchUp(1, timestamp++);
QVERIFY(!pointRemovedSpy.wait(100));
waylandServer()->backend()->touchDown(1, QPointF(25, 25), timestamp++);
waylandServer()->backend()->touchMotion(1, QPointF(26, 26), timestamp++);
waylandServer()->backend()->touchUp(1, timestamp++);
kwinApp()->platform()->touchDown(1, QPointF(25, 25), timestamp++);
kwinApp()->platform()->touchMotion(1, QPointF(26, 26), timestamp++);
kwinApp()->platform()->touchUp(1, timestamp++);
UNLOCK
waylandServer()->backend()->touchDown(1, QPointF(25, 25), timestamp++);
kwinApp()->platform()->touchDown(1, QPointF(25, 25), timestamp++);
QVERIFY(sequenceStartedSpy.wait());
QCOMPARE(sequenceStartedSpy.count(), 2);
waylandServer()->backend()->touchUp(1, timestamp++);
kwinApp()->platform()->touchUp(1, timestamp++);
QVERIFY(pointRemovedSpy.wait());
QCOMPARE(pointRemovedSpy.count(), 1);
}
......
......@@ -83,7 +83,7 @@ void MoveResizeWindowTest::initTestCase()
qRegisterMetaType<KWin::MaximizeMode>("MaximizeMode");
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024));
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
waylandServer()->init(s_socketName.toLocal8Bit());
kwinApp()->start();
QVERIFY(workspaceCreatedSpy.wait());
......@@ -506,22 +506,22 @@ void MoveResizeWindowTest::testPointerMoveEnd()
// let's trigger the left button
quint32 timestamp = 1;
waylandServer()->backend()->pointerButtonPressed(BTN_LEFT, timestamp++);
kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++);
QVERIFY(!c->isMove());
workspace()->slotWindowMove();
QVERIFY(c->isMove());
// let's press another button
QFETCH(int, additionalButton);
waylandServer()->backend()->pointerButtonPressed(additionalButton, timestamp++);
kwinApp()->platform()->pointerButtonPressed(additionalButton, timestamp++);
QVERIFY(c->isMove());
// release the left button, should still have the window moving
waylandServer()->backend()->pointerButtonReleased(BTN_LEFT, timestamp++);
kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++);
QVERIFY(c->isMove());
// but releasing the other button should now end moving
waylandServer()->backend()->pointerButtonReleased(additionalButton, timestamp++);
kwinApp()->platform()->pointerButtonReleased(additionalButton, timestamp++);
QVERIFY(!c->isMove());
}
......
......@@ -39,7 +39,7 @@ void PlatformCursorTest::initTestCase()
{
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024));
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
waylandServer()->init(s_socketName.toLocal8Bit());
kwinApp()->start();
QVERIFY(workspaceCreatedSpy.wait());
......
......@@ -91,8 +91,8 @@ void PointerInputTest::initTestCase()
qRegisterMetaType<KWin::Deleted*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(waylandServer()->backend(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(kwinApp()->platform(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
waylandServer()->init(s_socketName.toLocal8Bit());
kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig));
......@@ -272,7 +272,7 @@ void PointerInputTest::testWarpingGeneratesPointerMotion()
QVERIFY(window);
// enter
waylandServer()->backend()->pointerMotion(QPointF(25, 25), 1);
kwinApp()->platform()->pointerMotion(QPointF(25, 25), 1);
QVERIFY(enteredSpy.wait());
// we get a move event together with the enter, that's actually wrong but also shouldn't harm
QVERIFY(movedSpy.wait());
......@@ -317,8 +317,8 @@ void PointerInputTest::testUpdateFocusAfterScreenChange()
QSignalSpy screensChangedSpy(screens(), &Screens::changed);
QVERIFY(screensChangedSpy.isValid());
// now let's remove the screen containing the cursor
QMetaObject::invokeMethod(waylandServer()->backend(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 1));
QMetaObject::invokeMethod(waylandServer()->backend(), "sizeChanged", Qt::QueuedConnection);
QMetaObject::invokeMethod(kwinApp()->platform(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 1));
QMetaObject::invokeMethod(kwinApp()->platform(), "sizeChanged", Qt::QueuedConnection);
QVERIFY(screensChangedSpy.wait());
QCOMPARE(screens()->count(), 1);
......@@ -399,15 +399,15 @@ void PointerInputTest::testModifierClickUnrestrictedMove()
quint32 timestamp = 1;
QFETCH(int, modifierKey);
QFETCH(int, mouseButton);
waylandServer()->backend()->keyboardKeyPressed(modifierKey, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(modifierKey, timestamp++);
QVERIFY(!window->isMove());
waylandServer()->backend()->pointerButtonPressed(mouseButton, timestamp++);
kwinApp()->platform()->pointerButtonPressed(mouseButton, timestamp++);
QVERIFY(window->isMove());
// release modifier should not change it
waylandServer()->backend()->keyboardKeyReleased(modifierKey, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(modifierKey, timestamp++);
QVERIFY(window->isMove());
// but releasing the key should end move/resize
waylandServer()->backend()->pointerButtonReleased(mouseButton, timestamp++);
kwinApp()->platform()->pointerButtonReleased(mouseButton, timestamp++);
QVERIFY(!window->isMove());
// all of that should not have triggered button events on the surface
......@@ -471,12 +471,12 @@ void PointerInputTest::testModifierScrollOpacity()
// simulate modifier+wheel
quint32 timestamp = 1;
QFETCH(int, modifierKey);
waylandServer()->backend()->keyboardKeyPressed(modifierKey, timestamp++);
waylandServer()->backend()->pointerAxisVertical(-5, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(modifierKey, timestamp++);
kwinApp()->platform()->pointerAxisVertical(-5, timestamp++);
QCOMPARE(window->opacity(), 0.6);
waylandServer()->backend()->pointerAxisVertical(5, timestamp++);
kwinApp()->platform()->pointerAxisVertical(5, timestamp++);
QCOMPARE(window->opacity(), 0.5);
waylandServer()->backend()->keyboardKeyReleased(modifierKey, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(modifierKey, timestamp++);
// axis should have been filtered out
QCOMPARE(axisSpy.count(), 0);
......@@ -524,7 +524,7 @@ void PointerInputTest::testScrollAction()
quint32 timestamp = 1;
QVERIFY(!window1->isActive());
waylandServer()->backend()->pointerAxisVertical(5, timestamp++);
kwinApp()->platform()->pointerAxisVertical(5, timestamp++);
QVERIFY(window1->isActive());
// but also the wheel event should be passed to the window
......@@ -689,7 +689,7 @@ void PointerInputTest::testMouseActionInactiveWindow()
// and click
quint32 timestamp = 1;
QFETCH(quint32, button);
waylandServer()->backend()->pointerButtonPressed(button, timestamp++);
kwinApp()->platform()->pointerButtonPressed(button, timestamp++);
// should raise window1 and activate it
QCOMPARE(stackingOrderChangedSpy.count(), 1);
QVERIFY(!activeWindowChangedSpy.isEmpty());
......@@ -698,7 +698,7 @@ void PointerInputTest::testMouseActionInactiveWindow()
QVERIFY(!window2->isActive());
// release again
waylandServer()->backend()->pointerButtonReleased(button, timestamp++);
kwinApp()->platform()->pointerButtonReleased(button, timestamp++);
}
void PointerInputTest::testMouseActionActiveWindow_data()
......@@ -773,7 +773,7 @@ void PointerInputTest::testMouseActionActiveWindow()
// and click
quint32 timestamp = 1;
QFETCH(quint32, button);
waylandServer()->backend()->pointerButtonPressed(button, timestamp++);
kwinApp()->platform()->pointerButtonPressed(button, timestamp++);
QVERIFY(buttonSpy.wait());
if (clickRaise) {
QCOMPARE(stackingOrderChangedSpy.count(), 1);
......@@ -785,7 +785,7 @@ void PointerInputTest::testMouseActionActiveWindow()
}
// release again
waylandServer()->backend()->pointerButtonReleased(button, timestamp++);
kwinApp()->platform()->pointerButtonReleased(button, timestamp++);
}
void PointerInputTest::testCursorImage()
......
......@@ -76,8 +76,8 @@ void QuickTilingTest::initTestCase()
qRegisterMetaType<KWin::MaximizeMode>("MaximizeMode");
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(waylandServer()->backend(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(kwinApp()->platform(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2));
waylandServer()->init(s_socketName.toLocal8Bit());
// set custom config which disables the Outline
......@@ -428,26 +428,26 @@ void QuickTilingTest::testQuickTilingKeyboardMove()
QFETCH(QPoint, targetPos);
quint32 timestamp = 1;
waylandServer()->backend()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
while (Cursor::pos().x() > targetPos.x()) {
waylandServer()->backend()->keyboardKeyPressed(KEY_LEFT, timestamp++);
waylandServer()->backend()->keyboardKeyReleased(KEY_LEFT, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFT, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFT, timestamp++);
}
while (Cursor::pos().x() < targetPos.x()) {
waylandServer()->backend()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
waylandServer()->backend()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_RIGHT, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_RIGHT, timestamp++);
}
while (Cursor::pos().y() < targetPos.y()) {
waylandServer()->backend()->keyboardKeyPressed(KEY_DOWN, timestamp++);
waylandServer()->backend()->keyboardKeyReleased(KEY_DOWN, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_DOWN, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_DOWN, timestamp++);
}
while (Cursor::pos().y() > targetPos.y()) {
waylandServer()->backend()->keyboardKeyPressed(KEY_UP, timestamp++);
waylandServer()->backend()->keyboardKeyReleased(KEY_UP, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_UP, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_UP, timestamp++);
}