Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/activation_test.cpp
Show First 20 Lines • Show All 375 Lines • ▼ Show 20 Line(s) | 365 | { | |||
---|---|---|---|---|---|
376 | QScopedPointer<XdgShellSurface> shellSurface1(Test::createXdgShellStableSurface(surface1.data())); | 376 | QScopedPointer<XdgShellSurface> shellSurface1(Test::createXdgShellStableSurface(surface1.data())); | ||
377 | XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); | 377 | XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); | ||
378 | QVERIFY(client1); | 378 | QVERIFY(client1); | ||
379 | QVERIFY(client1->isActive()); | 379 | QVERIFY(client1->isActive()); | ||
380 | QSignalSpy configureRequestedSpy1(shellSurface1.data(), &XdgShellSurface::configureRequested); | 380 | QSignalSpy configureRequestedSpy1(shellSurface1.data(), &XdgShellSurface::configureRequested); | ||
381 | QVERIFY(configureRequestedSpy1.wait()); | 381 | QVERIFY(configureRequestedSpy1.wait()); | ||
382 | workspace()->slotWindowMaximize(); | 382 | workspace()->slotWindowMaximize(); | ||
383 | QVERIFY(configureRequestedSpy1.wait()); | 383 | QVERIFY(configureRequestedSpy1.wait()); | ||
384 | QSignalSpy geometryChangedSpy1(client1, &XdgShellClient::geometryChanged); | 384 | QSignalSpy frameGeometryChangedSpy1(client1, &XdgShellClient::frameGeometryChanged); | ||
385 | QVERIFY(geometryChangedSpy1.isValid()); | 385 | QVERIFY(frameGeometryChangedSpy1.isValid()); | ||
386 | shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value<quint32>()); | 386 | shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value<quint32>()); | ||
387 | Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red); | 387 | Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red); | ||
388 | QVERIFY(geometryChangedSpy1.wait()); | 388 | QVERIFY(frameGeometryChangedSpy1.wait()); | ||
389 | 389 | | |||
390 | QScopedPointer<Surface> surface2(Test::createSurface()); | 390 | QScopedPointer<Surface> surface2(Test::createSurface()); | ||
391 | QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data())); | 391 | QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data())); | ||
392 | XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); | 392 | XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); | ||
393 | QVERIFY(client2); | 393 | QVERIFY(client2); | ||
394 | QVERIFY(client2->isActive()); | 394 | QVERIFY(client2->isActive()); | ||
395 | QSignalSpy configureRequestedSpy2(shellSurface2.data(), &XdgShellSurface::configureRequested); | 395 | QSignalSpy configureRequestedSpy2(shellSurface2.data(), &XdgShellSurface::configureRequested); | ||
396 | QVERIFY(configureRequestedSpy2.wait()); | 396 | QVERIFY(configureRequestedSpy2.wait()); | ||
397 | workspace()->slotWindowMaximize(); | 397 | workspace()->slotWindowMaximize(); | ||
398 | QVERIFY(configureRequestedSpy2.wait()); | 398 | QVERIFY(configureRequestedSpy2.wait()); | ||
399 | QSignalSpy geometryChangedSpy2(client2, &XdgShellClient::geometryChanged); | 399 | QSignalSpy frameGeometryChangedSpy2(client2, &XdgShellClient::frameGeometryChanged); | ||
400 | QVERIFY(geometryChangedSpy2.isValid()); | 400 | QVERIFY(frameGeometryChangedSpy2.isValid()); | ||
401 | shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value<quint32>()); | 401 | shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value<quint32>()); | ||
402 | Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red); | 402 | Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red); | ||
403 | QVERIFY(geometryChangedSpy2.wait()); | 403 | QVERIFY(frameGeometryChangedSpy2.wait()); | ||
404 | 404 | | |||
405 | const QList<Toplevel *> stackingOrder = workspace()->stackingOrder(); | 405 | const QList<Toplevel *> stackingOrder = workspace()->stackingOrder(); | ||
406 | QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2)); | 406 | QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2)); | ||
407 | QCOMPARE(client1->maximizeMode(), MaximizeFull); | 407 | QCOMPARE(client1->maximizeMode(), MaximizeFull); | ||
408 | QCOMPARE(client2->maximizeMode(), MaximizeFull); | 408 | QCOMPARE(client2->maximizeMode(), MaximizeFull); | ||
409 | 409 | | |||
410 | // Create several clients on the right screen. | 410 | // Create several clients on the right screen. | ||
411 | QScopedPointer<Surface> surface3(Test::createSurface()); | 411 | QScopedPointer<Surface> surface3(Test::createSurface()); | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 450 | { | |||
461 | QScopedPointer<XdgShellSurface> shellSurface1(Test::createXdgShellStableSurface(surface1.data())); | 461 | QScopedPointer<XdgShellSurface> shellSurface1(Test::createXdgShellStableSurface(surface1.data())); | ||
462 | XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); | 462 | XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); | ||
463 | QVERIFY(client1); | 463 | QVERIFY(client1); | ||
464 | QVERIFY(client1->isActive()); | 464 | QVERIFY(client1->isActive()); | ||
465 | QSignalSpy configureRequestedSpy1(shellSurface1.data(), &XdgShellSurface::configureRequested); | 465 | QSignalSpy configureRequestedSpy1(shellSurface1.data(), &XdgShellSurface::configureRequested); | ||
466 | QVERIFY(configureRequestedSpy1.wait()); | 466 | QVERIFY(configureRequestedSpy1.wait()); | ||
467 | workspace()->slotWindowFullScreen(); | 467 | workspace()->slotWindowFullScreen(); | ||
468 | QVERIFY(configureRequestedSpy1.wait()); | 468 | QVERIFY(configureRequestedSpy1.wait()); | ||
469 | QSignalSpy geometryChangedSpy1(client1, &XdgShellClient::geometryChanged); | 469 | QSignalSpy frameGeometryChangedSpy1(client1, &XdgShellClient::frameGeometryChanged); | ||
470 | QVERIFY(geometryChangedSpy1.isValid()); | 470 | QVERIFY(frameGeometryChangedSpy1.isValid()); | ||
471 | shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value<quint32>()); | 471 | shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value<quint32>()); | ||
472 | Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red); | 472 | Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red); | ||
473 | QVERIFY(geometryChangedSpy1.wait()); | 473 | QVERIFY(frameGeometryChangedSpy1.wait()); | ||
474 | 474 | | |||
475 | QScopedPointer<Surface> surface2(Test::createSurface()); | 475 | QScopedPointer<Surface> surface2(Test::createSurface()); | ||
476 | QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data())); | 476 | QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data())); | ||
477 | XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); | 477 | XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); | ||
478 | QVERIFY(client2); | 478 | QVERIFY(client2); | ||
479 | QVERIFY(client2->isActive()); | 479 | QVERIFY(client2->isActive()); | ||
480 | QSignalSpy configureRequestedSpy2(shellSurface2.data(), &XdgShellSurface::configureRequested); | 480 | QSignalSpy configureRequestedSpy2(shellSurface2.data(), &XdgShellSurface::configureRequested); | ||
481 | QVERIFY(configureRequestedSpy2.wait()); | 481 | QVERIFY(configureRequestedSpy2.wait()); | ||
482 | workspace()->slotWindowFullScreen(); | 482 | workspace()->slotWindowFullScreen(); | ||
483 | QVERIFY(configureRequestedSpy2.wait()); | 483 | QVERIFY(configureRequestedSpy2.wait()); | ||
484 | QSignalSpy geometryChangedSpy2(client2, &XdgShellClient::geometryChanged); | 484 | QSignalSpy frameGeometryChangedSpy2(client2, &XdgShellClient::frameGeometryChanged); | ||
485 | QVERIFY(geometryChangedSpy2.isValid()); | 485 | QVERIFY(frameGeometryChangedSpy2.isValid()); | ||
486 | shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value<quint32>()); | 486 | shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value<quint32>()); | ||
487 | Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red); | 487 | Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red); | ||
488 | QVERIFY(geometryChangedSpy2.wait()); | 488 | QVERIFY(frameGeometryChangedSpy2.wait()); | ||
489 | 489 | | |||
490 | const QList<Toplevel *> stackingOrder = workspace()->stackingOrder(); | 490 | const QList<Toplevel *> stackingOrder = workspace()->stackingOrder(); | ||
491 | QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2)); | 491 | QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2)); | ||
492 | QVERIFY(client1->isFullScreen()); | 492 | QVERIFY(client1->isFullScreen()); | ||
493 | QVERIFY(client2->isFullScreen()); | 493 | QVERIFY(client2->isFullScreen()); | ||
494 | 494 | | |||
495 | // Create several clients on the bottom screen. | 495 | // Create several clients on the bottom screen. | ||
496 | QScopedPointer<Surface> surface3(Test::createSurface()); | 496 | QScopedPointer<Surface> surface3(Test::createSurface()); | ||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |