Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/struts_test.cpp
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | |||||
69 | void StrutsTest::initTestCase() | 69 | void StrutsTest::initTestCase() | ||
70 | { | 70 | { | ||
71 | qRegisterMetaType<KWin::ShellClient*>(); | 71 | qRegisterMetaType<KWin::ShellClient*>(); | ||
72 | qRegisterMetaType<KWin::AbstractClient*>(); | 72 | qRegisterMetaType<KWin::AbstractClient*>(); | ||
73 | qRegisterMetaType<KWin::Deleted*>(); | 73 | qRegisterMetaType<KWin::Deleted*>(); | ||
74 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 74 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
75 | QVERIFY(workspaceCreatedSpy.isValid()); | 75 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
76 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 76 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
77 | QMetaObject::invokeMethod(kwinApp()->platform(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2)); | 77 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | ||
78 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 78 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
79 | 79 | | |||
80 | // set custom config which disables the Outline | 80 | // set custom config which disables the Outline | ||
81 | KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 81 | KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
82 | KConfigGroup group = config->group("Outline"); | 82 | KConfigGroup group = config->group("Outline"); | ||
83 | group.writeEntry(QStringLiteral("QmlPath"), QString("/does/not/exist.qml")); | 83 | group.writeEntry(QStringLiteral("QmlPath"), QString("/does/not/exist.qml")); | ||
84 | group.sync(); | 84 | group.sync(); | ||
85 | 85 | | |||
▲ Show 20 Lines • Show All 569 Lines • ▼ Show 20 Line(s) | 522 | { | |||
655 | QCOMPARE(workspace()->restrictedMoveArea(-1), QRegion()); | 655 | QCOMPARE(workspace()->restrictedMoveArea(-1), QRegion()); | ||
656 | } | 656 | } | ||
657 | 657 | | |||
658 | void StrutsTest::test363804() | 658 | void StrutsTest::test363804() | ||
659 | { | 659 | { | ||
660 | // this test verifies the condition described in BUG 363804 | 660 | // this test verifies the condition described in BUG 363804 | ||
661 | // two screens in a vertical setup, aligned to right border with panel on the bottom screen | 661 | // two screens in a vertical setup, aligned to right border with panel on the bottom screen | ||
662 | const QVector<QRect> geometries{QRect(0, 0, 1920, 1080), QRect(554, 1080, 1366, 768)}; | 662 | const QVector<QRect> geometries{QRect(0, 0, 1920, 1080), QRect(554, 1080, 1366, 768)}; | ||
663 | QMetaObject::invokeMethod(kwinApp()->platform(), "outputGeometriesChanged", | 663 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | ||
664 | Qt::DirectConnection, | 664 | Qt::DirectConnection, | ||
665 | Q_ARG(int, 2), | ||||
665 | Q_ARG(QVector<QRect>, geometries)); | 666 | Q_ARG(QVector<QRect>, geometries)); | ||
666 | QCOMPARE(screens()->geometry(0), geometries.at(0)); | 667 | QCOMPARE(screens()->geometry(0), geometries.at(0)); | ||
667 | QCOMPARE(screens()->geometry(1), geometries.at(1)); | 668 | QCOMPARE(screens()->geometry(1), geometries.at(1)); | ||
668 | QCOMPARE(screens()->geometry(), QRect(0, 0, 1920, 1848)); | 669 | QCOMPARE(screens()->geometry(), QRect(0, 0, 1920, 1848)); | ||
669 | 670 | | |||
670 | // create an xcb window | 671 | // create an xcb window | ||
671 | QScopedPointer<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr)); | 672 | QScopedPointer<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr)); | ||
672 | QVERIFY(!xcb_connection_has_error(c.data())); | 673 | QVERIFY(!xcb_connection_has_error(c.data())); | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | |||||
734 | 735 | | |||
735 | void StrutsTest::testLeftScreenSmallerBottomAligned() | 736 | void StrutsTest::testLeftScreenSmallerBottomAligned() | ||
736 | { | 737 | { | ||
737 | // this test verifies a two screen setup with the left screen smaller than the right and bottom aligned | 738 | // this test verifies a two screen setup with the left screen smaller than the right and bottom aligned | ||
738 | // the panel is on the top of the left screen, thus not at 0/0 | 739 | // the panel is on the top of the left screen, thus not at 0/0 | ||
739 | // what this test in addition tests is whether a window larger than the left screen is not placed into | 740 | // what this test in addition tests is whether a window larger than the left screen is not placed into | ||
740 | // the dead area | 741 | // the dead area | ||
741 | const QVector<QRect> geometries{QRect(0, 282, 1366, 768), QRect(1366, 0, 1680, 1050)}; | 742 | const QVector<QRect> geometries{QRect(0, 282, 1366, 768), QRect(1366, 0, 1680, 1050)}; | ||
742 | QMetaObject::invokeMethod(kwinApp()->platform(), "outputGeometriesChanged", | 743 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | ||
743 | Qt::DirectConnection, | 744 | Qt::DirectConnection, | ||
745 | Q_ARG(int, 2), | ||||
744 | Q_ARG(QVector<QRect>, geometries)); | 746 | Q_ARG(QVector<QRect>, geometries)); | ||
745 | QCOMPARE(screens()->geometry(0), geometries.at(0)); | 747 | QCOMPARE(screens()->geometry(0), geometries.at(0)); | ||
746 | QCOMPARE(screens()->geometry(1), geometries.at(1)); | 748 | QCOMPARE(screens()->geometry(1), geometries.at(1)); | ||
747 | QCOMPARE(screens()->geometry(), QRect(0, 0, 3046, 1050)); | 749 | QCOMPARE(screens()->geometry(), QRect(0, 0, 3046, 1050)); | ||
748 | 750 | | |||
749 | // create the panel | 751 | // create the panel | ||
750 | QScopedPointer<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr)); | 752 | QScopedPointer<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr)); | ||
751 | QVERIFY(!xcb_connection_has_error(c.data())); | 753 | QVERIFY(!xcb_connection_has_error(c.data())); | ||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Line(s) | |||||
845 | void StrutsTest::testWindowMoveWithPanelBetweenScreens() | 847 | void StrutsTest::testWindowMoveWithPanelBetweenScreens() | ||
846 | { | 848 | { | ||
847 | // this test verifies the condition of BUG | 849 | // this test verifies the condition of BUG | ||
848 | // when moving a window with decorations in a restricted way it should pass from one screen | 850 | // when moving a window with decorations in a restricted way it should pass from one screen | ||
849 | // to the other even if there is a panel in between. | 851 | // to the other even if there is a panel in between. | ||
850 | 852 | | |||
851 | // left screen must be smaller than right screen | 853 | // left screen must be smaller than right screen | ||
852 | const QVector<QRect> geometries{QRect(0, 282, 1366, 768), QRect(1366, 0, 1680, 1050)}; | 854 | const QVector<QRect> geometries{QRect(0, 282, 1366, 768), QRect(1366, 0, 1680, 1050)}; | ||
853 | QMetaObject::invokeMethod(kwinApp()->platform(), "outputGeometriesChanged", | 855 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | ||
854 | Qt::DirectConnection, | 856 | Qt::DirectConnection, | ||
857 | Q_ARG(int, 2), | ||||
855 | Q_ARG(QVector<QRect>, geometries)); | 858 | Q_ARG(QVector<QRect>, geometries)); | ||
856 | QCOMPARE(screens()->geometry(0), geometries.at(0)); | 859 | QCOMPARE(screens()->geometry(0), geometries.at(0)); | ||
857 | QCOMPARE(screens()->geometry(1), geometries.at(1)); | 860 | QCOMPARE(screens()->geometry(1), geometries.at(1)); | ||
858 | QCOMPARE(screens()->geometry(), QRect(0, 0, 3046, 1050)); | 861 | QCOMPARE(screens()->geometry(), QRect(0, 0, 3046, 1050)); | ||
859 | 862 | | |||
860 | // create the panel on the right screen, left edge | 863 | // create the panel on the right screen, left edge | ||
861 | QScopedPointer<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr)); | 864 | QScopedPointer<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr)); | ||
862 | QVERIFY(!xcb_connection_has_error(c.data())); | 865 | QVERIFY(!xcb_connection_has_error(c.data())); | ||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |