Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/pointer_input.cpp
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | |||||
87 | void PointerInputTest::initTestCase() | 87 | void PointerInputTest::initTestCase() | ||
88 | { | 88 | { | ||
89 | qRegisterMetaType<KWin::ShellClient*>(); | 89 | qRegisterMetaType<KWin::ShellClient*>(); | ||
90 | qRegisterMetaType<KWin::AbstractClient*>(); | 90 | qRegisterMetaType<KWin::AbstractClient*>(); | ||
91 | qRegisterMetaType<KWin::Deleted*>(); | 91 | qRegisterMetaType<KWin::Deleted*>(); | ||
92 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 92 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
93 | QVERIFY(workspaceCreatedSpy.isValid()); | 93 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
94 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 94 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
95 | QMetaObject::invokeMethod(kwinApp()->platform(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2)); | 95 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | ||
96 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 96 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
97 | 97 | | |||
98 | kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); | 98 | kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); | ||
99 | 99 | | |||
100 | if (!QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons/DMZ-White/index.theme")).isEmpty()) { | 100 | if (!QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons/DMZ-White/index.theme")).isEmpty()) { | ||
101 | qputenv("XCURSOR_THEME", QByteArrayLiteral("DMZ-White")); | 101 | qputenv("XCURSOR_THEME", QByteArrayLiteral("DMZ-White")); | ||
102 | } else { | 102 | } else { | ||
103 | // might be vanilla-dmz (e.g. Arch, FreeBSD) | 103 | // might be vanilla-dmz (e.g. Arch, FreeBSD) | ||
▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Line(s) | 271 | { | |||
293 | QVERIFY(clientAddedSpy.wait()); | 293 | QVERIFY(clientAddedSpy.wait()); | ||
294 | AbstractClient *window = workspace()->activeClient(); | 294 | AbstractClient *window = workspace()->activeClient(); | ||
295 | QVERIFY(window); | 295 | QVERIFY(window); | ||
296 | QVERIFY(!window->geometry().contains(Cursor::pos())); | 296 | QVERIFY(!window->geometry().contains(Cursor::pos())); | ||
297 | 297 | | |||
298 | QSignalSpy screensChangedSpy(screens(), &Screens::changed); | 298 | QSignalSpy screensChangedSpy(screens(), &Screens::changed); | ||
299 | QVERIFY(screensChangedSpy.isValid()); | 299 | QVERIFY(screensChangedSpy.isValid()); | ||
300 | // now let's remove the screen containing the cursor | 300 | // now let's remove the screen containing the cursor | ||
301 | QMetaObject::invokeMethod(kwinApp()->platform(), "outputGeometriesChanged", | 301 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | ||
302 | Qt::DirectConnection, | 302 | Qt::DirectConnection, | ||
303 | Q_ARG(int, 1), | ||||
303 | Q_ARG(QVector<QRect>, QVector<QRect>{QRect(0, 0, 1280, 1024)})); | 304 | Q_ARG(QVector<QRect>, QVector<QRect>{QRect(0, 0, 1280, 1024)})); | ||
304 | QVERIFY(screensChangedSpy.wait()); | 305 | QVERIFY(screensChangedSpy.wait()); | ||
305 | QCOMPARE(screens()->count(), 1); | 306 | QCOMPARE(screens()->count(), 1); | ||
306 | 307 | | |||
307 | // this should have warped the cursor | 308 | // this should have warped the cursor | ||
308 | QCOMPARE(Cursor::pos(), QPoint(639, 511)); | 309 | QCOMPARE(Cursor::pos(), QPoint(639, 511)); | ||
309 | QVERIFY(window->geometry().contains(Cursor::pos())); | 310 | QVERIFY(window->geometry().contains(Cursor::pos())); | ||
310 | 311 | | |||
▲ Show 20 Lines • Show All 885 Lines • Show Last 20 Lines |