Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/decoration_input_test.cpp
Show First 20 Lines • Show All 195 Lines • ▼ Show 20 Line(s) | 193 | { | |||
---|---|---|---|---|---|
196 | QVERIFY(c); | 196 | QVERIFY(c); | ||
197 | QVERIFY(c->isDecorated()); | 197 | QVERIFY(c->isDecorated()); | ||
198 | QVERIFY(!c->noBorder()); | 198 | QVERIFY(!c->noBorder()); | ||
199 | QCOMPARE(c->titlebarPosition(), AbstractClient::PositionTop); | 199 | QCOMPARE(c->titlebarPosition(), AbstractClient::PositionTop); | ||
200 | QVERIFY(!c->keepAbove()); | 200 | QVERIFY(!c->keepAbove()); | ||
201 | QVERIFY(!c->keepBelow()); | 201 | QVERIFY(!c->keepBelow()); | ||
202 | 202 | | |||
203 | quint32 timestamp = 1; | 203 | quint32 timestamp = 1; | ||
204 | MOTION(QPoint(c->geometry().center().x(), c->clientPos().y() / 2)); | 204 | MOTION(QPoint(c->frameGeometry().center().x(), c->clientPos().y() / 2)); | ||
205 | QVERIFY(!input()->pointer()->decoration().isNull()); | 205 | QVERIFY(!input()->pointer()->decoration().isNull()); | ||
206 | QCOMPARE(input()->pointer()->decoration()->decoration()->sectionUnderMouse(), Qt::TitleBarArea); | 206 | QCOMPARE(input()->pointer()->decoration()->decoration()->sectionUnderMouse(), Qt::TitleBarArea); | ||
207 | 207 | | |||
208 | // TODO: mouse wheel direction looks wrong to me | 208 | // TODO: mouse wheel direction looks wrong to me | ||
209 | // simulate wheel | 209 | // simulate wheel | ||
210 | kwinApp()->platform()->pointerAxisVertical(5.0, timestamp++); | 210 | kwinApp()->platform()->pointerAxisVertical(5.0, timestamp++); | ||
211 | QVERIFY(c->keepBelow()); | 211 | QVERIFY(c->keepBelow()); | ||
212 | QVERIFY(!c->keepAbove()); | 212 | QVERIFY(!c->keepAbove()); | ||
Show All 34 Lines | |||||
247 | { | 247 | { | ||
248 | QFETCH(Test::XdgShellSurfaceType, type); | 248 | QFETCH(Test::XdgShellSurfaceType, type); | ||
249 | AbstractClient *c = showWindow(type); | 249 | AbstractClient *c = showWindow(type); | ||
250 | QVERIFY(c); | 250 | QVERIFY(c); | ||
251 | QVERIFY(c->isDecorated()); | 251 | QVERIFY(c->isDecorated()); | ||
252 | QVERIFY(!c->noBorder()); | 252 | QVERIFY(!c->noBorder()); | ||
253 | QVERIFY(!c->isOnAllDesktops()); | 253 | QVERIFY(!c->isOnAllDesktops()); | ||
254 | quint32 timestamp = 1; | 254 | quint32 timestamp = 1; | ||
255 | MOTION(QPoint(c->geometry().center().x(), c->clientPos().y() / 2)); | 255 | MOTION(QPoint(c->frameGeometry().center().x(), c->clientPos().y() / 2)); | ||
256 | 256 | | |||
257 | // double click | 257 | // double click | ||
258 | PRESS; | 258 | PRESS; | ||
259 | RELEASE; | 259 | RELEASE; | ||
260 | PRESS; | 260 | PRESS; | ||
261 | RELEASE; | 261 | RELEASE; | ||
262 | QVERIFY(c->isOnAllDesktops()); | 262 | QVERIFY(c->isOnAllDesktops()); | ||
263 | // double click again | 263 | // double click again | ||
Show All 38 Lines | |||||
302 | { | 302 | { | ||
303 | QFETCH(Test::XdgShellSurfaceType, type); | 303 | QFETCH(Test::XdgShellSurfaceType, type); | ||
304 | AbstractClient *c = showWindow(type); | 304 | AbstractClient *c = showWindow(type); | ||
305 | QVERIFY(c); | 305 | QVERIFY(c); | ||
306 | QVERIFY(c->isDecorated()); | 306 | QVERIFY(c->isDecorated()); | ||
307 | QVERIFY(!c->noBorder()); | 307 | QVERIFY(!c->noBorder()); | ||
308 | QVERIFY(!c->isOnAllDesktops()); | 308 | QVERIFY(!c->isOnAllDesktops()); | ||
309 | quint32 timestamp = 1; | 309 | quint32 timestamp = 1; | ||
310 | const QPoint tapPoint(c->geometry().center().x(), c->clientPos().y() / 2); | 310 | const QPoint tapPoint(c->frameGeometry().center().x(), c->clientPos().y() / 2); | ||
311 | 311 | | |||
312 | // double tap | 312 | // double tap | ||
313 | kwinApp()->platform()->touchDown(0, tapPoint, timestamp++); | 313 | kwinApp()->platform()->touchDown(0, tapPoint, timestamp++); | ||
314 | kwinApp()->platform()->touchUp(0, timestamp++); | 314 | kwinApp()->platform()->touchUp(0, timestamp++); | ||
315 | kwinApp()->platform()->touchDown(0, tapPoint, timestamp++); | 315 | kwinApp()->platform()->touchDown(0, tapPoint, timestamp++); | ||
316 | kwinApp()->platform()->touchUp(0, timestamp++); | 316 | kwinApp()->platform()->touchUp(0, timestamp++); | ||
317 | QVERIFY(c->isOnAllDesktops()); | 317 | QVERIFY(c->isOnAllDesktops()); | ||
318 | // double tap again | 318 | // double tap again | ||
Show All 37 Lines | 353 | { | |||
356 | QVERIFY(c); | 356 | QVERIFY(c); | ||
357 | QVERIFY(c->isDecorated()); | 357 | QVERIFY(c->isDecorated()); | ||
358 | QVERIFY(!c->noBorder()); | 358 | QVERIFY(!c->noBorder()); | ||
359 | 359 | | |||
360 | // our left border is moved out of the visible area, so move the window to a better place | 360 | // our left border is moved out of the visible area, so move the window to a better place | ||
361 | c->move(QPoint(20, 0)); | 361 | c->move(QPoint(20, 0)); | ||
362 | 362 | | |||
363 | quint32 timestamp = 1; | 363 | quint32 timestamp = 1; | ||
364 | MOTION(QPoint(c->geometry().center().x(), c->clientPos().y() / 2)); | 364 | MOTION(QPoint(c->frameGeometry().center().x(), c->clientPos().y() / 2)); | ||
365 | QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); | 365 | QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); | ||
366 | 366 | | |||
367 | // There is a mismatch of the cursor key positions between windows | 367 | // There is a mismatch of the cursor key positions between windows | ||
368 | // with and without borders (with borders one can move inside a bit and still | 368 | // with and without borders (with borders one can move inside a bit and still | ||
369 | // be on an edge, without not). We should make this consistent in KWin's core. | 369 | // be on an edge, without not). We should make this consistent in KWin's core. | ||
370 | // | 370 | // | ||
371 | // TODO: Test input position with different border sizes. | 371 | // TODO: Test input position with different border sizes. | ||
372 | // TODO: We should test with the fake decoration to have a fixed test environment. | 372 | // TODO: We should test with the fake decoration to have a fixed test environment. | ||
373 | const bool hasBorders = Decoration::DecorationBridge::self()->settings()->borderSize() != KDecoration2::BorderSize::None; | 373 | const bool hasBorders = Decoration::DecorationBridge::self()->settings()->borderSize() != KDecoration2::BorderSize::None; | ||
374 | auto deviation = [hasBorders] { | 374 | auto deviation = [hasBorders] { | ||
375 | return hasBorders ? -1 : 0; | 375 | return hasBorders ? -1 : 0; | ||
376 | }; | 376 | }; | ||
377 | 377 | | |||
378 | MOTION(QPoint(c->geometry().x(), 0)); | 378 | MOTION(QPoint(c->frameGeometry().x(), 0)); | ||
379 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorthWest)); | 379 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorthWest)); | ||
380 | MOTION(QPoint(c->geometry().x() + c->geometry().width() / 2, 0)); | 380 | MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() / 2, 0)); | ||
381 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorth)); | 381 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorth)); | ||
382 | MOTION(QPoint(c->geometry().x() + c->geometry().width() - 1, 0)); | 382 | MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() - 1, 0)); | ||
383 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorthEast)); | 383 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorthEast)); | ||
384 | MOTION(QPoint(c->geometry().x() + c->geometry().width() + deviation(), c->height() / 2)); | 384 | MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() + deviation(), c->height() / 2)); | ||
385 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeEast)); | 385 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeEast)); | ||
386 | MOTION(QPoint(c->geometry().x() + c->geometry().width() + deviation(), c->height() - 1)); | 386 | MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() + deviation(), c->height() - 1)); | ||
387 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouthEast)); | 387 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouthEast)); | ||
388 | MOTION(QPoint(c->geometry().x() + c->geometry().width() / 2, c->height() + deviation())); | 388 | MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() / 2, c->height() + deviation())); | ||
389 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouth)); | 389 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouth)); | ||
390 | MOTION(QPoint(c->geometry().x(), c->height() + deviation())); | 390 | MOTION(QPoint(c->frameGeometry().x(), c->height() + deviation())); | ||
391 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouthWest)); | 391 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouthWest)); | ||
392 | MOTION(QPoint(c->geometry().x() - 1, c->height() / 2)); | 392 | MOTION(QPoint(c->frameGeometry().x() - 1, c->height() / 2)); | ||
393 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeWest)); | 393 | QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeWest)); | ||
394 | 394 | | |||
395 | MOTION(c->geometry().center()); | 395 | MOTION(c->frameGeometry().center()); | ||
396 | QEXPECT_FAIL("", "Cursor not set back on leave", Continue); | 396 | QEXPECT_FAIL("", "Cursor not set back on leave", Continue); | ||
397 | QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); | 397 | QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); | ||
398 | } | 398 | } | ||
399 | 399 | | |||
400 | void DecorationInputTest::testPressToMove_data() | 400 | void DecorationInputTest::testPressToMove_data() | ||
401 | { | 401 | { | ||
402 | QTest::addColumn<QPoint>("offset"); | 402 | QTest::addColumn<QPoint>("offset"); | ||
403 | QTest::addColumn<QPoint>("offset2"); | 403 | QTest::addColumn<QPoint>("offset2"); | ||
Show All 19 Lines | 418 | { | |||
423 | QVERIFY(!c->noBorder()); | 423 | QVERIFY(!c->noBorder()); | ||
424 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | 424 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | ||
425 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | 425 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | ||
426 | QVERIFY(startMoveResizedSpy.isValid()); | 426 | QVERIFY(startMoveResizedSpy.isValid()); | ||
427 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | 427 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | ||
428 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 428 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
429 | 429 | | |||
430 | quint32 timestamp = 1; | 430 | quint32 timestamp = 1; | ||
431 | MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2)); | 431 | MOTION(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2)); | ||
432 | QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); | 432 | QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); | ||
433 | 433 | | |||
434 | PRESS; | 434 | PRESS; | ||
435 | QVERIFY(!c->isMove()); | 435 | QVERIFY(!c->isMove()); | ||
436 | QFETCH(QPoint, offset); | 436 | QFETCH(QPoint, offset); | ||
437 | MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset); | 437 | MOTION(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2) + offset); | ||
438 | const QPoint oldPos = c->pos(); | 438 | const QPoint oldPos = c->pos(); | ||
439 | QVERIFY(c->isMove()); | 439 | QVERIFY(c->isMove()); | ||
440 | QCOMPARE(startMoveResizedSpy.count(), 1); | 440 | QCOMPARE(startMoveResizedSpy.count(), 1); | ||
441 | 441 | | |||
442 | RELEASE; | 442 | RELEASE; | ||
443 | QTRY_VERIFY(!c->isMove()); | 443 | QTRY_VERIFY(!c->isMove()); | ||
444 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | 444 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | ||
445 | QEXPECT_FAIL("", "Just trigger move doesn't move the window", Continue); | 445 | QEXPECT_FAIL("", "Just trigger move doesn't move the window", Continue); | ||
446 | QCOMPARE(c->pos(), oldPos + offset); | 446 | QCOMPARE(c->pos(), oldPos + offset); | ||
447 | 447 | | |||
448 | // again | 448 | // again | ||
449 | PRESS; | 449 | PRESS; | ||
450 | QVERIFY(!c->isMove()); | 450 | QVERIFY(!c->isMove()); | ||
451 | QFETCH(QPoint, offset2); | 451 | QFETCH(QPoint, offset2); | ||
452 | MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset2); | 452 | MOTION(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2) + offset2); | ||
453 | QVERIFY(c->isMove()); | 453 | QVERIFY(c->isMove()); | ||
454 | QCOMPARE(startMoveResizedSpy.count(), 2); | 454 | QCOMPARE(startMoveResizedSpy.count(), 2); | ||
455 | QFETCH(QPoint, offset3); | 455 | QFETCH(QPoint, offset3); | ||
456 | MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset3); | 456 | MOTION(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2) + offset3); | ||
457 | 457 | | |||
458 | RELEASE; | 458 | RELEASE; | ||
459 | QTRY_VERIFY(!c->isMove()); | 459 | QTRY_VERIFY(!c->isMove()); | ||
460 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 2); | 460 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 2); | ||
461 | // TODO: the offset should also be included | 461 | // TODO: the offset should also be included | ||
462 | QCOMPARE(c->pos(), oldPos + offset2 + offset3); | 462 | QCOMPARE(c->pos(), oldPos + offset2 + offset3); | ||
463 | } | 463 | } | ||
464 | 464 | | |||
Show All 23 Lines | 483 | { | |||
488 | QVERIFY(!c->noBorder()); | 488 | QVERIFY(!c->noBorder()); | ||
489 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | 489 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | ||
490 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | 490 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | ||
491 | QVERIFY(startMoveResizedSpy.isValid()); | 491 | QVERIFY(startMoveResizedSpy.isValid()); | ||
492 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | 492 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | ||
493 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 493 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
494 | 494 | | |||
495 | quint32 timestamp = 1; | 495 | quint32 timestamp = 1; | ||
496 | QPoint p = QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2); | 496 | QPoint p = QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2); | ||
497 | 497 | | |||
498 | kwinApp()->platform()->touchDown(0, p, timestamp++); | 498 | kwinApp()->platform()->touchDown(0, p, timestamp++); | ||
499 | QVERIFY(!c->isMove()); | 499 | QVERIFY(!c->isMove()); | ||
500 | QFETCH(QPoint, offset); | 500 | QFETCH(QPoint, offset); | ||
501 | QCOMPARE(input()->touch()->decorationPressId(), 0); | 501 | QCOMPARE(input()->touch()->decorationPressId(), 0); | ||
502 | kwinApp()->platform()->touchMotion(0, p + offset, timestamp++); | 502 | kwinApp()->platform()->touchMotion(0, p + offset, timestamp++); | ||
503 | const QPoint oldPos = c->pos(); | 503 | const QPoint oldPos = c->pos(); | ||
504 | QVERIFY(c->isMove()); | 504 | QVERIFY(c->isMove()); | ||
505 | QCOMPARE(startMoveResizedSpy.count(), 1); | 505 | QCOMPARE(startMoveResizedSpy.count(), 1); | ||
506 | 506 | | |||
507 | kwinApp()->platform()->touchUp(0, timestamp++); | 507 | kwinApp()->platform()->touchUp(0, timestamp++); | ||
508 | QTRY_VERIFY(!c->isMove()); | 508 | QTRY_VERIFY(!c->isMove()); | ||
509 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | 509 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | ||
510 | QEXPECT_FAIL("", "Just trigger move doesn't move the window", Continue); | 510 | QEXPECT_FAIL("", "Just trigger move doesn't move the window", Continue); | ||
511 | QCOMPARE(c->pos(), oldPos + offset); | 511 | QCOMPARE(c->pos(), oldPos + offset); | ||
512 | 512 | | |||
513 | // again | 513 | // again | ||
514 | kwinApp()->platform()->touchDown(1, p + offset, timestamp++); | 514 | kwinApp()->platform()->touchDown(1, p + offset, timestamp++); | ||
515 | QCOMPARE(input()->touch()->decorationPressId(), 1); | 515 | QCOMPARE(input()->touch()->decorationPressId(), 1); | ||
516 | QVERIFY(!c->isMove()); | 516 | QVERIFY(!c->isMove()); | ||
517 | QFETCH(QPoint, offset2); | 517 | QFETCH(QPoint, offset2); | ||
518 | kwinApp()->platform()->touchMotion(1, QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset2, timestamp++); | 518 | kwinApp()->platform()->touchMotion(1, QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2) + offset2, timestamp++); | ||
519 | QVERIFY(c->isMove()); | 519 | QVERIFY(c->isMove()); | ||
520 | QCOMPARE(startMoveResizedSpy.count(), 2); | 520 | QCOMPARE(startMoveResizedSpy.count(), 2); | ||
521 | QFETCH(QPoint, offset3); | 521 | QFETCH(QPoint, offset3); | ||
522 | kwinApp()->platform()->touchMotion(1, QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset3, timestamp++); | 522 | kwinApp()->platform()->touchMotion(1, QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2) + offset3, timestamp++); | ||
523 | 523 | | |||
524 | kwinApp()->platform()->touchUp(1, timestamp++); | 524 | kwinApp()->platform()->touchUp(1, timestamp++); | ||
525 | QTRY_VERIFY(!c->isMove()); | 525 | QTRY_VERIFY(!c->isMove()); | ||
526 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 2); | 526 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 2); | ||
527 | // TODO: the offset should also be included | 527 | // TODO: the offset should also be included | ||
528 | QCOMPARE(c->pos(), oldPos + offset2 + offset3); | 528 | QCOMPARE(c->pos(), oldPos + offset2 + offset3); | ||
529 | } | 529 | } | ||
530 | 530 | | |||
Show All 22 Lines | 546 | { | |||
553 | 553 | | |||
554 | // now create window | 554 | // now create window | ||
555 | QFETCH(Test::XdgShellSurfaceType, type); | 555 | QFETCH(Test::XdgShellSurfaceType, type); | ||
556 | AbstractClient *c = showWindow(type); | 556 | AbstractClient *c = showWindow(type); | ||
557 | QVERIFY(c); | 557 | QVERIFY(c); | ||
558 | QVERIFY(c->isDecorated()); | 558 | QVERIFY(c->isDecorated()); | ||
559 | QVERIFY(!c->noBorder()); | 559 | QVERIFY(!c->noBorder()); | ||
560 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | 560 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | ||
561 | QVERIFY(c->geometry() != c->inputGeometry()); | 561 | QVERIFY(c->frameGeometry() != c->inputGeometry()); | ||
562 | QVERIFY(c->inputGeometry().contains(c->geometry())); | 562 | QVERIFY(c->inputGeometry().contains(c->frameGeometry())); | ||
563 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | 563 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | ||
564 | QVERIFY(startMoveResizedSpy.isValid()); | 564 | QVERIFY(startMoveResizedSpy.isValid()); | ||
565 | 565 | | |||
566 | // go to border | 566 | // go to border | ||
567 | quint32 timestamp = 1; | 567 | quint32 timestamp = 1; | ||
568 | QFETCH(Qt::Edge, edge); | 568 | QFETCH(Qt::Edge, edge); | ||
569 | switch (edge) { | 569 | switch (edge) { | ||
570 | case Qt::LeftEdge: | 570 | case Qt::LeftEdge: | ||
571 | MOTION(QPoint(c->geometry().x() -1, c->geometry().center().y())); | 571 | MOTION(QPoint(c->frameGeometry().x() -1, c->frameGeometry().center().y())); | ||
572 | break; | 572 | break; | ||
573 | case Qt::RightEdge: | 573 | case Qt::RightEdge: | ||
574 | MOTION(QPoint(c->geometry().x() + c->geometry().width() +1, c->geometry().center().y())); | 574 | MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() +1, c->frameGeometry().center().y())); | ||
575 | break; | 575 | break; | ||
576 | case Qt::BottomEdge: | 576 | case Qt::BottomEdge: | ||
577 | MOTION(QPoint(c->geometry().center().x(), c->geometry().y() + c->geometry().height() + 1)); | 577 | MOTION(QPoint(c->frameGeometry().center().x(), c->frameGeometry().y() + c->frameGeometry().height() + 1)); | ||
578 | break; | 578 | break; | ||
579 | default: | 579 | default: | ||
580 | break; | 580 | break; | ||
581 | } | 581 | } | ||
582 | QVERIFY(!c->geometry().contains(KWin::Cursor::pos())); | 582 | QVERIFY(!c->frameGeometry().contains(KWin::Cursor::pos())); | ||
583 | 583 | | |||
584 | // pressing should trigger resize | 584 | // pressing should trigger resize | ||
585 | PRESS; | 585 | PRESS; | ||
586 | QVERIFY(!c->isResize()); | 586 | QVERIFY(!c->isResize()); | ||
587 | QVERIFY(startMoveResizedSpy.wait()); | 587 | QVERIFY(startMoveResizedSpy.wait()); | ||
588 | QVERIFY(c->isResize()); | 588 | QVERIFY(c->isResize()); | ||
589 | 589 | | |||
590 | RELEASE; | 590 | RELEASE; | ||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 643 | { | |||
660 | // create a window | 660 | // create a window | ||
661 | QFETCH(Test::XdgShellSurfaceType, surfaceType); | 661 | QFETCH(Test::XdgShellSurfaceType, surfaceType); | ||
662 | AbstractClient *c = showWindow(surfaceType); | 662 | AbstractClient *c = showWindow(surfaceType); | ||
663 | QVERIFY(c); | 663 | QVERIFY(c); | ||
664 | QVERIFY(c->isDecorated()); | 664 | QVERIFY(c->isDecorated()); | ||
665 | QVERIFY(!c->noBorder()); | 665 | QVERIFY(!c->noBorder()); | ||
666 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | 666 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | ||
667 | // move cursor on window | 667 | // move cursor on window | ||
668 | Cursor::setPos(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2)); | 668 | Cursor::setPos(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2)); | ||
669 | 669 | | |||
670 | // simulate modifier+click | 670 | // simulate modifier+click | ||
671 | quint32 timestamp = 1; | 671 | quint32 timestamp = 1; | ||
672 | QFETCH(bool, capsLock); | 672 | QFETCH(bool, capsLock); | ||
673 | if (capsLock) { | 673 | if (capsLock) { | ||
674 | kwinApp()->platform()->keyboardKeyPressed(KEY_CAPSLOCK, timestamp++); | 674 | kwinApp()->platform()->keyboardKeyPressed(KEY_CAPSLOCK, timestamp++); | ||
675 | } | 675 | } | ||
676 | QFETCH(int, modifierKey); | 676 | QFETCH(int, modifierKey); | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 721 | { | |||
731 | 731 | | |||
732 | QFETCH(Test::XdgShellSurfaceType, surfaceType); | 732 | QFETCH(Test::XdgShellSurfaceType, surfaceType); | ||
733 | AbstractClient *c = showWindow(surfaceType); | 733 | AbstractClient *c = showWindow(surfaceType); | ||
734 | QVERIFY(c); | 734 | QVERIFY(c); | ||
735 | QVERIFY(c->isDecorated()); | 735 | QVERIFY(c->isDecorated()); | ||
736 | QVERIFY(!c->noBorder()); | 736 | QVERIFY(!c->noBorder()); | ||
737 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | 737 | c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); | ||
738 | // move cursor on window | 738 | // move cursor on window | ||
739 | Cursor::setPos(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2)); | 739 | Cursor::setPos(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2)); | ||
740 | // set the opacity to 0.5 | 740 | // set the opacity to 0.5 | ||
741 | c->setOpacity(0.5); | 741 | c->setOpacity(0.5); | ||
742 | QCOMPARE(c->opacity(), 0.5); | 742 | QCOMPARE(c->opacity(), 0.5); | ||
743 | 743 | | |||
744 | // simulate modifier+wheel | 744 | // simulate modifier+wheel | ||
745 | quint32 timestamp = 1; | 745 | quint32 timestamp = 1; | ||
746 | QFETCH(bool, capsLock); | 746 | QFETCH(bool, capsLock); | ||
747 | if (capsLock) { | 747 | if (capsLock) { | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 794 | { | |||
803 | EventHelper helper; | 803 | EventHelper helper; | ||
804 | c->decoration()->installEventFilter(&helper); | 804 | c->decoration()->installEventFilter(&helper); | ||
805 | QSignalSpy hoverMoveSpy(&helper, &EventHelper::hoverMove); | 805 | QSignalSpy hoverMoveSpy(&helper, &EventHelper::hoverMove); | ||
806 | QVERIFY(hoverMoveSpy.isValid()); | 806 | QVERIFY(hoverMoveSpy.isValid()); | ||
807 | QSignalSpy hoverLeaveSpy(&helper, &EventHelper::hoverLeave); | 807 | QSignalSpy hoverLeaveSpy(&helper, &EventHelper::hoverLeave); | ||
808 | QVERIFY(hoverLeaveSpy.isValid()); | 808 | QVERIFY(hoverLeaveSpy.isValid()); | ||
809 | 809 | | |||
810 | quint32 timestamp = 1; | 810 | quint32 timestamp = 1; | ||
811 | const QPoint tapPoint(c->geometry().center().x(), c->clientPos().y() / 2); | 811 | const QPoint tapPoint(c->frameGeometry().center().x(), c->clientPos().y() / 2); | ||
812 | 812 | | |||
813 | QVERIFY(!input()->touch()->decoration()); | 813 | QVERIFY(!input()->touch()->decoration()); | ||
814 | kwinApp()->platform()->touchDown(0, tapPoint, timestamp++); | 814 | kwinApp()->platform()->touchDown(0, tapPoint, timestamp++); | ||
815 | QVERIFY(input()->touch()->decoration()); | 815 | QVERIFY(input()->touch()->decoration()); | ||
816 | QCOMPARE(input()->touch()->decoration()->decoration(), c->decoration()); | 816 | QCOMPARE(input()->touch()->decoration()->decoration(), c->decoration()); | ||
817 | QCOMPARE(hoverMoveSpy.count(), 1); | 817 | QCOMPARE(hoverMoveSpy.count(), 1); | ||
818 | QCOMPARE(hoverLeaveSpy.count(), 0); | 818 | QCOMPARE(hoverLeaveSpy.count(), 0); | ||
819 | kwinApp()->platform()->touchUp(0, timestamp++); | 819 | kwinApp()->platform()->touchUp(0, timestamp++); | ||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |