Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/decoration_input_test.cpp
Show First 20 Lines • Show All 359 Lines • ▼ Show 20 Line(s) | 356 | { | |||
---|---|---|---|---|---|
360 | QVERIFY(c->isDecorated()); | 360 | QVERIFY(c->isDecorated()); | ||
361 | QVERIFY(!c->noBorder()); | 361 | QVERIFY(!c->noBorder()); | ||
362 | 362 | | |||
363 | // our left border is moved out of the visible area, so move the window to a better place | 363 | // our left border is moved out of the visible area, so move the window to a better place | ||
364 | c->move(QPoint(20, 0)); | 364 | c->move(QPoint(20, 0)); | ||
365 | 365 | | |||
366 | quint32 timestamp = 1; | 366 | quint32 timestamp = 1; | ||
367 | MOTION(QPoint(c->geometry().center().x(), c->clientPos().y() / 2)); | 367 | MOTION(QPoint(c->geometry().center().x(), c->clientPos().y() / 2)); | ||
368 | QCOMPARE(c->cursor(), Qt::ArrowCursor); | 368 | QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); | ||
369 | 369 | | |||
370 | MOTION(QPoint(20, 0)); | 370 | MOTION(QPoint(c->geometry().x(), 0)); | ||
371 | QCOMPARE(c->cursor(), Qt::SizeFDiagCursor); | 371 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorthWest)); | ||
372 | MOTION(QPoint(c->geometry().x() + c->geometry().width() / 2, 0)); | 372 | MOTION(QPoint(c->geometry().x() + c->geometry().width() / 2, 0)); | ||
373 | QCOMPARE(c->cursor(), Qt::SizeVerCursor); | 373 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorth)); | ||
374 | MOTION(QPoint(c->geometry().x() + c->geometry().width() - 1, 0)); | 374 | MOTION(QPoint(c->geometry().x() + c->geometry().width() - 1, 0)); | ||
375 | QCOMPARE(c->cursor(), Qt::SizeBDiagCursor); | 375 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorthEast)); | ||
376 | MOTION(QPoint(c->geometry().x() + c->geometry().width() - 1, c->height() / 2)); | 376 | MOTION(QPoint(c->geometry().x() + c->geometry().width() - 1, c->height() / 2)); | ||
377 | QCOMPARE(c->cursor(), Qt::SizeHorCursor); | 377 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeEast)); | ||
378 | MOTION(QPoint(c->geometry().x() + c->geometry().width() - 1, c->height() - 1)); | 378 | MOTION(QPoint(c->geometry().x() + c->geometry().width() - 1, c->height() - 1)); | ||
379 | QCOMPARE(c->cursor(), Qt::SizeFDiagCursor); | 379 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouthEast)); | ||
380 | MOTION(QPoint(c->geometry().x() + c->geometry().width() / 2, c->height() - 1)); | 380 | MOTION(QPoint(c->geometry().x() + c->geometry().width() / 2, c->height() - 1)); | ||
381 | QCOMPARE(c->cursor(), Qt::SizeVerCursor); | 381 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouth)); | ||
382 | MOTION(QPoint(c->geometry().x(), c->height() - 1)); | 382 | MOTION(QPoint(c->geometry().x(), c->height() - 1)); | ||
383 | QCOMPARE(c->cursor(), Qt::SizeBDiagCursor); | 383 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouthWest)); | ||
384 | MOTION(QPoint(c->geometry().x(), c->height() / 2)); | 384 | MOTION(QPoint(c->geometry().x(), c->height() / 2)); | ||
385 | QCOMPARE(c->cursor(), Qt::SizeHorCursor); | 385 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeWest)); | ||
386 | 386 | | |||
387 | MOTION(c->geometry().center()); | 387 | MOTION(c->geometry().center()); | ||
388 | QEXPECT_FAIL("", "Cursor not set back on leave", Continue); | 388 | QEXPECT_FAIL("", "Cursor not set back on leave", Continue); | ||
389 | QCOMPARE(c->cursor(), Qt::ArrowCursor); | 389 | QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); | ||
390 | } | 390 | } | ||
391 | 391 | | |||
392 | void DecorationInputTest::testPressToMove_data() | 392 | void DecorationInputTest::testPressToMove_data() | ||
393 | { | 393 | { | ||
394 | QTest::addColumn<QPoint>("offset"); | 394 | QTest::addColumn<QPoint>("offset"); | ||
395 | QTest::addColumn<QPoint>("offset2"); | 395 | QTest::addColumn<QPoint>("offset2"); | ||
396 | QTest::addColumn<QPoint>("offset3"); | 396 | QTest::addColumn<QPoint>("offset3"); | ||
397 | QTest::addColumn<Test::ShellSurfaceType>("type"); | 397 | QTest::addColumn<Test::ShellSurfaceType>("type"); | ||
Show All 22 Lines | 414 | { | |||
420 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | 420 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | ||
421 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | 421 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | ||
422 | QVERIFY(startMoveResizedSpy.isValid()); | 422 | QVERIFY(startMoveResizedSpy.isValid()); | ||
423 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | 423 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | ||
424 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 424 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
425 | 425 | | |||
426 | quint32 timestamp = 1; | 426 | quint32 timestamp = 1; | ||
427 | MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2)); | 427 | MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2)); | ||
428 | QCOMPARE(c->cursor(), Qt::ArrowCursor); | 428 | QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); | ||
429 | 429 | | |||
430 | PRESS; | 430 | PRESS; | ||
431 | QVERIFY(!c->isMove()); | 431 | QVERIFY(!c->isMove()); | ||
432 | QFETCH(QPoint, offset); | 432 | QFETCH(QPoint, offset); | ||
433 | MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset); | 433 | MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset); | ||
434 | const QPoint oldPos = c->pos(); | 434 | const QPoint oldPos = c->pos(); | ||
435 | QVERIFY(c->isMove()); | 435 | QVERIFY(c->isMove()); | ||
436 | QCOMPARE(startMoveResizedSpy.count(), 1); | 436 | QCOMPARE(startMoveResizedSpy.count(), 1); | ||
▲ Show 20 Lines • Show All 456 Lines • Show Last 20 Lines |