diff --git a/autotests/wayland/debug_console_test.cpp b/autotests/wayland/debug_console_test.cpp index e5463d940b..2b263583c1 100644 --- a/autotests/wayland/debug_console_test.cpp +++ b/autotests/wayland/debug_console_test.cpp @@ -60,8 +60,8 @@ void DebugConsoleTest::initTestCase() qRegisterMetaType(); 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(); diff --git a/autotests/wayland/decoration_input_test.cpp b/autotests/wayland/decoration_input_test.cpp index 07bee5201d..56474cb96d 100644 --- a/autotests/wayland/decoration_input_test.cpp +++ b/autotests/wayland/decoration_input_test.cpp @@ -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(); 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()); } diff --git a/autotests/wayland/dont_crash_cancel_animation.cpp b/autotests/wayland/dont_crash_cancel_animation.cpp index a2ade19eb4..8e2bb8cd0a 100644 --- a/autotests/wayland/dont_crash_cancel_animation.cpp +++ b/autotests/wayland/dont_crash_cancel_animation.cpp @@ -71,7 +71,7 @@ void DontCrashCancelAnimationFromAnimationEndedTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); - waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); waylandServer()->init(s_socketName.toLocal8Bit()); kwinApp()->start(); QVERIFY(Compositor::self()); diff --git a/autotests/wayland/dont_crash_glxgears.cpp b/autotests/wayland/dont_crash_glxgears.cpp index 3ce7dbed01..4dfee5fad2 100644 --- a/autotests/wayland/dont_crash_glxgears.cpp +++ b/autotests/wayland/dont_crash_glxgears.cpp @@ -46,7 +46,7 @@ void DontCrashGlxgearsTest::initTestCase() qRegisterMetaType(); 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()); diff --git a/autotests/wayland/input_stacking_order.cpp b/autotests/wayland/input_stacking_order.cpp index 631575689b..8d410c2953 100644 --- a/autotests/wayland/input_stacking_order.cpp +++ b/autotests/wayland/input_stacking_order.cpp @@ -73,8 +73,8 @@ void InputStackingOrderTest::initTestCase() qRegisterMetaType(); 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 diff --git a/autotests/wayland/internal_window.cpp b/autotests/wayland/internal_window.cpp index af449c3797..6c49bfd169 100644 --- a/autotests/wayland/internal_window.cpp +++ b/autotests/wayland/internal_window.cpp @@ -142,8 +142,8 @@ void InternalWindowTest::initTestCase() qRegisterMetaType(); 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); } diff --git a/autotests/wayland/kwin_wayland_test.cpp b/autotests/wayland/kwin_wayland_test.cpp index 6cacc6a082..0d12834a53 100644 --- a/autotests/wayland/kwin_wayland_test.cpp +++ b/autotests/wayland/kwin_wayland_test.cpp @@ -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(); diff --git a/autotests/wayland/lockscreen.cpp b/autotests/wayland/lockscreen.cpp index 243aa13e10..49014915f7 100644 --- a/autotests/wayland/lockscreen.cpp +++ b/autotests/wayland/lockscreen.cpp @@ -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(); 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); } diff --git a/autotests/wayland/move_resize_window_test.cpp b/autotests/wayland/move_resize_window_test.cpp index 93a0e9519e..bf31b3f29b 100644 --- a/autotests/wayland/move_resize_window_test.cpp +++ b/autotests/wayland/move_resize_window_test.cpp @@ -83,7 +83,7 @@ void MoveResizeWindowTest::initTestCase() qRegisterMetaType("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()); } diff --git a/autotests/wayland/platformcursor.cpp b/autotests/wayland/platformcursor.cpp index 1a50ecf099..fecf208ae2 100644 --- a/autotests/wayland/platformcursor.cpp +++ b/autotests/wayland/platformcursor.cpp @@ -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()); diff --git a/autotests/wayland/pointer_input.cpp b/autotests/wayland/pointer_input.cpp index 89bdb4ffa3..b4e7360c8b 100644 --- a/autotests/wayland/pointer_input.cpp +++ b/autotests/wayland/pointer_input.cpp @@ -91,8 +91,8 @@ void PointerInputTest::initTestCase() qRegisterMetaType(); 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() diff --git a/autotests/wayland/quick_tiling_test.cpp b/autotests/wayland/quick_tiling_test.cpp index ebc596d8bf..db4524cc88 100644 --- a/autotests/wayland/quick_tiling_test.cpp +++ b/autotests/wayland/quick_tiling_test.cpp @@ -76,8 +76,8 @@ void QuickTilingTest::initTestCase() qRegisterMetaType("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++); } - waylandServer()->backend()->keyboardKeyReleased(KEY_LEFTCTRL, timestamp++); - waylandServer()->backend()->keyboardKeyPressed(KEY_ENTER, timestamp++); - waylandServer()->backend()->keyboardKeyReleased(KEY_ENTER, timestamp++); + kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTCTRL, timestamp++); + kwinApp()->platform()->keyboardKeyPressed(KEY_ENTER, timestamp++); + kwinApp()->platform()->keyboardKeyReleased(KEY_ENTER, timestamp++); QCOMPARE(Cursor::pos(), targetPos); QVERIFY(!workspace()->getMovingClient()); @@ -509,9 +509,9 @@ void QuickTilingTest::testQuickTilingPointerMove() QFETCH(QPoint, targetPos); quint32 timestamp = 1; - waylandServer()->backend()->pointerMotion(targetPos, timestamp++); - waylandServer()->backend()->pointerButtonPressed(BTN_LEFT, timestamp++); - waylandServer()->backend()->pointerButtonReleased(BTN_LEFT, timestamp++); + kwinApp()->platform()->pointerMotion(targetPos, timestamp++); + kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); + kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); QCOMPARE(Cursor::pos(), targetPos); QVERIFY(!workspace()->getMovingClient()); diff --git a/autotests/wayland/start_test.cpp b/autotests/wayland/start_test.cpp index 0b1b4bcc36..acfdff58dd 100644 --- a/autotests/wayland/start_test.cpp +++ b/autotests/wayland/start_test.cpp @@ -51,7 +51,7 @@ void StartTest::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()); diff --git a/autotests/wayland/touch_input_test.cpp b/autotests/wayland/touch_input_test.cpp index 96f98ab2c4..241314529d 100644 --- a/autotests/wayland/touch_input_test.cpp +++ b/autotests/wayland/touch_input_test.cpp @@ -69,8 +69,8 @@ void TouchInputTest::initTestCase() qRegisterMetaType(); 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(); @@ -219,7 +219,7 @@ void TouchInputTest::testMultipleTouchPoints() QVERIFY(endedSpy.isValid()); quint32 timestamp = 1; - waylandServer()->backend()->touchDown(1, QPointF(125, 125), timestamp++); + kwinApp()->platform()->touchDown(1, QPointF(125, 125), timestamp++); QVERIFY(sequenceStartedSpy.wait()); QCOMPARE(sequenceStartedSpy.count(), 1); QCOMPARE(m_touch->sequence().count(), 1); @@ -229,7 +229,7 @@ void TouchInputTest::testMultipleTouchPoints() QCOMPARE(pointMovedSpy.count(), 0); // a point outside the window - waylandServer()->backend()->touchDown(2, QPointF(0, 0), timestamp++); + kwinApp()->platform()->touchDown(2, QPointF(0, 0), timestamp++); QVERIFY(pointAddedSpy.wait()); QCOMPARE(pointAddedSpy.count(), 1); QCOMPARE(m_touch->sequence().count(), 2); @@ -238,21 +238,21 @@ void TouchInputTest::testMultipleTouchPoints() QCOMPARE(pointMovedSpy.count(), 0); // let's move that one - waylandServer()->backend()->touchMotion(2, QPointF(100, 100), timestamp++); + kwinApp()->platform()->touchMotion(2, QPointF(100, 100), timestamp++); QVERIFY(pointMovedSpy.wait()); QCOMPARE(pointMovedSpy.count(), 1); QCOMPARE(m_touch->sequence().count(), 2); QCOMPARE(m_touch->sequence().at(1)->isDown(), true); QCOMPARE(m_touch->sequence().at(1)->position(), QPointF(0, 0)); - waylandServer()->backend()->touchUp(1, timestamp++); + kwinApp()->platform()->touchUp(1, timestamp++); QVERIFY(pointRemovedSpy.wait()); QCOMPARE(pointRemovedSpy.count(), 1); QCOMPARE(m_touch->sequence().count(), 2); QCOMPARE(m_touch->sequence().first()->isDown(), false); QCOMPARE(endedSpy.count(), 0); - waylandServer()->backend()->touchUp(2, timestamp++); + kwinApp()->platform()->touchUp(2, timestamp++); QVERIFY(pointRemovedSpy.wait()); QCOMPARE(pointRemovedSpy.count(), 2); QCOMPARE(m_touch->sequence().count(), 2); @@ -275,16 +275,16 @@ void TouchInputTest::testCancel() QVERIFY(pointRemovedSpy.isValid()); quint32 timestamp = 1; - waylandServer()->backend()->touchDown(1, QPointF(125, 125), timestamp++); + kwinApp()->platform()->touchDown(1, QPointF(125, 125), timestamp++); QVERIFY(sequenceStartedSpy.wait()); QCOMPARE(sequenceStartedSpy.count(), 1); // cancel - waylandServer()->backend()->touchCancel(); + kwinApp()->platform()->touchCancel(); QVERIFY(cancelSpy.wait()); QCOMPARE(cancelSpy.count(), 1); - waylandServer()->backend()->touchUp(1, timestamp++); + kwinApp()->platform()->touchUp(1, timestamp++); QVERIFY(!pointRemovedSpy.wait(100)); QCOMPARE(pointRemovedSpy.count(), 0); } @@ -307,14 +307,14 @@ void TouchInputTest::testTouchMouseAction() QVERIFY(sequenceStartedSpy.isValid()); quint32 timestamp = 1; - waylandServer()->backend()->touchDown(1, c1->geometry().center(), timestamp++); + kwinApp()->platform()->touchDown(1, c1->geometry().center(), timestamp++); QVERIFY(c1->isActive()); QVERIFY(sequenceStartedSpy.wait()); QCOMPARE(sequenceStartedSpy.count(), 1); // cleanup - waylandServer()->backend()->touchCancel(); + kwinApp()->platform()->touchCancel(); } } diff --git a/autotests/wayland/transient_no_input_test.cpp b/autotests/wayland/transient_no_input_test.cpp index 841674aa50..f65fcea20a 100644 --- a/autotests/wayland/transient_no_input_test.cpp +++ b/autotests/wayland/transient_no_input_test.cpp @@ -61,7 +61,7 @@ void TransientNoInputTest::initTestCase() qRegisterMetaType(); 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()); diff --git a/autotests/wayland/transient_placement.cpp b/autotests/wayland/transient_placement.cpp index 66831a2b41..0921f6523a 100644 --- a/autotests/wayland/transient_placement.cpp +++ b/autotests/wayland/transient_placement.cpp @@ -79,8 +79,8 @@ void TransientPlacementTest::initTestCase() qRegisterMetaType(); 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(); diff --git a/backends/hwcomposer/hwcomposer_backend.cpp b/backends/hwcomposer/hwcomposer_backend.cpp index bfbd205000..720ac1d736 100644 --- a/backends/hwcomposer/hwcomposer_backend.cpp +++ b/backends/hwcomposer/hwcomposer_backend.cpp @@ -23,6 +23,7 @@ along with this program. If not, see . #include "screens_hwcomposer.h" #include "composite.h" #include "input.h" +#include "main.h" #include "virtual_terminal.h" #include "wayland_server.h" // KWayland @@ -225,7 +226,7 @@ void HwcomposerBackend::init() if (disp != 0) { return; } - dynamic_cast(waylandServer()->backend())->wakeVSync(); + dynamic_cast(kwinApp()->platform())->wakeVSync(); }; procs->hotplug = [] (const struct hwc_procs* procs, int disp, int connected) { Q_UNUSED(procs) diff --git a/composite.cpp b/composite.cpp index dab48f4caf..5648c8e760 100644 --- a/composite.cpp +++ b/composite.cpp @@ -116,10 +116,10 @@ Compositor::Compositor(QObject* workspace) m_unusedSupportPropertyTimer.setSingleShot(true); connect(&m_unusedSupportPropertyTimer, SIGNAL(timeout()), SLOT(deleteUnusedSupportProperties())); if (kwinApp()->operationMode() != Application::OperationModeX11) { - if (waylandServer()->backend()->isReady()) { + if (kwinApp()->platform()->isReady()) { QMetaObject::invokeMethod(this, "setup", Qt::QueuedConnection); } - connect(waylandServer()->backend(), &AbstractBackend::readyChanged, this, + connect(kwinApp()->platform(), &AbstractBackend::readyChanged, this, [this] (bool ready) { if (ready) { setup(); @@ -649,7 +649,7 @@ void Compositor::performCompositing() // If outputs are disabled, we return to the event loop and // continue processing events until the outputs are enabled again - if (waylandServer() && !waylandServer()->backend()->areOutputsEnabled()) { + if (waylandServer() && !kwinApp()->platform()->areOutputsEnabled()) { compositeTimer.stop(); return; } @@ -796,7 +796,7 @@ void Compositor::setCompositeTimer() return; // Don't start the timer if all outputs are disabled - if (waylandServer() && !waylandServer()->backend()->areOutputsEnabled()) { + if (waylandServer() && !kwinApp()->platform()->areOutputsEnabled()) { return; } diff --git a/main_wayland.cpp b/main_wayland.cpp index 73396df1f3..13de72373a 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -84,7 +84,7 @@ ApplicationWayland::~ApplicationWayland() return; } - 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 @@ -130,7 +130,7 @@ void ApplicationWayland::setupCrashHandler() void ApplicationWayland::createBackend() { - AbstractBackend *backend = waylandServer()->backend(); + AbstractBackend *backend = kwinApp()->platform(); connect(backend, &AbstractBackend::screensQueried, this, &ApplicationWayland::continueStartupWithScreens); connect(backend, &AbstractBackend::initFailed, this, [] () { @@ -143,7 +143,7 @@ void ApplicationWayland::createBackend() void ApplicationWayland::continueStartupWithScreens() { - disconnect(waylandServer()->backend(), &AbstractBackend::screensQueried, this, &ApplicationWayland::continueStartupWithScreens); + disconnect(kwinApp()->platform(), &AbstractBackend::screensQueried, this, &ApplicationWayland::continueStartupWithScreens); createScreens(); waylandServer()->initOutputs(); @@ -699,12 +699,12 @@ int main(int argc, char * argv[]) return 1; } if (!deviceIdentifier.isEmpty()) { - server->backend()->setDeviceIdentifier(deviceIdentifier); + a.platform()->setDeviceIdentifier(deviceIdentifier); } if (initialWindowSize.isValid()) { - server->backend()->setInitialWindowSize(initialWindowSize); + a.platform()->setInitialWindowSize(initialWindowSize); } - server->backend()->setInitialOutputCount(outputCount); + a.platform()->setInitialOutputCount(outputCount); QObject::connect(&a, &KWin::Application::workspaceCreated, server, &KWin::WaylandServer::initWorkspace); environment.insert(QStringLiteral("WAYLAND_DISPLAY"), server->display()->socketName()); diff --git a/plugins/qpa/integration.cpp b/plugins/qpa/integration.cpp index 589d3e5a8b..6aef09e0f7 100644 --- a/plugins/qpa/integration.cpp +++ b/plugins/qpa/integration.cpp @@ -145,7 +145,7 @@ QPlatformNativeInterface *Integration::nativeInterface() const QPlatformOpenGLContext *Integration::createPlatformOpenGLContext(QOpenGLContext *context) const { - if (waylandServer()->backend()->supportsQpaContext()) { + if (kwinApp()->platform()->supportsQpaContext()) { return new SharingPlatformContext(context, const_cast(this)); } if (m_eglDisplay == EGL_NO_DISPLAY) { diff --git a/plugins/qpa/sharingplatformcontext.cpp b/plugins/qpa/sharingplatformcontext.cpp index 45314999a8..113852ea0e 100644 --- a/plugins/qpa/sharingplatformcontext.cpp +++ b/plugins/qpa/sharingplatformcontext.cpp @@ -33,7 +33,7 @@ namespace QPA { SharingPlatformContext::SharingPlatformContext(QOpenGLContext *context, Integration *integration) - : AbstractPlatformContext(context, integration, waylandServer()->backend()->sceneEglDisplay()) + : AbstractPlatformContext(context, integration, kwinApp()->platform()->sceneEglDisplay()) { create(); } @@ -85,7 +85,7 @@ void SharingPlatformContext::create() if (!bindApi()) { return; } - createContext(waylandServer()->backend()->sceneEglContext()); + createContext(kwinApp()->platform()->sceneEglContext()); } } diff --git a/pointer_input.cpp b/pointer_input.cpp index 5a91a7ce60..c9acb9ad9e 100644 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -122,7 +122,7 @@ void PointerInputRedirection::init() Q_ASSERT(!m_inited); m_cursor = new CursorImage(this); m_inited = true; - connect(m_cursor, &CursorImage::changed, waylandServer()->backend(), &AbstractBackend::cursorChanged); + connect(m_cursor, &CursorImage::changed, kwinApp()->platform(), &AbstractBackend::cursorChanged); emit m_cursor->changed(); connect(workspace(), &Workspace::stackingOrderChanged, this, &PointerInputRedirection::update); connect(screens(), &Screens::changed, this, &PointerInputRedirection::updateAfterScreenChange); @@ -437,7 +437,7 @@ void PointerInputRedirection::updateButton(uint32_t button, InputRedirection::Po void PointerInputRedirection::warp(const QPointF &pos) { if (supportsWarping()) { - waylandServer()->backend()->warpPointer(pos); + kwinApp()->platform()->warpPointer(pos); processMotion(pos, waylandServer()->seat()->timestamp()); } } @@ -450,7 +450,7 @@ bool PointerInputRedirection::supportsWarping() const if (m_supportsWarping) { return true; } - if (waylandServer()->backend()->supportsPointerWarping()) { + if (kwinApp()->platform()->supportsPointerWarping()) { return true; } return false; diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 0ef83c3746..6472d12313 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -572,7 +572,7 @@ SceneOpenGL *SceneOpenGL::createScene(QObject *parent) break; case EglPlatformInterface: if (kwinApp()->shouldUseWaylandForCompositing()) { - backend = waylandServer()->backend()->createOpenGLBackend(); + backend = kwinApp()->platform()->createOpenGLBackend(); } else { backend = new EglOnXBackend(); } diff --git a/scene_qpainter.cpp b/scene_qpainter.cpp index b8fed3abd3..9bcf673be3 100644 --- a/scene_qpainter.cpp +++ b/scene_qpainter.cpp @@ -96,7 +96,7 @@ SceneQPainter *SceneQPainter::createScene(QObject *parent) { QScopedPointer backend; if (kwinApp()->shouldUseWaylandForCompositing()) { - backend.reset(waylandServer()->backend()->createQPainterBackend()); + backend.reset(kwinApp()->platform()->createQPainterBackend()); if (backend.isNull()) { return nullptr; } diff --git a/screens.cpp b/screens.cpp index 72e32ed2fe..b4d6a46bf5 100644 --- a/screens.cpp +++ b/screens.cpp @@ -43,7 +43,7 @@ Screens *Screens::create(QObject *parent) s_self = new MockScreens(parent); #else if (kwinApp()->shouldUseWaylandForCompositing()) { - s_self = waylandServer()->backend()->createScreens(parent); + s_self = kwinApp()->platform()->createScreens(parent); } if (kwinApp()->operationMode() == Application::OperationModeX11) { s_self = new XRandRScreens(parent);