Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/shell_client_rules_test.cpp
Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Line(s) | 253 | { | |||
---|---|---|---|---|---|
260 | // Restore virtual desktops to the initial state. | 260 | // Restore virtual desktops to the initial state. | ||
261 | VirtualDesktopManager::self()->setCount(1); | 261 | VirtualDesktopManager::self()->setCount(1); | ||
262 | QCOMPARE(VirtualDesktopManager::self()->count(), 1u); | 262 | QCOMPARE(VirtualDesktopManager::self()->count(), 1u); | ||
263 | } | 263 | } | ||
264 | 264 | | |||
265 | #define TEST_DATA(name) \ | 265 | #define TEST_DATA(name) \ | ||
266 | void TestShellClientRules::name##_data() \ | 266 | void TestShellClientRules::name##_data() \ | ||
267 | { \ | 267 | { \ | ||
268 | QTest::addColumn<Test::ShellSurfaceType>("type"); \ | 268 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); \ | ||
269 | QTest::newRow("XdgShellV5") << Test::ShellSurfaceType::XdgShellV5; \ | 269 | QTest::newRow("XdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5; \ | ||
270 | QTest::newRow("XdgShellV6") << Test::ShellSurfaceType::XdgShellV6; \ | 270 | QTest::newRow("XdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6; \ | ||
271 | QTest::newRow("XdgWmBase") << Test::ShellSurfaceType::XdgShellStable; \ | 271 | QTest::newRow("XdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; \ | ||
272 | } | 272 | } | ||
273 | 273 | | |||
274 | std::tuple<ShellClient *, Surface *, XdgShellSurface *> createWindow(Test::ShellSurfaceType type, const QByteArray &appId) | 274 | std::tuple<ShellClient *, Surface *, XdgShellSurface *> createWindow(Test::XdgShellSurfaceType type, const QByteArray &appId) | ||
275 | { | 275 | { | ||
276 | // Create an xdg surface. | 276 | // Create an xdg surface. | ||
277 | Surface *surface = Test::createSurface(); | 277 | Surface *surface = Test::createSurface(); | ||
278 | XdgShellSurface *shellSurface = Test::createXdgShellSurface(type, surface, surface, Test::CreationSetup::CreateOnly); | 278 | XdgShellSurface *shellSurface = Test::createXdgShellSurface(type, surface, surface, Test::CreationSetup::CreateOnly); | ||
279 | 279 | | |||
280 | // Assign the desired app id. | 280 | // Assign the desired app id. | ||
281 | shellSurface->setAppId(appId); | 281 | shellSurface->setAppId(appId); | ||
282 | 282 | | |||
Show All 22 Lines | 298 | { | |||
305 | group.writeEntry("wmclass", "org.kde.foo"); | 305 | group.writeEntry("wmclass", "org.kde.foo"); | ||
306 | group.writeEntry("wmclasscomplete", false); | 306 | group.writeEntry("wmclasscomplete", false); | ||
307 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 307 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
308 | group.sync(); | 308 | group.sync(); | ||
309 | RuleBook::self()->setConfig(config); | 309 | RuleBook::self()->setConfig(config); | ||
310 | workspace()->slotReconfigure(); | 310 | workspace()->slotReconfigure(); | ||
311 | 311 | | |||
312 | // Create the test client. | 312 | // Create the test client. | ||
313 | QFETCH(Test::ShellSurfaceType, type); | 313 | QFETCH(Test::XdgShellSurfaceType, type); | ||
314 | ShellClient *client; | 314 | ShellClient *client; | ||
315 | Surface *surface; | 315 | Surface *surface; | ||
316 | XdgShellSurface *shellSurface; | 316 | XdgShellSurface *shellSurface; | ||
317 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 317 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
318 | QVERIFY(client); | 318 | QVERIFY(client); | ||
319 | QVERIFY(client->isActive()); | 319 | QVERIFY(client->isActive()); | ||
320 | 320 | | |||
321 | // The position of the client should not be affected by the rule. The default | 321 | // The position of the client should not be affected by the rule. The default | ||
Show All 21 Lines | 336 | { | |||
343 | group.writeEntry("wmclass", "org.kde.foo"); | 343 | group.writeEntry("wmclass", "org.kde.foo"); | ||
344 | group.writeEntry("wmclasscomplete", false); | 344 | group.writeEntry("wmclasscomplete", false); | ||
345 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 345 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
346 | group.sync(); | 346 | group.sync(); | ||
347 | RuleBook::self()->setConfig(config); | 347 | RuleBook::self()->setConfig(config); | ||
348 | workspace()->slotReconfigure(); | 348 | workspace()->slotReconfigure(); | ||
349 | 349 | | |||
350 | // Create the test client. | 350 | // Create the test client. | ||
351 | QFETCH(Test::ShellSurfaceType, type); | 351 | QFETCH(Test::XdgShellSurfaceType, type); | ||
352 | ShellClient *client; | 352 | ShellClient *client; | ||
353 | Surface *surface; | 353 | Surface *surface; | ||
354 | XdgShellSurface *shellSurface; | 354 | XdgShellSurface *shellSurface; | ||
355 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 355 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
356 | QVERIFY(client); | 356 | QVERIFY(client); | ||
357 | QVERIFY(client->isActive()); | 357 | QVERIFY(client->isActive()); | ||
358 | 358 | | |||
359 | // The client should be moved to the position specified by the rule. | 359 | // The client should be moved to the position specified by the rule. | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 415 | { | |||
422 | group.writeEntry("wmclass", "org.kde.foo"); | 422 | group.writeEntry("wmclass", "org.kde.foo"); | ||
423 | group.writeEntry("wmclasscomplete", false); | 423 | group.writeEntry("wmclasscomplete", false); | ||
424 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 424 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
425 | group.sync(); | 425 | group.sync(); | ||
426 | RuleBook::self()->setConfig(config); | 426 | RuleBook::self()->setConfig(config); | ||
427 | workspace()->slotReconfigure(); | 427 | workspace()->slotReconfigure(); | ||
428 | 428 | | |||
429 | // Create the test client. | 429 | // Create the test client. | ||
430 | QFETCH(Test::ShellSurfaceType, type); | 430 | QFETCH(Test::XdgShellSurfaceType, type); | ||
431 | ShellClient *client; | 431 | ShellClient *client; | ||
432 | Surface *surface; | 432 | Surface *surface; | ||
433 | XdgShellSurface *shellSurface; | 433 | XdgShellSurface *shellSurface; | ||
434 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 434 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
435 | QVERIFY(client); | 435 | QVERIFY(client); | ||
436 | QVERIFY(client->isActive()); | 436 | QVERIFY(client->isActive()); | ||
437 | 437 | | |||
438 | // The client should be moved to the position specified by the rule. | 438 | // The client should be moved to the position specified by the rule. | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 494 | { | |||
501 | group.writeEntry("wmclass", "org.kde.foo"); | 501 | group.writeEntry("wmclass", "org.kde.foo"); | ||
502 | group.writeEntry("wmclasscomplete", false); | 502 | group.writeEntry("wmclasscomplete", false); | ||
503 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 503 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
504 | group.sync(); | 504 | group.sync(); | ||
505 | RuleBook::self()->setConfig(config); | 505 | RuleBook::self()->setConfig(config); | ||
506 | workspace()->slotReconfigure(); | 506 | workspace()->slotReconfigure(); | ||
507 | 507 | | |||
508 | // Create the test client. | 508 | // Create the test client. | ||
509 | QFETCH(Test::ShellSurfaceType, type); | 509 | QFETCH(Test::XdgShellSurfaceType, type); | ||
510 | ShellClient *client; | 510 | ShellClient *client; | ||
511 | Surface *surface; | 511 | Surface *surface; | ||
512 | XdgShellSurface *shellSurface; | 512 | XdgShellSurface *shellSurface; | ||
513 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 513 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
514 | QVERIFY(client); | 514 | QVERIFY(client); | ||
515 | QVERIFY(client->isActive()); | 515 | QVERIFY(client->isActive()); | ||
516 | 516 | | |||
517 | // The client should be moved to the position specified by the rule. | 517 | // The client should be moved to the position specified by the rule. | ||
Show All 30 Lines | |||||
548 | QVERIFY(Test::waitForWindowDestroyed(client)); | 548 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
549 | } | 549 | } | ||
550 | 550 | | |||
551 | TEST_DATA(testPositionApplyNow) | 551 | TEST_DATA(testPositionApplyNow) | ||
552 | 552 | | |||
553 | void TestShellClientRules::testPositionApplyNow() | 553 | void TestShellClientRules::testPositionApplyNow() | ||
554 | { | 554 | { | ||
555 | // Create the test client. | 555 | // Create the test client. | ||
556 | QFETCH(Test::ShellSurfaceType, type); | 556 | QFETCH(Test::XdgShellSurfaceType, type); | ||
557 | ShellClient *client; | 557 | ShellClient *client; | ||
558 | Surface *surface; | 558 | Surface *surface; | ||
559 | QObject *shellSurface; | 559 | QObject *shellSurface; | ||
560 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 560 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
561 | QVERIFY(client); | 561 | QVERIFY(client); | ||
562 | QVERIFY(client->isActive()); | 562 | QVERIFY(client->isActive()); | ||
563 | 563 | | |||
564 | // The position of the client isn't set by any rule, thus the default placement | 564 | // The position of the client isn't set by any rule, thus the default placement | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 635 | { | |||
642 | group.writeEntry("wmclass", "org.kde.foo"); | 642 | group.writeEntry("wmclass", "org.kde.foo"); | ||
643 | group.writeEntry("wmclasscomplete", false); | 643 | group.writeEntry("wmclasscomplete", false); | ||
644 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 644 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
645 | group.sync(); | 645 | group.sync(); | ||
646 | RuleBook::self()->setConfig(config); | 646 | RuleBook::self()->setConfig(config); | ||
647 | workspace()->slotReconfigure(); | 647 | workspace()->slotReconfigure(); | ||
648 | 648 | | |||
649 | // Create the test client. | 649 | // Create the test client. | ||
650 | QFETCH(Test::ShellSurfaceType, type); | 650 | QFETCH(Test::XdgShellSurfaceType, type); | ||
651 | ShellClient *client; | 651 | ShellClient *client; | ||
652 | Surface *surface; | 652 | Surface *surface; | ||
653 | XdgShellSurface *shellSurface; | 653 | XdgShellSurface *shellSurface; | ||
654 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 654 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
655 | QVERIFY(client); | 655 | QVERIFY(client); | ||
656 | QVERIFY(client->isActive()); | 656 | QVERIFY(client->isActive()); | ||
657 | 657 | | |||
658 | // The client should be moved to the position specified by the rule. | 658 | // The client should be moved to the position specified by the rule. | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 695 | { | |||
702 | group.writeEntry("wmclass", "org.kde.foo"); | 702 | group.writeEntry("wmclass", "org.kde.foo"); | ||
703 | group.writeEntry("wmclasscomplete", false); | 703 | group.writeEntry("wmclasscomplete", false); | ||
704 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 704 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
705 | group.sync(); | 705 | group.sync(); | ||
706 | RuleBook::self()->setConfig(config); | 706 | RuleBook::self()->setConfig(config); | ||
707 | workspace()->slotReconfigure(); | 707 | workspace()->slotReconfigure(); | ||
708 | 708 | | |||
709 | // Create the test client. | 709 | // Create the test client. | ||
710 | QFETCH(Test::ShellSurfaceType, type); | 710 | QFETCH(Test::XdgShellSurfaceType, type); | ||
711 | QScopedPointer<Surface> surface; | 711 | QScopedPointer<Surface> surface; | ||
712 | surface.reset(Test::createSurface()); | 712 | surface.reset(Test::createSurface()); | ||
713 | QScopedPointer<XdgShellSurface> shellSurface; | 713 | QScopedPointer<XdgShellSurface> shellSurface; | ||
714 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 714 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
715 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 715 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
716 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 716 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
717 | shellSurface->setAppId("org.kde.foo"); | 717 | shellSurface->setAppId("org.kde.foo"); | ||
718 | surface->commit(Surface::CommitFlag::None); | 718 | surface->commit(Surface::CommitFlag::None); | ||
Show All 34 Lines | 746 | { | |||
753 | group.writeEntry("wmclass", "org.kde.foo"); | 753 | group.writeEntry("wmclass", "org.kde.foo"); | ||
754 | group.writeEntry("wmclasscomplete", false); | 754 | group.writeEntry("wmclasscomplete", false); | ||
755 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 755 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
756 | group.sync(); | 756 | group.sync(); | ||
757 | RuleBook::self()->setConfig(config); | 757 | RuleBook::self()->setConfig(config); | ||
758 | workspace()->slotReconfigure(); | 758 | workspace()->slotReconfigure(); | ||
759 | 759 | | |||
760 | // Create the test client. | 760 | // Create the test client. | ||
761 | QFETCH(Test::ShellSurfaceType, type); | 761 | QFETCH(Test::XdgShellSurfaceType, type); | ||
762 | QScopedPointer<Surface> surface; | 762 | QScopedPointer<Surface> surface; | ||
763 | surface.reset(Test::createSurface()); | 763 | surface.reset(Test::createSurface()); | ||
764 | QScopedPointer<XdgShellSurface> shellSurface; | 764 | QScopedPointer<XdgShellSurface> shellSurface; | ||
765 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 765 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
766 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 766 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
767 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 767 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
768 | shellSurface->setAppId("org.kde.foo"); | 768 | shellSurface->setAppId("org.kde.foo"); | ||
769 | surface->commit(Surface::CommitFlag::None); | 769 | surface->commit(Surface::CommitFlag::None); | ||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Line(s) | 884 | { | |||
891 | group.writeEntry("wmclass", "org.kde.foo"); | 891 | group.writeEntry("wmclass", "org.kde.foo"); | ||
892 | group.writeEntry("wmclasscomplete", false); | 892 | group.writeEntry("wmclasscomplete", false); | ||
893 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 893 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
894 | group.sync(); | 894 | group.sync(); | ||
895 | RuleBook::self()->setConfig(config); | 895 | RuleBook::self()->setConfig(config); | ||
896 | workspace()->slotReconfigure(); | 896 | workspace()->slotReconfigure(); | ||
897 | 897 | | |||
898 | // Create the test client. | 898 | // Create the test client. | ||
899 | QFETCH(Test::ShellSurfaceType, type); | 899 | QFETCH(Test::XdgShellSurfaceType, type); | ||
900 | QScopedPointer<Surface> surface; | 900 | QScopedPointer<Surface> surface; | ||
901 | surface.reset(Test::createSurface()); | 901 | surface.reset(Test::createSurface()); | ||
902 | QScopedPointer<XdgShellSurface> shellSurface; | 902 | QScopedPointer<XdgShellSurface> shellSurface; | ||
903 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 903 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
904 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 904 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
905 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 905 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
906 | shellSurface->setAppId("org.kde.foo"); | 906 | shellSurface->setAppId("org.kde.foo"); | ||
907 | surface->commit(Surface::CommitFlag::None); | 907 | surface->commit(Surface::CommitFlag::None); | ||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Line(s) | 1022 | { | |||
1029 | group.writeEntry("wmclass", "org.kde.foo"); | 1029 | group.writeEntry("wmclass", "org.kde.foo"); | ||
1030 | group.writeEntry("wmclasscomplete", false); | 1030 | group.writeEntry("wmclasscomplete", false); | ||
1031 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 1031 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
1032 | group.sync(); | 1032 | group.sync(); | ||
1033 | RuleBook::self()->setConfig(config); | 1033 | RuleBook::self()->setConfig(config); | ||
1034 | workspace()->slotReconfigure(); | 1034 | workspace()->slotReconfigure(); | ||
1035 | 1035 | | |||
1036 | // Create the test client. | 1036 | // Create the test client. | ||
1037 | QFETCH(Test::ShellSurfaceType, type); | 1037 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1038 | QScopedPointer<Surface> surface; | 1038 | QScopedPointer<Surface> surface; | ||
1039 | surface.reset(Test::createSurface()); | 1039 | surface.reset(Test::createSurface()); | ||
1040 | QScopedPointer<XdgShellSurface> shellSurface; | 1040 | QScopedPointer<XdgShellSurface> shellSurface; | ||
1041 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 1041 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
1042 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 1042 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
1043 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 1043 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
1044 | shellSurface->setAppId("org.kde.foo"); | 1044 | shellSurface->setAppId("org.kde.foo"); | ||
1045 | surface->commit(Surface::CommitFlag::None); | 1045 | surface->commit(Surface::CommitFlag::None); | ||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | |||||
1104 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1104 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
1105 | } | 1105 | } | ||
1106 | 1106 | | |||
1107 | TEST_DATA(testSizeApplyNow) | 1107 | TEST_DATA(testSizeApplyNow) | ||
1108 | 1108 | | |||
1109 | void TestShellClientRules::testSizeApplyNow() | 1109 | void TestShellClientRules::testSizeApplyNow() | ||
1110 | { | 1110 | { | ||
1111 | // Create the test client. | 1111 | // Create the test client. | ||
1112 | QFETCH(Test::ShellSurfaceType, type); | 1112 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1113 | QScopedPointer<Surface> surface; | 1113 | QScopedPointer<Surface> surface; | ||
1114 | surface.reset(Test::createSurface()); | 1114 | surface.reset(Test::createSurface()); | ||
1115 | QScopedPointer<XdgShellSurface> shellSurface; | 1115 | QScopedPointer<XdgShellSurface> shellSurface; | ||
1116 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 1116 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
1117 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 1117 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
1118 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 1118 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
1119 | shellSurface->setAppId("org.kde.foo"); | 1119 | shellSurface->setAppId("org.kde.foo"); | ||
1120 | surface->commit(Surface::CommitFlag::None); | 1120 | surface->commit(Surface::CommitFlag::None); | ||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 1179 | { | |||
1186 | group.writeEntry("wmclass", "org.kde.foo"); | 1186 | group.writeEntry("wmclass", "org.kde.foo"); | ||
1187 | group.writeEntry("wmclasscomplete", false); | 1187 | group.writeEntry("wmclasscomplete", false); | ||
1188 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 1188 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
1189 | group.sync(); | 1189 | group.sync(); | ||
1190 | RuleBook::self()->setConfig(config); | 1190 | RuleBook::self()->setConfig(config); | ||
1191 | workspace()->slotReconfigure(); | 1191 | workspace()->slotReconfigure(); | ||
1192 | 1192 | | |||
1193 | // Create the test client. | 1193 | // Create the test client. | ||
1194 | QFETCH(Test::ShellSurfaceType, type); | 1194 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1195 | QScopedPointer<Surface> surface; | 1195 | QScopedPointer<Surface> surface; | ||
1196 | surface.reset(Test::createSurface()); | 1196 | surface.reset(Test::createSurface()); | ||
1197 | QScopedPointer<XdgShellSurface> shellSurface; | 1197 | QScopedPointer<XdgShellSurface> shellSurface; | ||
1198 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 1198 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
1199 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 1199 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
1200 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 1200 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
1201 | shellSurface->setAppId("org.kde.foo"); | 1201 | shellSurface->setAppId("org.kde.foo"); | ||
1202 | surface->commit(Surface::CommitFlag::None); | 1202 | surface->commit(Surface::CommitFlag::None); | ||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 1267 | { | |||
1276 | group.writeEntry("wmclass", "org.kde.foo"); | 1276 | group.writeEntry("wmclass", "org.kde.foo"); | ||
1277 | group.writeEntry("wmclasscomplete", false); | 1277 | group.writeEntry("wmclasscomplete", false); | ||
1278 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 1278 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
1279 | group.sync(); | 1279 | group.sync(); | ||
1280 | RuleBook::self()->setConfig(config); | 1280 | RuleBook::self()->setConfig(config); | ||
1281 | workspace()->slotReconfigure(); | 1281 | workspace()->slotReconfigure(); | ||
1282 | 1282 | | |||
1283 | // Create the test client. | 1283 | // Create the test client. | ||
1284 | QFETCH(Test::ShellSurfaceType, type); | 1284 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1285 | QScopedPointer<Surface> surface; | 1285 | QScopedPointer<Surface> surface; | ||
1286 | surface.reset(Test::createSurface()); | 1286 | surface.reset(Test::createSurface()); | ||
1287 | QScopedPointer<XdgShellSurface> shellSurface; | 1287 | QScopedPointer<XdgShellSurface> shellSurface; | ||
1288 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 1288 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
1289 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 1289 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
1290 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 1290 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
1291 | shellSurface->setAppId("org.kde.foo"); | 1291 | shellSurface->setAppId("org.kde.foo"); | ||
1292 | surface->commit(Surface::CommitFlag::None); | 1292 | surface->commit(Surface::CommitFlag::None); | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 1329 | { | |||
1338 | group.writeEntry("wmclass", "org.kde.foo"); | 1338 | group.writeEntry("wmclass", "org.kde.foo"); | ||
1339 | group.writeEntry("wmclasscomplete", false); | 1339 | group.writeEntry("wmclasscomplete", false); | ||
1340 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 1340 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
1341 | group.sync(); | 1341 | group.sync(); | ||
1342 | RuleBook::self()->setConfig(config); | 1342 | RuleBook::self()->setConfig(config); | ||
1343 | workspace()->slotReconfigure(); | 1343 | workspace()->slotReconfigure(); | ||
1344 | 1344 | | |||
1345 | // Create the test client. | 1345 | // Create the test client. | ||
1346 | QFETCH(Test::ShellSurfaceType, type); | 1346 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1347 | QScopedPointer<Surface> surface; | 1347 | QScopedPointer<Surface> surface; | ||
1348 | surface.reset(Test::createSurface()); | 1348 | surface.reset(Test::createSurface()); | ||
1349 | QScopedPointer<XdgShellSurface> shellSurface; | 1349 | QScopedPointer<XdgShellSurface> shellSurface; | ||
1350 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 1350 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
1351 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 1351 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
1352 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 1352 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
1353 | shellSurface->setAppId("org.kde.foo"); | 1353 | shellSurface->setAppId("org.kde.foo"); | ||
1354 | surface->commit(Surface::CommitFlag::None); | 1354 | surface->commit(Surface::CommitFlag::None); | ||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 1441 | { | |||
1450 | group.writeEntry("wmclass", "org.kde.foo"); | 1450 | group.writeEntry("wmclass", "org.kde.foo"); | ||
1451 | group.writeEntry("wmclasscomplete", false); | 1451 | group.writeEntry("wmclasscomplete", false); | ||
1452 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 1452 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
1453 | group.sync(); | 1453 | group.sync(); | ||
1454 | RuleBook::self()->setConfig(config); | 1454 | RuleBook::self()->setConfig(config); | ||
1455 | workspace()->slotReconfigure(); | 1455 | workspace()->slotReconfigure(); | ||
1456 | 1456 | | |||
1457 | // Create the test client. | 1457 | // Create the test client. | ||
1458 | QFETCH(Test::ShellSurfaceType, type); | 1458 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1459 | QScopedPointer<Surface> surface; | 1459 | QScopedPointer<Surface> surface; | ||
1460 | surface.reset(Test::createSurface()); | 1460 | surface.reset(Test::createSurface()); | ||
1461 | QScopedPointer<XdgShellSurface> shellSurface; | 1461 | QScopedPointer<XdgShellSurface> shellSurface; | ||
1462 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 1462 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
1463 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 1463 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
1464 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 1464 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
1465 | shellSurface->setAppId("org.kde.foo"); | 1465 | shellSurface->setAppId("org.kde.foo"); | ||
1466 | surface->commit(Surface::CommitFlag::None); | 1466 | surface->commit(Surface::CommitFlag::None); | ||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 1553 | { | |||
1562 | group.writeEntry("wmclass", "org.kde.foo"); | 1562 | group.writeEntry("wmclass", "org.kde.foo"); | ||
1563 | group.writeEntry("wmclasscomplete", false); | 1563 | group.writeEntry("wmclasscomplete", false); | ||
1564 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 1564 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
1565 | group.sync(); | 1565 | group.sync(); | ||
1566 | RuleBook::self()->setConfig(config); | 1566 | RuleBook::self()->setConfig(config); | ||
1567 | workspace()->slotReconfigure(); | 1567 | workspace()->slotReconfigure(); | ||
1568 | 1568 | | |||
1569 | // Create the test client. | 1569 | // Create the test client. | ||
1570 | QFETCH(Test::ShellSurfaceType, type); | 1570 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1571 | QScopedPointer<Surface> surface; | 1571 | QScopedPointer<Surface> surface; | ||
1572 | surface.reset(Test::createSurface()); | 1572 | surface.reset(Test::createSurface()); | ||
1573 | QScopedPointer<XdgShellSurface> shellSurface; | 1573 | QScopedPointer<XdgShellSurface> shellSurface; | ||
1574 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 1574 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
1575 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 1575 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
1576 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 1576 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
1577 | shellSurface->setAppId("org.kde.foo"); | 1577 | shellSurface->setAppId("org.kde.foo"); | ||
1578 | surface->commit(Surface::CommitFlag::None); | 1578 | surface->commit(Surface::CommitFlag::None); | ||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | |||||
1649 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1649 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
1650 | } | 1650 | } | ||
1651 | 1651 | | |||
1652 | TEST_DATA(testMaximizeApplyNow) | 1652 | TEST_DATA(testMaximizeApplyNow) | ||
1653 | 1653 | | |||
1654 | void TestShellClientRules::testMaximizeApplyNow() | 1654 | void TestShellClientRules::testMaximizeApplyNow() | ||
1655 | { | 1655 | { | ||
1656 | // Create the test client. | 1656 | // Create the test client. | ||
1657 | QFETCH(Test::ShellSurfaceType, type); | 1657 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1658 | QScopedPointer<Surface> surface; | 1658 | QScopedPointer<Surface> surface; | ||
1659 | surface.reset(Test::createSurface()); | 1659 | surface.reset(Test::createSurface()); | ||
1660 | QScopedPointer<XdgShellSurface> shellSurface; | 1660 | QScopedPointer<XdgShellSurface> shellSurface; | ||
1661 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 1661 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
1662 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 1662 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
1663 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 1663 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
1664 | shellSurface->setAppId("org.kde.foo"); | 1664 | shellSurface->setAppId("org.kde.foo"); | ||
1665 | surface->commit(Surface::CommitFlag::None); | 1665 | surface->commit(Surface::CommitFlag::None); | ||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | 1762 | { | |||
1771 | group.writeEntry("wmclass", "org.kde.foo"); | 1771 | group.writeEntry("wmclass", "org.kde.foo"); | ||
1772 | group.writeEntry("wmclasscomplete", false); | 1772 | group.writeEntry("wmclasscomplete", false); | ||
1773 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 1773 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
1774 | group.sync(); | 1774 | group.sync(); | ||
1775 | RuleBook::self()->setConfig(config); | 1775 | RuleBook::self()->setConfig(config); | ||
1776 | workspace()->slotReconfigure(); | 1776 | workspace()->slotReconfigure(); | ||
1777 | 1777 | | |||
1778 | // Create the test client. | 1778 | // Create the test client. | ||
1779 | QFETCH(Test::ShellSurfaceType, type); | 1779 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1780 | QScopedPointer<Surface> surface; | 1780 | QScopedPointer<Surface> surface; | ||
1781 | surface.reset(Test::createSurface()); | 1781 | surface.reset(Test::createSurface()); | ||
1782 | QScopedPointer<XdgShellSurface> shellSurface; | 1782 | QScopedPointer<XdgShellSurface> shellSurface; | ||
1783 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 1783 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
1784 | QScopedPointer<QSignalSpy> configureRequestedSpy; | 1784 | QScopedPointer<QSignalSpy> configureRequestedSpy; | ||
1785 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 1785 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
1786 | shellSurface->setAppId("org.kde.foo"); | 1786 | shellSurface->setAppId("org.kde.foo"); | ||
1787 | surface->commit(Surface::CommitFlag::None); | 1787 | surface->commit(Surface::CommitFlag::None); | ||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 1864 | { | |||
1877 | 1877 | | |||
1878 | // We need at least two virtual desktop for this test. | 1878 | // We need at least two virtual desktop for this test. | ||
1879 | VirtualDesktopManager::self()->setCount(2); | 1879 | VirtualDesktopManager::self()->setCount(2); | ||
1880 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 1880 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
1881 | VirtualDesktopManager::self()->setCurrent(1); | 1881 | VirtualDesktopManager::self()->setCurrent(1); | ||
1882 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 1882 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
1883 | 1883 | | |||
1884 | // Create the test client. | 1884 | // Create the test client. | ||
1885 | QFETCH(Test::ShellSurfaceType, type); | 1885 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1886 | ShellClient *client; | 1886 | ShellClient *client; | ||
1887 | Surface *surface; | 1887 | Surface *surface; | ||
1888 | XdgShellSurface *shellSurface; | 1888 | XdgShellSurface *shellSurface; | ||
1889 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 1889 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
1890 | QVERIFY(client); | 1890 | QVERIFY(client); | ||
1891 | 1891 | | |||
1892 | // The client should appear on the current virtual desktop. | 1892 | // The client should appear on the current virtual desktop. | ||
1893 | QCOMPARE(client->desktop(), 1); | 1893 | QCOMPARE(client->desktop(), 1); | ||
Show All 24 Lines | 1905 | { | |||
1918 | 1918 | | |||
1919 | // We need at least two virtual desktop for this test. | 1919 | // We need at least two virtual desktop for this test. | ||
1920 | VirtualDesktopManager::self()->setCount(2); | 1920 | VirtualDesktopManager::self()->setCount(2); | ||
1921 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 1921 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
1922 | VirtualDesktopManager::self()->setCurrent(1); | 1922 | VirtualDesktopManager::self()->setCurrent(1); | ||
1923 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 1923 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
1924 | 1924 | | |||
1925 | // Create the test client. | 1925 | // Create the test client. | ||
1926 | QFETCH(Test::ShellSurfaceType, type); | 1926 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1927 | ShellClient *client; | 1927 | ShellClient *client; | ||
1928 | Surface *surface; | 1928 | Surface *surface; | ||
1929 | XdgShellSurface *shellSurface; | 1929 | XdgShellSurface *shellSurface; | ||
1930 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 1930 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
1931 | QVERIFY(client); | 1931 | QVERIFY(client); | ||
1932 | 1932 | | |||
1933 | // The client should appear on the second virtual desktop. | 1933 | // The client should appear on the second virtual desktop. | ||
1934 | QCOMPARE(client->desktop(), 2); | 1934 | QCOMPARE(client->desktop(), 2); | ||
Show All 40 Lines | 1962 | { | |||
1975 | 1975 | | |||
1976 | // We need at least two virtual desktop for this test. | 1976 | // We need at least two virtual desktop for this test. | ||
1977 | VirtualDesktopManager::self()->setCount(2); | 1977 | VirtualDesktopManager::self()->setCount(2); | ||
1978 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 1978 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
1979 | VirtualDesktopManager::self()->setCurrent(1); | 1979 | VirtualDesktopManager::self()->setCurrent(1); | ||
1980 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 1980 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
1981 | 1981 | | |||
1982 | // Create the test client. | 1982 | // Create the test client. | ||
1983 | QFETCH(Test::ShellSurfaceType, type); | 1983 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1984 | ShellClient *client; | 1984 | ShellClient *client; | ||
1985 | Surface *surface; | 1985 | Surface *surface; | ||
1986 | XdgShellSurface *shellSurface; | 1986 | XdgShellSurface *shellSurface; | ||
1987 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 1987 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
1988 | QVERIFY(client); | 1988 | QVERIFY(client); | ||
1989 | QCOMPARE(client->desktop(), 2); | 1989 | QCOMPARE(client->desktop(), 2); | ||
1990 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | 1990 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | ||
1991 | 1991 | | |||
Show All 36 Lines | 2015 | { | |||
2028 | 2028 | | |||
2029 | // We need at least two virtual desktop for this test. | 2029 | // We need at least two virtual desktop for this test. | ||
2030 | VirtualDesktopManager::self()->setCount(2); | 2030 | VirtualDesktopManager::self()->setCount(2); | ||
2031 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 2031 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
2032 | VirtualDesktopManager::self()->setCurrent(1); | 2032 | VirtualDesktopManager::self()->setCurrent(1); | ||
2033 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2033 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2034 | 2034 | | |||
2035 | // Create the test client. | 2035 | // Create the test client. | ||
2036 | QFETCH(Test::ShellSurfaceType, type); | 2036 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2037 | ShellClient *client; | 2037 | ShellClient *client; | ||
2038 | Surface *surface; | 2038 | Surface *surface; | ||
2039 | XdgShellSurface *shellSurface; | 2039 | XdgShellSurface *shellSurface; | ||
2040 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2040 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2041 | QVERIFY(client); | 2041 | QVERIFY(client); | ||
2042 | 2042 | | |||
2043 | // The client should appear on the second virtual desktop. | 2043 | // The client should appear on the second virtual desktop. | ||
2044 | QCOMPARE(client->desktop(), 2); | 2044 | QCOMPARE(client->desktop(), 2); | ||
Show All 27 Lines | |||||
2072 | { | 2072 | { | ||
2073 | // We need at least two virtual desktop for this test. | 2073 | // We need at least two virtual desktop for this test. | ||
2074 | VirtualDesktopManager::self()->setCount(2); | 2074 | VirtualDesktopManager::self()->setCount(2); | ||
2075 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 2075 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
2076 | VirtualDesktopManager::self()->setCurrent(1); | 2076 | VirtualDesktopManager::self()->setCurrent(1); | ||
2077 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2077 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2078 | 2078 | | |||
2079 | // Create the test client. | 2079 | // Create the test client. | ||
2080 | QFETCH(Test::ShellSurfaceType, type); | 2080 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2081 | ShellClient *client; | 2081 | ShellClient *client; | ||
2082 | Surface *surface; | 2082 | Surface *surface; | ||
2083 | XdgShellSurface *shellSurface; | 2083 | XdgShellSurface *shellSurface; | ||
2084 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2084 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2085 | QVERIFY(client); | 2085 | QVERIFY(client); | ||
2086 | QCOMPARE(client->desktop(), 1); | 2086 | QCOMPARE(client->desktop(), 1); | ||
2087 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2087 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2088 | 2088 | | |||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 2125 | { | |||
2138 | 2138 | | |||
2139 | // We need at least two virtual desktop for this test. | 2139 | // We need at least two virtual desktop for this test. | ||
2140 | VirtualDesktopManager::self()->setCount(2); | 2140 | VirtualDesktopManager::self()->setCount(2); | ||
2141 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 2141 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
2142 | VirtualDesktopManager::self()->setCurrent(1); | 2142 | VirtualDesktopManager::self()->setCurrent(1); | ||
2143 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2143 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2144 | 2144 | | |||
2145 | // Create the test client. | 2145 | // Create the test client. | ||
2146 | QFETCH(Test::ShellSurfaceType, type); | 2146 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2147 | ShellClient *client; | 2147 | ShellClient *client; | ||
2148 | Surface *surface; | 2148 | Surface *surface; | ||
2149 | XdgShellSurface *shellSurface; | 2149 | XdgShellSurface *shellSurface; | ||
2150 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2150 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2151 | QVERIFY(client); | 2151 | QVERIFY(client); | ||
2152 | 2152 | | |||
2153 | // The client should appear on the second virtual desktop. | 2153 | // The client should appear on the second virtual desktop. | ||
2154 | QCOMPARE(client->desktop(), 2); | 2154 | QCOMPARE(client->desktop(), 2); | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 2190 | { | |||
2197 | group.writeEntry("wmclass", "org.kde.foo"); | 2197 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2198 | group.writeEntry("wmclasscomplete", false); | 2198 | group.writeEntry("wmclasscomplete", false); | ||
2199 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2199 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2200 | group.sync(); | 2200 | group.sync(); | ||
2201 | RuleBook::self()->setConfig(config); | 2201 | RuleBook::self()->setConfig(config); | ||
2202 | workspace()->slotReconfigure(); | 2202 | workspace()->slotReconfigure(); | ||
2203 | 2203 | | |||
2204 | // Create the test client. | 2204 | // Create the test client. | ||
2205 | QFETCH(Test::ShellSurfaceType, type); | 2205 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2206 | ShellClient *client; | 2206 | ShellClient *client; | ||
2207 | Surface *surface; | 2207 | Surface *surface; | ||
2208 | XdgShellSurface *shellSurface; | 2208 | XdgShellSurface *shellSurface; | ||
2209 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2209 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2210 | QVERIFY(client); | 2210 | QVERIFY(client); | ||
2211 | QVERIFY(client->isMinimizable()); | 2211 | QVERIFY(client->isMinimizable()); | ||
2212 | 2212 | | |||
2213 | // The client should not be minimized. | 2213 | // The client should not be minimized. | ||
Show All 18 Lines | 2225 | { | |||
2232 | group.writeEntry("wmclass", "org.kde.foo"); | 2232 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2233 | group.writeEntry("wmclasscomplete", false); | 2233 | group.writeEntry("wmclasscomplete", false); | ||
2234 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2234 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2235 | group.sync(); | 2235 | group.sync(); | ||
2236 | RuleBook::self()->setConfig(config); | 2236 | RuleBook::self()->setConfig(config); | ||
2237 | workspace()->slotReconfigure(); | 2237 | workspace()->slotReconfigure(); | ||
2238 | 2238 | | |||
2239 | // Create the test client. | 2239 | // Create the test client. | ||
2240 | QFETCH(Test::ShellSurfaceType, type); | 2240 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2241 | ShellClient *client; | 2241 | ShellClient *client; | ||
2242 | Surface *surface; | 2242 | Surface *surface; | ||
2243 | XdgShellSurface *shellSurface; | 2243 | XdgShellSurface *shellSurface; | ||
2244 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2244 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2245 | QVERIFY(client); | 2245 | QVERIFY(client); | ||
2246 | QVERIFY(client->isMinimizable()); | 2246 | QVERIFY(client->isMinimizable()); | ||
2247 | 2247 | | |||
2248 | // The client should be minimized. | 2248 | // The client should be minimized. | ||
Show All 31 Lines | 2273 | { | |||
2280 | group.writeEntry("wmclass", "org.kde.foo"); | 2280 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2281 | group.writeEntry("wmclasscomplete", false); | 2281 | group.writeEntry("wmclasscomplete", false); | ||
2282 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2282 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2283 | group.sync(); | 2283 | group.sync(); | ||
2284 | RuleBook::self()->setConfig(config); | 2284 | RuleBook::self()->setConfig(config); | ||
2285 | workspace()->slotReconfigure(); | 2285 | workspace()->slotReconfigure(); | ||
2286 | 2286 | | |||
2287 | // Create the test client. | 2287 | // Create the test client. | ||
2288 | QFETCH(Test::ShellSurfaceType, type); | 2288 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2289 | ShellClient *client; | 2289 | ShellClient *client; | ||
2290 | Surface *surface; | 2290 | Surface *surface; | ||
2291 | XdgShellSurface *shellSurface; | 2291 | XdgShellSurface *shellSurface; | ||
2292 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2292 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2293 | QVERIFY(client); | 2293 | QVERIFY(client); | ||
2294 | QVERIFY(client->isMinimizable()); | 2294 | QVERIFY(client->isMinimizable()); | ||
2295 | QVERIFY(!client->isMinimized()); | 2295 | QVERIFY(!client->isMinimized()); | ||
2296 | 2296 | | |||
Show All 29 Lines | 2319 | { | |||
2326 | group.writeEntry("wmclass", "org.kde.foo"); | 2326 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2327 | group.writeEntry("wmclasscomplete", false); | 2327 | group.writeEntry("wmclasscomplete", false); | ||
2328 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2328 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2329 | group.sync(); | 2329 | group.sync(); | ||
2330 | RuleBook::self()->setConfig(config); | 2330 | RuleBook::self()->setConfig(config); | ||
2331 | workspace()->slotReconfigure(); | 2331 | workspace()->slotReconfigure(); | ||
2332 | 2332 | | |||
2333 | // Create the test client. | 2333 | // Create the test client. | ||
2334 | QFETCH(Test::ShellSurfaceType, type); | 2334 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2335 | ShellClient *client; | 2335 | ShellClient *client; | ||
2336 | Surface *surface; | 2336 | Surface *surface; | ||
2337 | XdgShellSurface *shellSurface; | 2337 | XdgShellSurface *shellSurface; | ||
2338 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2338 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2339 | QVERIFY(client); | 2339 | QVERIFY(client); | ||
2340 | QVERIFY(!client->isMinimizable()); | 2340 | QVERIFY(!client->isMinimizable()); | ||
2341 | QVERIFY(!client->isMinimized()); | 2341 | QVERIFY(!client->isMinimized()); | ||
2342 | 2342 | | |||
Show All 18 Lines | |||||
2361 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2361 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2362 | } | 2362 | } | ||
2363 | 2363 | | |||
2364 | TEST_DATA(testMinimizeApplyNow) | 2364 | TEST_DATA(testMinimizeApplyNow) | ||
2365 | 2365 | | |||
2366 | void TestShellClientRules::testMinimizeApplyNow() | 2366 | void TestShellClientRules::testMinimizeApplyNow() | ||
2367 | { | 2367 | { | ||
2368 | // Create the test client. | 2368 | // Create the test client. | ||
2369 | QFETCH(Test::ShellSurfaceType, type); | 2369 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2370 | ShellClient *client; | 2370 | ShellClient *client; | ||
2371 | Surface *surface; | 2371 | Surface *surface; | ||
2372 | XdgShellSurface *shellSurface; | 2372 | XdgShellSurface *shellSurface; | ||
2373 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2373 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2374 | QVERIFY(client); | 2374 | QVERIFY(client); | ||
2375 | QVERIFY(client->isMinimizable()); | 2375 | QVERIFY(client->isMinimizable()); | ||
2376 | QVERIFY(!client->isMinimized()); | 2376 | QVERIFY(!client->isMinimized()); | ||
2377 | 2377 | | |||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 2413 | { | |||
2420 | group.writeEntry("wmclass", "org.kde.foo"); | 2420 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2421 | group.writeEntry("wmclasscomplete", false); | 2421 | group.writeEntry("wmclasscomplete", false); | ||
2422 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2422 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2423 | group.sync(); | 2423 | group.sync(); | ||
2424 | RuleBook::self()->setConfig(config); | 2424 | RuleBook::self()->setConfig(config); | ||
2425 | workspace()->slotReconfigure(); | 2425 | workspace()->slotReconfigure(); | ||
2426 | 2426 | | |||
2427 | // Create the test client. | 2427 | // Create the test client. | ||
2428 | QFETCH(Test::ShellSurfaceType, type); | 2428 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2429 | ShellClient *client; | 2429 | ShellClient *client; | ||
2430 | Surface *surface; | 2430 | Surface *surface; | ||
2431 | XdgShellSurface *shellSurface; | 2431 | XdgShellSurface *shellSurface; | ||
2432 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2432 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2433 | QVERIFY(client); | 2433 | QVERIFY(client); | ||
2434 | QVERIFY(!client->isMinimizable()); | 2434 | QVERIFY(!client->isMinimizable()); | ||
2435 | QVERIFY(!client->isMinimized()); | 2435 | QVERIFY(!client->isMinimized()); | ||
2436 | 2436 | | |||
Show All 31 Lines | 2461 | { | |||
2468 | group.writeEntry("wmclass", "org.kde.foo"); | 2468 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2469 | group.writeEntry("wmclasscomplete", false); | 2469 | group.writeEntry("wmclasscomplete", false); | ||
2470 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2470 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2471 | group.sync(); | 2471 | group.sync(); | ||
2472 | RuleBook::self()->setConfig(config); | 2472 | RuleBook::self()->setConfig(config); | ||
2473 | workspace()->slotReconfigure(); | 2473 | workspace()->slotReconfigure(); | ||
2474 | 2474 | | |||
2475 | // Create the test client. | 2475 | // Create the test client. | ||
2476 | QFETCH(Test::ShellSurfaceType, type); | 2476 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2477 | ShellClient *client; | 2477 | ShellClient *client; | ||
2478 | Surface *surface; | 2478 | Surface *surface; | ||
2479 | XdgShellSurface *shellSurface; | 2479 | XdgShellSurface *shellSurface; | ||
2480 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2480 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2481 | QVERIFY(client); | 2481 | QVERIFY(client); | ||
2482 | 2482 | | |||
2483 | // The client should not be affected by the rule. | 2483 | // The client should not be affected by the rule. | ||
2484 | QVERIFY(!client->skipTaskbar()); | 2484 | QVERIFY(!client->skipTaskbar()); | ||
Show All 17 Lines | 2495 | { | |||
2502 | group.writeEntry("wmclass", "org.kde.foo"); | 2502 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2503 | group.writeEntry("wmclasscomplete", false); | 2503 | group.writeEntry("wmclasscomplete", false); | ||
2504 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2504 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2505 | group.sync(); | 2505 | group.sync(); | ||
2506 | RuleBook::self()->setConfig(config); | 2506 | RuleBook::self()->setConfig(config); | ||
2507 | workspace()->slotReconfigure(); | 2507 | workspace()->slotReconfigure(); | ||
2508 | 2508 | | |||
2509 | // Create the test client. | 2509 | // Create the test client. | ||
2510 | QFETCH(Test::ShellSurfaceType, type); | 2510 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2511 | ShellClient *client; | 2511 | ShellClient *client; | ||
2512 | Surface *surface; | 2512 | Surface *surface; | ||
2513 | XdgShellSurface *shellSurface; | 2513 | XdgShellSurface *shellSurface; | ||
2514 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2514 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2515 | QVERIFY(client); | 2515 | QVERIFY(client); | ||
2516 | 2516 | | |||
2517 | // The client should not be included on a taskbar. | 2517 | // The client should not be included on a taskbar. | ||
2518 | QVERIFY(client->skipTaskbar()); | 2518 | QVERIFY(client->skipTaskbar()); | ||
Show All 29 Lines | 2541 | { | |||
2548 | group.writeEntry("wmclass", "org.kde.foo"); | 2548 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2549 | group.writeEntry("wmclasscomplete", false); | 2549 | group.writeEntry("wmclasscomplete", false); | ||
2550 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2550 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2551 | group.sync(); | 2551 | group.sync(); | ||
2552 | RuleBook::self()->setConfig(config); | 2552 | RuleBook::self()->setConfig(config); | ||
2553 | workspace()->slotReconfigure(); | 2553 | workspace()->slotReconfigure(); | ||
2554 | 2554 | | |||
2555 | // Create the test client. | 2555 | // Create the test client. | ||
2556 | QFETCH(Test::ShellSurfaceType, type); | 2556 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2557 | ShellClient *client; | 2557 | ShellClient *client; | ||
2558 | Surface *surface; | 2558 | Surface *surface; | ||
2559 | XdgShellSurface *shellSurface; | 2559 | XdgShellSurface *shellSurface; | ||
2560 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2560 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2561 | QVERIFY(client); | 2561 | QVERIFY(client); | ||
2562 | 2562 | | |||
2563 | // The client should not be included on a taskbar. | 2563 | // The client should not be included on a taskbar. | ||
2564 | QVERIFY(client->skipTaskbar()); | 2564 | QVERIFY(client->skipTaskbar()); | ||
Show All 31 Lines | 2589 | { | |||
2596 | group.writeEntry("wmclass", "org.kde.foo"); | 2596 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2597 | group.writeEntry("wmclasscomplete", false); | 2597 | group.writeEntry("wmclasscomplete", false); | ||
2598 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2598 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2599 | group.sync(); | 2599 | group.sync(); | ||
2600 | RuleBook::self()->setConfig(config); | 2600 | RuleBook::self()->setConfig(config); | ||
2601 | workspace()->slotReconfigure(); | 2601 | workspace()->slotReconfigure(); | ||
2602 | 2602 | | |||
2603 | // Create the test client. | 2603 | // Create the test client. | ||
2604 | QFETCH(Test::ShellSurfaceType, type); | 2604 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2605 | ShellClient *client; | 2605 | ShellClient *client; | ||
2606 | Surface *surface; | 2606 | Surface *surface; | ||
2607 | XdgShellSurface *shellSurface; | 2607 | XdgShellSurface *shellSurface; | ||
2608 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2608 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2609 | QVERIFY(client); | 2609 | QVERIFY(client); | ||
2610 | 2610 | | |||
2611 | // The client should not be included on a taskbar. | 2611 | // The client should not be included on a taskbar. | ||
2612 | QVERIFY(client->skipTaskbar()); | 2612 | QVERIFY(client->skipTaskbar()); | ||
Show All 18 Lines | |||||
2631 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2631 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2632 | } | 2632 | } | ||
2633 | 2633 | | |||
2634 | TEST_DATA(testSkipTaskbarApplyNow) | 2634 | TEST_DATA(testSkipTaskbarApplyNow) | ||
2635 | 2635 | | |||
2636 | void TestShellClientRules::testSkipTaskbarApplyNow() | 2636 | void TestShellClientRules::testSkipTaskbarApplyNow() | ||
2637 | { | 2637 | { | ||
2638 | // Create the test client. | 2638 | // Create the test client. | ||
2639 | QFETCH(Test::ShellSurfaceType, type); | 2639 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2640 | ShellClient *client; | 2640 | ShellClient *client; | ||
2641 | Surface *surface; | 2641 | Surface *surface; | ||
2642 | XdgShellSurface *shellSurface; | 2642 | XdgShellSurface *shellSurface; | ||
2643 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2643 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2644 | QVERIFY(client); | 2644 | QVERIFY(client); | ||
2645 | QVERIFY(!client->skipTaskbar()); | 2645 | QVERIFY(!client->skipTaskbar()); | ||
2646 | 2646 | | |||
2647 | // Initialize RuleBook with the test rule. | 2647 | // Initialize RuleBook with the test rule. | ||
Show All 39 Lines | 2680 | { | |||
2687 | group.writeEntry("wmclass", "org.kde.foo"); | 2687 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2688 | group.writeEntry("wmclasscomplete", false); | 2688 | group.writeEntry("wmclasscomplete", false); | ||
2689 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2689 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2690 | group.sync(); | 2690 | group.sync(); | ||
2691 | RuleBook::self()->setConfig(config); | 2691 | RuleBook::self()->setConfig(config); | ||
2692 | workspace()->slotReconfigure(); | 2692 | workspace()->slotReconfigure(); | ||
2693 | 2693 | | |||
2694 | // Create the test client. | 2694 | // Create the test client. | ||
2695 | QFETCH(Test::ShellSurfaceType, type); | 2695 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2696 | ShellClient *client; | 2696 | ShellClient *client; | ||
2697 | Surface *surface; | 2697 | Surface *surface; | ||
2698 | XdgShellSurface *shellSurface; | 2698 | XdgShellSurface *shellSurface; | ||
2699 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2699 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2700 | QVERIFY(client); | 2700 | QVERIFY(client); | ||
2701 | 2701 | | |||
2702 | // The client should not be included on a taskbar. | 2702 | // The client should not be included on a taskbar. | ||
2703 | QVERIFY(client->skipTaskbar()); | 2703 | QVERIFY(client->skipTaskbar()); | ||
Show All 33 Lines | 2730 | { | |||
2737 | group.writeEntry("wmclass", "org.kde.foo"); | 2737 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2738 | group.writeEntry("wmclasscomplete", false); | 2738 | group.writeEntry("wmclasscomplete", false); | ||
2739 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2739 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2740 | group.sync(); | 2740 | group.sync(); | ||
2741 | RuleBook::self()->setConfig(config); | 2741 | RuleBook::self()->setConfig(config); | ||
2742 | workspace()->slotReconfigure(); | 2742 | workspace()->slotReconfigure(); | ||
2743 | 2743 | | |||
2744 | // Create the test client. | 2744 | // Create the test client. | ||
2745 | QFETCH(Test::ShellSurfaceType, type); | 2745 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2746 | ShellClient *client; | 2746 | ShellClient *client; | ||
2747 | Surface *surface; | 2747 | Surface *surface; | ||
2748 | XdgShellSurface *shellSurface; | 2748 | XdgShellSurface *shellSurface; | ||
2749 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2749 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2750 | QVERIFY(client); | 2750 | QVERIFY(client); | ||
2751 | 2751 | | |||
2752 | // The client should not be affected by the rule. | 2752 | // The client should not be affected by the rule. | ||
2753 | QVERIFY(!client->skipPager()); | 2753 | QVERIFY(!client->skipPager()); | ||
Show All 17 Lines | 2764 | { | |||
2771 | group.writeEntry("wmclass", "org.kde.foo"); | 2771 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2772 | group.writeEntry("wmclasscomplete", false); | 2772 | group.writeEntry("wmclasscomplete", false); | ||
2773 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2773 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2774 | group.sync(); | 2774 | group.sync(); | ||
2775 | RuleBook::self()->setConfig(config); | 2775 | RuleBook::self()->setConfig(config); | ||
2776 | workspace()->slotReconfigure(); | 2776 | workspace()->slotReconfigure(); | ||
2777 | 2777 | | |||
2778 | // Create the test client. | 2778 | // Create the test client. | ||
2779 | QFETCH(Test::ShellSurfaceType, type); | 2779 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2780 | ShellClient *client; | 2780 | ShellClient *client; | ||
2781 | Surface *surface; | 2781 | Surface *surface; | ||
2782 | XdgShellSurface *shellSurface; | 2782 | XdgShellSurface *shellSurface; | ||
2783 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2783 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2784 | QVERIFY(client); | 2784 | QVERIFY(client); | ||
2785 | 2785 | | |||
2786 | // The client should not be included on a pager. | 2786 | // The client should not be included on a pager. | ||
2787 | QVERIFY(client->skipPager()); | 2787 | QVERIFY(client->skipPager()); | ||
Show All 29 Lines | 2810 | { | |||
2817 | group.writeEntry("wmclass", "org.kde.foo"); | 2817 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2818 | group.writeEntry("wmclasscomplete", false); | 2818 | group.writeEntry("wmclasscomplete", false); | ||
2819 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2819 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2820 | group.sync(); | 2820 | group.sync(); | ||
2821 | RuleBook::self()->setConfig(config); | 2821 | RuleBook::self()->setConfig(config); | ||
2822 | workspace()->slotReconfigure(); | 2822 | workspace()->slotReconfigure(); | ||
2823 | 2823 | | |||
2824 | // Create the test client. | 2824 | // Create the test client. | ||
2825 | QFETCH(Test::ShellSurfaceType, type); | 2825 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2826 | ShellClient *client; | 2826 | ShellClient *client; | ||
2827 | Surface *surface; | 2827 | Surface *surface; | ||
2828 | XdgShellSurface *shellSurface; | 2828 | XdgShellSurface *shellSurface; | ||
2829 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2829 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2830 | QVERIFY(client); | 2830 | QVERIFY(client); | ||
2831 | 2831 | | |||
2832 | // The client should not be included on a pager. | 2832 | // The client should not be included on a pager. | ||
2833 | QVERIFY(client->skipPager()); | 2833 | QVERIFY(client->skipPager()); | ||
Show All 31 Lines | 2858 | { | |||
2865 | group.writeEntry("wmclass", "org.kde.foo"); | 2865 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2866 | group.writeEntry("wmclasscomplete", false); | 2866 | group.writeEntry("wmclasscomplete", false); | ||
2867 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2867 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2868 | group.sync(); | 2868 | group.sync(); | ||
2869 | RuleBook::self()->setConfig(config); | 2869 | RuleBook::self()->setConfig(config); | ||
2870 | workspace()->slotReconfigure(); | 2870 | workspace()->slotReconfigure(); | ||
2871 | 2871 | | |||
2872 | // Create the test client. | 2872 | // Create the test client. | ||
2873 | QFETCH(Test::ShellSurfaceType, type); | 2873 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2874 | ShellClient *client; | 2874 | ShellClient *client; | ||
2875 | Surface *surface; | 2875 | Surface *surface; | ||
2876 | XdgShellSurface *shellSurface; | 2876 | XdgShellSurface *shellSurface; | ||
2877 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2877 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2878 | QVERIFY(client); | 2878 | QVERIFY(client); | ||
2879 | 2879 | | |||
2880 | // The client should not be included on a pager. | 2880 | // The client should not be included on a pager. | ||
2881 | QVERIFY(client->skipPager()); | 2881 | QVERIFY(client->skipPager()); | ||
Show All 18 Lines | |||||
2900 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2900 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2901 | } | 2901 | } | ||
2902 | 2902 | | |||
2903 | TEST_DATA(testSkipPagerApplyNow) | 2903 | TEST_DATA(testSkipPagerApplyNow) | ||
2904 | 2904 | | |||
2905 | void TestShellClientRules::testSkipPagerApplyNow() | 2905 | void TestShellClientRules::testSkipPagerApplyNow() | ||
2906 | { | 2906 | { | ||
2907 | // Create the test client. | 2907 | // Create the test client. | ||
2908 | QFETCH(Test::ShellSurfaceType, type); | 2908 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2909 | ShellClient *client; | 2909 | ShellClient *client; | ||
2910 | Surface *surface; | 2910 | Surface *surface; | ||
2911 | XdgShellSurface *shellSurface; | 2911 | XdgShellSurface *shellSurface; | ||
2912 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2912 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2913 | QVERIFY(client); | 2913 | QVERIFY(client); | ||
2914 | QVERIFY(!client->skipPager()); | 2914 | QVERIFY(!client->skipPager()); | ||
2915 | 2915 | | |||
2916 | // Initialize RuleBook with the test rule. | 2916 | // Initialize RuleBook with the test rule. | ||
Show All 39 Lines | 2949 | { | |||
2956 | group.writeEntry("wmclass", "org.kde.foo"); | 2956 | group.writeEntry("wmclass", "org.kde.foo"); | ||
2957 | group.writeEntry("wmclasscomplete", false); | 2957 | group.writeEntry("wmclasscomplete", false); | ||
2958 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2958 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2959 | group.sync(); | 2959 | group.sync(); | ||
2960 | RuleBook::self()->setConfig(config); | 2960 | RuleBook::self()->setConfig(config); | ||
2961 | workspace()->slotReconfigure(); | 2961 | workspace()->slotReconfigure(); | ||
2962 | 2962 | | |||
2963 | // Create the test client. | 2963 | // Create the test client. | ||
2964 | QFETCH(Test::ShellSurfaceType, type); | 2964 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2965 | ShellClient *client; | 2965 | ShellClient *client; | ||
2966 | Surface *surface; | 2966 | Surface *surface; | ||
2967 | XdgShellSurface *shellSurface; | 2967 | XdgShellSurface *shellSurface; | ||
2968 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2968 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2969 | QVERIFY(client); | 2969 | QVERIFY(client); | ||
2970 | 2970 | | |||
2971 | // The client should not be included on a pager. | 2971 | // The client should not be included on a pager. | ||
2972 | QVERIFY(client->skipPager()); | 2972 | QVERIFY(client->skipPager()); | ||
Show All 33 Lines | 2999 | { | |||
3006 | group.writeEntry("wmclass", "org.kde.foo"); | 3006 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3007 | group.writeEntry("wmclasscomplete", false); | 3007 | group.writeEntry("wmclasscomplete", false); | ||
3008 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3008 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3009 | group.sync(); | 3009 | group.sync(); | ||
3010 | RuleBook::self()->setConfig(config); | 3010 | RuleBook::self()->setConfig(config); | ||
3011 | workspace()->slotReconfigure(); | 3011 | workspace()->slotReconfigure(); | ||
3012 | 3012 | | |||
3013 | // Create the test client. | 3013 | // Create the test client. | ||
3014 | QFETCH(Test::ShellSurfaceType, type); | 3014 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3015 | ShellClient *client; | 3015 | ShellClient *client; | ||
3016 | Surface *surface; | 3016 | Surface *surface; | ||
3017 | XdgShellSurface *shellSurface; | 3017 | XdgShellSurface *shellSurface; | ||
3018 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3018 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3019 | QVERIFY(client); | 3019 | QVERIFY(client); | ||
3020 | 3020 | | |||
3021 | // The client should not be affected by the rule. | 3021 | // The client should not be affected by the rule. | ||
3022 | QVERIFY(!client->skipSwitcher()); | 3022 | QVERIFY(!client->skipSwitcher()); | ||
Show All 17 Lines | 3033 | { | |||
3040 | group.writeEntry("wmclass", "org.kde.foo"); | 3040 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3041 | group.writeEntry("wmclasscomplete", false); | 3041 | group.writeEntry("wmclasscomplete", false); | ||
3042 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3042 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3043 | group.sync(); | 3043 | group.sync(); | ||
3044 | RuleBook::self()->setConfig(config); | 3044 | RuleBook::self()->setConfig(config); | ||
3045 | workspace()->slotReconfigure(); | 3045 | workspace()->slotReconfigure(); | ||
3046 | 3046 | | |||
3047 | // Create the test client. | 3047 | // Create the test client. | ||
3048 | QFETCH(Test::ShellSurfaceType, type); | 3048 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3049 | ShellClient *client; | 3049 | ShellClient *client; | ||
3050 | Surface *surface; | 3050 | Surface *surface; | ||
3051 | XdgShellSurface *shellSurface; | 3051 | XdgShellSurface *shellSurface; | ||
3052 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3052 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3053 | QVERIFY(client); | 3053 | QVERIFY(client); | ||
3054 | 3054 | | |||
3055 | // The client should be excluded from window switching effects. | 3055 | // The client should be excluded from window switching effects. | ||
3056 | QVERIFY(client->skipSwitcher()); | 3056 | QVERIFY(client->skipSwitcher()); | ||
Show All 29 Lines | 3079 | { | |||
3086 | group.writeEntry("wmclass", "org.kde.foo"); | 3086 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3087 | group.writeEntry("wmclasscomplete", false); | 3087 | group.writeEntry("wmclasscomplete", false); | ||
3088 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3088 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3089 | group.sync(); | 3089 | group.sync(); | ||
3090 | RuleBook::self()->setConfig(config); | 3090 | RuleBook::self()->setConfig(config); | ||
3091 | workspace()->slotReconfigure(); | 3091 | workspace()->slotReconfigure(); | ||
3092 | 3092 | | |||
3093 | // Create the test client. | 3093 | // Create the test client. | ||
3094 | QFETCH(Test::ShellSurfaceType, type); | 3094 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3095 | ShellClient *client; | 3095 | ShellClient *client; | ||
3096 | Surface *surface; | 3096 | Surface *surface; | ||
3097 | XdgShellSurface *shellSurface; | 3097 | XdgShellSurface *shellSurface; | ||
3098 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3098 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3099 | QVERIFY(client); | 3099 | QVERIFY(client); | ||
3100 | 3100 | | |||
3101 | // The client should be excluded from window switching effects. | 3101 | // The client should be excluded from window switching effects. | ||
3102 | QVERIFY(client->skipSwitcher()); | 3102 | QVERIFY(client->skipSwitcher()); | ||
Show All 31 Lines | 3127 | { | |||
3134 | group.writeEntry("wmclass", "org.kde.foo"); | 3134 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3135 | group.writeEntry("wmclasscomplete", false); | 3135 | group.writeEntry("wmclasscomplete", false); | ||
3136 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3136 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3137 | group.sync(); | 3137 | group.sync(); | ||
3138 | RuleBook::self()->setConfig(config); | 3138 | RuleBook::self()->setConfig(config); | ||
3139 | workspace()->slotReconfigure(); | 3139 | workspace()->slotReconfigure(); | ||
3140 | 3140 | | |||
3141 | // Create the test client. | 3141 | // Create the test client. | ||
3142 | QFETCH(Test::ShellSurfaceType, type); | 3142 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3143 | ShellClient *client; | 3143 | ShellClient *client; | ||
3144 | Surface *surface; | 3144 | Surface *surface; | ||
3145 | XdgShellSurface *shellSurface; | 3145 | XdgShellSurface *shellSurface; | ||
3146 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3146 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3147 | QVERIFY(client); | 3147 | QVERIFY(client); | ||
3148 | 3148 | | |||
3149 | // The client should be excluded from window switching effects. | 3149 | // The client should be excluded from window switching effects. | ||
3150 | QVERIFY(client->skipSwitcher()); | 3150 | QVERIFY(client->skipSwitcher()); | ||
Show All 18 Lines | |||||
3169 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3169 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3170 | } | 3170 | } | ||
3171 | 3171 | | |||
3172 | TEST_DATA(testSkipSwitcherApplyNow) | 3172 | TEST_DATA(testSkipSwitcherApplyNow) | ||
3173 | 3173 | | |||
3174 | void TestShellClientRules::testSkipSwitcherApplyNow() | 3174 | void TestShellClientRules::testSkipSwitcherApplyNow() | ||
3175 | { | 3175 | { | ||
3176 | // Create the test client. | 3176 | // Create the test client. | ||
3177 | QFETCH(Test::ShellSurfaceType, type); | 3177 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3178 | ShellClient *client; | 3178 | ShellClient *client; | ||
3179 | Surface *surface; | 3179 | Surface *surface; | ||
3180 | XdgShellSurface *shellSurface; | 3180 | XdgShellSurface *shellSurface; | ||
3181 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3181 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3182 | QVERIFY(client); | 3182 | QVERIFY(client); | ||
3183 | QVERIFY(!client->skipSwitcher()); | 3183 | QVERIFY(!client->skipSwitcher()); | ||
3184 | 3184 | | |||
3185 | // Initialize RuleBook with the test rule. | 3185 | // Initialize RuleBook with the test rule. | ||
Show All 39 Lines | 3218 | { | |||
3225 | group.writeEntry("wmclass", "org.kde.foo"); | 3225 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3226 | group.writeEntry("wmclasscomplete", false); | 3226 | group.writeEntry("wmclasscomplete", false); | ||
3227 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3227 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3228 | group.sync(); | 3228 | group.sync(); | ||
3229 | RuleBook::self()->setConfig(config); | 3229 | RuleBook::self()->setConfig(config); | ||
3230 | workspace()->slotReconfigure(); | 3230 | workspace()->slotReconfigure(); | ||
3231 | 3231 | | |||
3232 | // Create the test client. | 3232 | // Create the test client. | ||
3233 | QFETCH(Test::ShellSurfaceType, type); | 3233 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3234 | ShellClient *client; | 3234 | ShellClient *client; | ||
3235 | Surface *surface; | 3235 | Surface *surface; | ||
3236 | XdgShellSurface *shellSurface; | 3236 | XdgShellSurface *shellSurface; | ||
3237 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3237 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3238 | QVERIFY(client); | 3238 | QVERIFY(client); | ||
3239 | 3239 | | |||
3240 | // The client should be excluded from window switching effects. | 3240 | // The client should be excluded from window switching effects. | ||
3241 | QVERIFY(client->skipSwitcher()); | 3241 | QVERIFY(client->skipSwitcher()); | ||
Show All 33 Lines | 3268 | { | |||
3275 | group.writeEntry("wmclass", "org.kde.foo"); | 3275 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3276 | group.writeEntry("wmclasscomplete", false); | 3276 | group.writeEntry("wmclasscomplete", false); | ||
3277 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3277 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3278 | group.sync(); | 3278 | group.sync(); | ||
3279 | RuleBook::self()->setConfig(config); | 3279 | RuleBook::self()->setConfig(config); | ||
3280 | workspace()->slotReconfigure(); | 3280 | workspace()->slotReconfigure(); | ||
3281 | 3281 | | |||
3282 | // Create the test client. | 3282 | // Create the test client. | ||
3283 | QFETCH(Test::ShellSurfaceType, type); | 3283 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3284 | ShellClient *client; | 3284 | ShellClient *client; | ||
3285 | Surface *surface; | 3285 | Surface *surface; | ||
3286 | XdgShellSurface *shellSurface; | 3286 | XdgShellSurface *shellSurface; | ||
3287 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3287 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3288 | QVERIFY(client); | 3288 | QVERIFY(client); | ||
3289 | 3289 | | |||
3290 | // The keep-above state of the client should not be affected by the rule. | 3290 | // The keep-above state of the client should not be affected by the rule. | ||
3291 | QVERIFY(!client->keepAbove()); | 3291 | QVERIFY(!client->keepAbove()); | ||
Show All 17 Lines | 3302 | { | |||
3309 | group.writeEntry("wmclass", "org.kde.foo"); | 3309 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3310 | group.writeEntry("wmclasscomplete", false); | 3310 | group.writeEntry("wmclasscomplete", false); | ||
3311 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3311 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3312 | group.sync(); | 3312 | group.sync(); | ||
3313 | RuleBook::self()->setConfig(config); | 3313 | RuleBook::self()->setConfig(config); | ||
3314 | workspace()->slotReconfigure(); | 3314 | workspace()->slotReconfigure(); | ||
3315 | 3315 | | |||
3316 | // Create the test client. | 3316 | // Create the test client. | ||
3317 | QFETCH(Test::ShellSurfaceType, type); | 3317 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3318 | ShellClient *client; | 3318 | ShellClient *client; | ||
3319 | Surface *surface; | 3319 | Surface *surface; | ||
3320 | XdgShellSurface *shellSurface; | 3320 | XdgShellSurface *shellSurface; | ||
3321 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3321 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3322 | QVERIFY(client); | 3322 | QVERIFY(client); | ||
3323 | 3323 | | |||
3324 | // Initially, the client should be kept above. | 3324 | // Initially, the client should be kept above. | ||
3325 | QVERIFY(client->keepAbove()); | 3325 | QVERIFY(client->keepAbove()); | ||
Show All 29 Lines | 3348 | { | |||
3355 | group.writeEntry("wmclass", "org.kde.foo"); | 3355 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3356 | group.writeEntry("wmclasscomplete", false); | 3356 | group.writeEntry("wmclasscomplete", false); | ||
3357 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3357 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3358 | group.sync(); | 3358 | group.sync(); | ||
3359 | RuleBook::self()->setConfig(config); | 3359 | RuleBook::self()->setConfig(config); | ||
3360 | workspace()->slotReconfigure(); | 3360 | workspace()->slotReconfigure(); | ||
3361 | 3361 | | |||
3362 | // Create the test client. | 3362 | // Create the test client. | ||
3363 | QFETCH(Test::ShellSurfaceType, type); | 3363 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3364 | ShellClient *client; | 3364 | ShellClient *client; | ||
3365 | Surface *surface; | 3365 | Surface *surface; | ||
3366 | XdgShellSurface *shellSurface; | 3366 | XdgShellSurface *shellSurface; | ||
3367 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3367 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3368 | QVERIFY(client); | 3368 | QVERIFY(client); | ||
3369 | 3369 | | |||
3370 | // Initially, the client should be kept above. | 3370 | // Initially, the client should be kept above. | ||
3371 | QVERIFY(client->keepAbove()); | 3371 | QVERIFY(client->keepAbove()); | ||
Show All 29 Lines | 3394 | { | |||
3401 | group.writeEntry("wmclass", "org.kde.foo"); | 3401 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3402 | group.writeEntry("wmclasscomplete", false); | 3402 | group.writeEntry("wmclasscomplete", false); | ||
3403 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3403 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3404 | group.sync(); | 3404 | group.sync(); | ||
3405 | RuleBook::self()->setConfig(config); | 3405 | RuleBook::self()->setConfig(config); | ||
3406 | workspace()->slotReconfigure(); | 3406 | workspace()->slotReconfigure(); | ||
3407 | 3407 | | |||
3408 | // Create the test client. | 3408 | // Create the test client. | ||
3409 | QFETCH(Test::ShellSurfaceType, type); | 3409 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3410 | ShellClient *client; | 3410 | ShellClient *client; | ||
3411 | Surface *surface; | 3411 | Surface *surface; | ||
3412 | XdgShellSurface *shellSurface; | 3412 | XdgShellSurface *shellSurface; | ||
3413 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3413 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3414 | QVERIFY(client); | 3414 | QVERIFY(client); | ||
3415 | 3415 | | |||
3416 | // Initially, the client should be kept above. | 3416 | // Initially, the client should be kept above. | ||
3417 | QVERIFY(client->keepAbove()); | 3417 | QVERIFY(client->keepAbove()); | ||
Show All 16 Lines | |||||
3434 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3434 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3435 | } | 3435 | } | ||
3436 | 3436 | | |||
3437 | TEST_DATA(testKeepAboveApplyNow) | 3437 | TEST_DATA(testKeepAboveApplyNow) | ||
3438 | 3438 | | |||
3439 | void TestShellClientRules::testKeepAboveApplyNow() | 3439 | void TestShellClientRules::testKeepAboveApplyNow() | ||
3440 | { | 3440 | { | ||
3441 | // Create the test client. | 3441 | // Create the test client. | ||
3442 | QFETCH(Test::ShellSurfaceType, type); | 3442 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3443 | ShellClient *client; | 3443 | ShellClient *client; | ||
3444 | Surface *surface; | 3444 | Surface *surface; | ||
3445 | XdgShellSurface *shellSurface; | 3445 | XdgShellSurface *shellSurface; | ||
3446 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3446 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3447 | QVERIFY(client); | 3447 | QVERIFY(client); | ||
3448 | QVERIFY(!client->keepAbove()); | 3448 | QVERIFY(!client->keepAbove()); | ||
3449 | 3449 | | |||
3450 | // Initialize RuleBook with the test rule. | 3450 | // Initialize RuleBook with the test rule. | ||
Show All 39 Lines | 3483 | { | |||
3490 | group.writeEntry("wmclass", "org.kde.foo"); | 3490 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3491 | group.writeEntry("wmclasscomplete", false); | 3491 | group.writeEntry("wmclasscomplete", false); | ||
3492 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3492 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3493 | group.sync(); | 3493 | group.sync(); | ||
3494 | RuleBook::self()->setConfig(config); | 3494 | RuleBook::self()->setConfig(config); | ||
3495 | workspace()->slotReconfigure(); | 3495 | workspace()->slotReconfigure(); | ||
3496 | 3496 | | |||
3497 | // Create the test client. | 3497 | // Create the test client. | ||
3498 | QFETCH(Test::ShellSurfaceType, type); | 3498 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3499 | ShellClient *client; | 3499 | ShellClient *client; | ||
3500 | Surface *surface; | 3500 | Surface *surface; | ||
3501 | XdgShellSurface *shellSurface; | 3501 | XdgShellSurface *shellSurface; | ||
3502 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3502 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3503 | QVERIFY(client); | 3503 | QVERIFY(client); | ||
3504 | 3504 | | |||
3505 | // Initially, the client should be kept above. | 3505 | // Initially, the client should be kept above. | ||
3506 | QVERIFY(client->keepAbove()); | 3506 | QVERIFY(client->keepAbove()); | ||
Show All 35 Lines | 3535 | { | |||
3542 | group.writeEntry("wmclass", "org.kde.foo"); | 3542 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3543 | group.writeEntry("wmclasscomplete", false); | 3543 | group.writeEntry("wmclasscomplete", false); | ||
3544 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3544 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3545 | group.sync(); | 3545 | group.sync(); | ||
3546 | RuleBook::self()->setConfig(config); | 3546 | RuleBook::self()->setConfig(config); | ||
3547 | workspace()->slotReconfigure(); | 3547 | workspace()->slotReconfigure(); | ||
3548 | 3548 | | |||
3549 | // Create the test client. | 3549 | // Create the test client. | ||
3550 | QFETCH(Test::ShellSurfaceType, type); | 3550 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3551 | ShellClient *client; | 3551 | ShellClient *client; | ||
3552 | Surface *surface; | 3552 | Surface *surface; | ||
3553 | XdgShellSurface *shellSurface; | 3553 | XdgShellSurface *shellSurface; | ||
3554 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3554 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3555 | QVERIFY(client); | 3555 | QVERIFY(client); | ||
3556 | 3556 | | |||
3557 | // The keep-below state of the client should not be affected by the rule. | 3557 | // The keep-below state of the client should not be affected by the rule. | ||
3558 | QVERIFY(!client->keepBelow()); | 3558 | QVERIFY(!client->keepBelow()); | ||
Show All 17 Lines | 3569 | { | |||
3576 | group.writeEntry("wmclass", "org.kde.foo"); | 3576 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3577 | group.writeEntry("wmclasscomplete", false); | 3577 | group.writeEntry("wmclasscomplete", false); | ||
3578 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3578 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3579 | group.sync(); | 3579 | group.sync(); | ||
3580 | RuleBook::self()->setConfig(config); | 3580 | RuleBook::self()->setConfig(config); | ||
3581 | workspace()->slotReconfigure(); | 3581 | workspace()->slotReconfigure(); | ||
3582 | 3582 | | |||
3583 | // Create the test client. | 3583 | // Create the test client. | ||
3584 | QFETCH(Test::ShellSurfaceType, type); | 3584 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3585 | ShellClient *client; | 3585 | ShellClient *client; | ||
3586 | Surface *surface; | 3586 | Surface *surface; | ||
3587 | XdgShellSurface *shellSurface; | 3587 | XdgShellSurface *shellSurface; | ||
3588 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3588 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3589 | QVERIFY(client); | 3589 | QVERIFY(client); | ||
3590 | 3590 | | |||
3591 | // Initially, the client should be kept below. | 3591 | // Initially, the client should be kept below. | ||
3592 | QVERIFY(client->keepBelow()); | 3592 | QVERIFY(client->keepBelow()); | ||
Show All 29 Lines | 3615 | { | |||
3622 | group.writeEntry("wmclass", "org.kde.foo"); | 3622 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3623 | group.writeEntry("wmclasscomplete", false); | 3623 | group.writeEntry("wmclasscomplete", false); | ||
3624 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3624 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3625 | group.sync(); | 3625 | group.sync(); | ||
3626 | RuleBook::self()->setConfig(config); | 3626 | RuleBook::self()->setConfig(config); | ||
3627 | workspace()->slotReconfigure(); | 3627 | workspace()->slotReconfigure(); | ||
3628 | 3628 | | |||
3629 | // Create the test client. | 3629 | // Create the test client. | ||
3630 | QFETCH(Test::ShellSurfaceType, type); | 3630 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3631 | ShellClient *client; | 3631 | ShellClient *client; | ||
3632 | Surface *surface; | 3632 | Surface *surface; | ||
3633 | XdgShellSurface *shellSurface; | 3633 | XdgShellSurface *shellSurface; | ||
3634 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3634 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3635 | QVERIFY(client); | 3635 | QVERIFY(client); | ||
3636 | 3636 | | |||
3637 | // Initially, the client should be kept below. | 3637 | // Initially, the client should be kept below. | ||
3638 | QVERIFY(client->keepBelow()); | 3638 | QVERIFY(client->keepBelow()); | ||
Show All 29 Lines | 3661 | { | |||
3668 | group.writeEntry("wmclass", "org.kde.foo"); | 3668 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3669 | group.writeEntry("wmclasscomplete", false); | 3669 | group.writeEntry("wmclasscomplete", false); | ||
3670 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3670 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3671 | group.sync(); | 3671 | group.sync(); | ||
3672 | RuleBook::self()->setConfig(config); | 3672 | RuleBook::self()->setConfig(config); | ||
3673 | workspace()->slotReconfigure(); | 3673 | workspace()->slotReconfigure(); | ||
3674 | 3674 | | |||
3675 | // Create the test client. | 3675 | // Create the test client. | ||
3676 | QFETCH(Test::ShellSurfaceType, type); | 3676 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3677 | ShellClient *client; | 3677 | ShellClient *client; | ||
3678 | Surface *surface; | 3678 | Surface *surface; | ||
3679 | XdgShellSurface *shellSurface; | 3679 | XdgShellSurface *shellSurface; | ||
3680 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3680 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3681 | QVERIFY(client); | 3681 | QVERIFY(client); | ||
3682 | 3682 | | |||
3683 | // Initially, the client should be kept below. | 3683 | // Initially, the client should be kept below. | ||
3684 | QVERIFY(client->keepBelow()); | 3684 | QVERIFY(client->keepBelow()); | ||
Show All 16 Lines | |||||
3701 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3701 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3702 | } | 3702 | } | ||
3703 | 3703 | | |||
3704 | TEST_DATA(testKeepBelowApplyNow) | 3704 | TEST_DATA(testKeepBelowApplyNow) | ||
3705 | 3705 | | |||
3706 | void TestShellClientRules::testKeepBelowApplyNow() | 3706 | void TestShellClientRules::testKeepBelowApplyNow() | ||
3707 | { | 3707 | { | ||
3708 | // Create the test client. | 3708 | // Create the test client. | ||
3709 | QFETCH(Test::ShellSurfaceType, type); | 3709 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3710 | ShellClient *client; | 3710 | ShellClient *client; | ||
3711 | Surface *surface; | 3711 | Surface *surface; | ||
3712 | XdgShellSurface *shellSurface; | 3712 | XdgShellSurface *shellSurface; | ||
3713 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3713 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3714 | QVERIFY(client); | 3714 | QVERIFY(client); | ||
3715 | QVERIFY(!client->keepBelow()); | 3715 | QVERIFY(!client->keepBelow()); | ||
3716 | 3716 | | |||
3717 | // Initialize RuleBook with the test rule. | 3717 | // Initialize RuleBook with the test rule. | ||
Show All 39 Lines | 3750 | { | |||
3757 | group.writeEntry("wmclass", "org.kde.foo"); | 3757 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3758 | group.writeEntry("wmclasscomplete", false); | 3758 | group.writeEntry("wmclasscomplete", false); | ||
3759 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3759 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3760 | group.sync(); | 3760 | group.sync(); | ||
3761 | RuleBook::self()->setConfig(config); | 3761 | RuleBook::self()->setConfig(config); | ||
3762 | workspace()->slotReconfigure(); | 3762 | workspace()->slotReconfigure(); | ||
3763 | 3763 | | |||
3764 | // Create the test client. | 3764 | // Create the test client. | ||
3765 | QFETCH(Test::ShellSurfaceType, type); | 3765 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3766 | ShellClient *client; | 3766 | ShellClient *client; | ||
3767 | Surface *surface; | 3767 | Surface *surface; | ||
3768 | XdgShellSurface *shellSurface; | 3768 | XdgShellSurface *shellSurface; | ||
3769 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3769 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3770 | QVERIFY(client); | 3770 | QVERIFY(client); | ||
3771 | 3771 | | |||
3772 | // Initially, the client should be kept below. | 3772 | // Initially, the client should be kept below. | ||
3773 | QVERIFY(client->keepBelow()); | 3773 | QVERIFY(client->keepBelow()); | ||
Show All 35 Lines | 3802 | { | |||
3809 | group.writeEntry("wmclass", "org.kde.foo"); | 3809 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3810 | group.writeEntry("wmclasscomplete", false); | 3810 | group.writeEntry("wmclasscomplete", false); | ||
3811 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3811 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3812 | group.sync(); | 3812 | group.sync(); | ||
3813 | RuleBook::self()->setConfig(config); | 3813 | RuleBook::self()->setConfig(config); | ||
3814 | workspace()->slotReconfigure(); | 3814 | workspace()->slotReconfigure(); | ||
3815 | 3815 | | |||
3816 | // Create the test client. | 3816 | // Create the test client. | ||
3817 | QFETCH(Test::ShellSurfaceType, type); | 3817 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3818 | ShellClient *client; | 3818 | ShellClient *client; | ||
3819 | Surface *surface; | 3819 | Surface *surface; | ||
3820 | XdgShellSurface *shellSurface; | 3820 | XdgShellSurface *shellSurface; | ||
3821 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3821 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3822 | QVERIFY(client); | 3822 | QVERIFY(client); | ||
3823 | QCOMPARE(client->shortcut(), QKeySequence()); | 3823 | QCOMPARE(client->shortcut(), QKeySequence()); | ||
3824 | client->minimize(); | 3824 | client->minimize(); | ||
3825 | QVERIFY(client->isMinimized()); | 3825 | QVERIFY(client->isMinimized()); | ||
Show All 30 Lines | 3849 | { | |||
3856 | group.writeEntry("wmclass", "org.kde.foo"); | 3856 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3857 | group.writeEntry("wmclasscomplete", false); | 3857 | group.writeEntry("wmclasscomplete", false); | ||
3858 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3858 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3859 | group.sync(); | 3859 | group.sync(); | ||
3860 | RuleBook::self()->setConfig(config); | 3860 | RuleBook::self()->setConfig(config); | ||
3861 | workspace()->slotReconfigure(); | 3861 | workspace()->slotReconfigure(); | ||
3862 | 3862 | | |||
3863 | // Create the test client. | 3863 | // Create the test client. | ||
3864 | QFETCH(Test::ShellSurfaceType, type); | 3864 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3865 | ShellClient *client; | 3865 | ShellClient *client; | ||
3866 | Surface *surface; | 3866 | Surface *surface; | ||
3867 | XdgShellSurface *shellSurface; | 3867 | XdgShellSurface *shellSurface; | ||
3868 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3868 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3869 | QVERIFY(client); | 3869 | QVERIFY(client); | ||
3870 | 3870 | | |||
3871 | // If we press the window shortcut, the window should be brought back to user. | 3871 | // If we press the window shortcut, the window should be brought back to user. | ||
3872 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | 3872 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 3932 | { | |||
3941 | group.writeEntry("wmclass", "org.kde.foo"); | 3941 | group.writeEntry("wmclass", "org.kde.foo"); | ||
3942 | group.writeEntry("wmclasscomplete", false); | 3942 | group.writeEntry("wmclasscomplete", false); | ||
3943 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3943 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3944 | group.sync(); | 3944 | group.sync(); | ||
3945 | RuleBook::self()->setConfig(config); | 3945 | RuleBook::self()->setConfig(config); | ||
3946 | workspace()->slotReconfigure(); | 3946 | workspace()->slotReconfigure(); | ||
3947 | 3947 | | |||
3948 | // Create the test client. | 3948 | // Create the test client. | ||
3949 | QFETCH(Test::ShellSurfaceType, type); | 3949 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3950 | ShellClient *client; | 3950 | ShellClient *client; | ||
3951 | Surface *surface; | 3951 | Surface *surface; | ||
3952 | XdgShellSurface *shellSurface; | 3952 | XdgShellSurface *shellSurface; | ||
3953 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3953 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3954 | QVERIFY(client); | 3954 | QVERIFY(client); | ||
3955 | 3955 | | |||
3956 | // If we press the window shortcut, the window should be brought back to user. | 3956 | // If we press the window shortcut, the window should be brought back to user. | ||
3957 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | 3957 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | ||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 4005 | { | |||
4014 | group.writeEntry("wmclass", "org.kde.foo"); | 4014 | group.writeEntry("wmclass", "org.kde.foo"); | ||
4015 | group.writeEntry("wmclasscomplete", false); | 4015 | group.writeEntry("wmclasscomplete", false); | ||
4016 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4016 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4017 | group.sync(); | 4017 | group.sync(); | ||
4018 | RuleBook::self()->setConfig(config); | 4018 | RuleBook::self()->setConfig(config); | ||
4019 | workspace()->slotReconfigure(); | 4019 | workspace()->slotReconfigure(); | ||
4020 | 4020 | | |||
4021 | // Create the test client. | 4021 | // Create the test client. | ||
4022 | QFETCH(Test::ShellSurfaceType, type); | 4022 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4023 | ShellClient *client; | 4023 | ShellClient *client; | ||
4024 | Surface *surface; | 4024 | Surface *surface; | ||
4025 | XdgShellSurface *shellSurface; | 4025 | XdgShellSurface *shellSurface; | ||
4026 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4026 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4027 | QVERIFY(client); | 4027 | QVERIFY(client); | ||
4028 | 4028 | | |||
4029 | // If we press the window shortcut, the window should be brought back to user. | 4029 | // If we press the window shortcut, the window should be brought back to user. | ||
4030 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | 4030 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
4072 | QVERIFY(Test::waitForWindowDestroyed(client)); | 4072 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
4073 | } | 4073 | } | ||
4074 | 4074 | | |||
4075 | TEST_DATA(testShortcutApplyNow) | 4075 | TEST_DATA(testShortcutApplyNow) | ||
4076 | 4076 | | |||
4077 | void TestShellClientRules::testShortcutApplyNow() | 4077 | void TestShellClientRules::testShortcutApplyNow() | ||
4078 | { | 4078 | { | ||
4079 | // Create the test client. | 4079 | // Create the test client. | ||
4080 | QFETCH(Test::ShellSurfaceType, type); | 4080 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4081 | ShellClient *client; | 4081 | ShellClient *client; | ||
4082 | Surface *surface; | 4082 | Surface *surface; | ||
4083 | XdgShellSurface *shellSurface; | 4083 | XdgShellSurface *shellSurface; | ||
4084 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4084 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4085 | QVERIFY(client); | 4085 | QVERIFY(client); | ||
4086 | QVERIFY(client->shortcut().isEmpty()); | 4086 | QVERIFY(client->shortcut().isEmpty()); | ||
4087 | 4087 | | |||
4088 | // Initialize RuleBook with the test rule. | 4088 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 4144 | { | |||
4153 | group.writeEntry("wmclass", "org.kde.foo"); | 4153 | group.writeEntry("wmclass", "org.kde.foo"); | ||
4154 | group.writeEntry("wmclasscomplete", false); | 4154 | group.writeEntry("wmclasscomplete", false); | ||
4155 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4155 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4156 | group.sync(); | 4156 | group.sync(); | ||
4157 | RuleBook::self()->setConfig(config); | 4157 | RuleBook::self()->setConfig(config); | ||
4158 | workspace()->slotReconfigure(); | 4158 | workspace()->slotReconfigure(); | ||
4159 | 4159 | | |||
4160 | // Create the test client. | 4160 | // Create the test client. | ||
4161 | QFETCH(Test::ShellSurfaceType, type); | 4161 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4162 | ShellClient *client; | 4162 | ShellClient *client; | ||
4163 | Surface *surface; | 4163 | Surface *surface; | ||
4164 | XdgShellSurface *shellSurface; | 4164 | XdgShellSurface *shellSurface; | ||
4165 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4165 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4166 | QVERIFY(client); | 4166 | QVERIFY(client); | ||
4167 | 4167 | | |||
4168 | // If we press the window shortcut, the window should be brought back to user. | 4168 | // If we press the window shortcut, the window should be brought back to user. | ||
4169 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | 4169 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | ||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | 4275 | { | |||
4282 | group.writeEntry("wmclass", "org.kde.foo"); | 4282 | group.writeEntry("wmclass", "org.kde.foo"); | ||
4283 | group.writeEntry("wmclasscomplete", false); | 4283 | group.writeEntry("wmclasscomplete", false); | ||
4284 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4284 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4285 | group.sync(); | 4285 | group.sync(); | ||
4286 | RuleBook::self()->setConfig(config); | 4286 | RuleBook::self()->setConfig(config); | ||
4287 | workspace()->slotReconfigure(); | 4287 | workspace()->slotReconfigure(); | ||
4288 | 4288 | | |||
4289 | // Create the test client. | 4289 | // Create the test client. | ||
4290 | QFETCH(Test::ShellSurfaceType, type); | 4290 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4291 | ShellClient *client; | 4291 | ShellClient *client; | ||
4292 | Surface *surface; | 4292 | Surface *surface; | ||
4293 | XdgShellSurface *shellSurface; | 4293 | XdgShellSurface *shellSurface; | ||
4294 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4294 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4295 | QVERIFY(client); | 4295 | QVERIFY(client); | ||
4296 | QVERIFY(client->isActive()); | 4296 | QVERIFY(client->isActive()); | ||
4297 | 4297 | | |||
4298 | // The opacity should not be affected by the rule. | 4298 | // The opacity should not be affected by the rule. | ||
Show All 18 Lines | 4310 | { | |||
4317 | group.writeEntry("wmclass", "org.kde.foo"); | 4317 | group.writeEntry("wmclass", "org.kde.foo"); | ||
4318 | group.writeEntry("wmclasscomplete", false); | 4318 | group.writeEntry("wmclasscomplete", false); | ||
4319 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4319 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4320 | group.sync(); | 4320 | group.sync(); | ||
4321 | RuleBook::self()->setConfig(config); | 4321 | RuleBook::self()->setConfig(config); | ||
4322 | workspace()->slotReconfigure(); | 4322 | workspace()->slotReconfigure(); | ||
4323 | 4323 | | |||
4324 | // Create the test client. | 4324 | // Create the test client. | ||
4325 | QFETCH(Test::ShellSurfaceType, type); | 4325 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4326 | ShellClient *client; | 4326 | ShellClient *client; | ||
4327 | Surface *surface; | 4327 | Surface *surface; | ||
4328 | XdgShellSurface *shellSurface; | 4328 | XdgShellSurface *shellSurface; | ||
4329 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4329 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4330 | QVERIFY(client); | 4330 | QVERIFY(client); | ||
4331 | QVERIFY(client->isActive()); | 4331 | QVERIFY(client->isActive()); | ||
4332 | QCOMPARE(client->opacity(), 0.9); | 4332 | QCOMPARE(client->opacity(), 0.9); | ||
4333 | 4333 | | |||
Show All 16 Lines | 4343 | { | |||
4350 | group.writeEntry("wmclass", "org.kde.foo"); | 4350 | group.writeEntry("wmclass", "org.kde.foo"); | ||
4351 | group.writeEntry("wmclasscomplete", false); | 4351 | group.writeEntry("wmclasscomplete", false); | ||
4352 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4352 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4353 | group.sync(); | 4353 | group.sync(); | ||
4354 | RuleBook::self()->setConfig(config); | 4354 | RuleBook::self()->setConfig(config); | ||
4355 | workspace()->slotReconfigure(); | 4355 | workspace()->slotReconfigure(); | ||
4356 | 4356 | | |||
4357 | // Create the test client. | 4357 | // Create the test client. | ||
4358 | QFETCH(Test::ShellSurfaceType, type); | 4358 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4359 | ShellClient *client; | 4359 | ShellClient *client; | ||
4360 | Surface *surface; | 4360 | Surface *surface; | ||
4361 | XdgShellSurface *shellSurface; | 4361 | XdgShellSurface *shellSurface; | ||
4362 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4362 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4363 | QVERIFY(client); | 4363 | QVERIFY(client); | ||
4364 | QVERIFY(client->isActive()); | 4364 | QVERIFY(client->isActive()); | ||
4365 | QCOMPARE(client->opacity(), 0.9); | 4365 | QCOMPARE(client->opacity(), 0.9); | ||
4366 | 4366 | | |||
Show All 25 Lines | 4385 | { | |||
4392 | group.writeEntry("wmclass", "org.kde.foo"); | 4392 | group.writeEntry("wmclass", "org.kde.foo"); | ||
4393 | group.writeEntry("wmclasscomplete", false); | 4393 | group.writeEntry("wmclasscomplete", false); | ||
4394 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4394 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4395 | group.sync(); | 4395 | group.sync(); | ||
4396 | RuleBook::self()->setConfig(config); | 4396 | RuleBook::self()->setConfig(config); | ||
4397 | workspace()->slotReconfigure(); | 4397 | workspace()->slotReconfigure(); | ||
4398 | 4398 | | |||
4399 | // Create the test client. | 4399 | // Create the test client. | ||
4400 | QFETCH(Test::ShellSurfaceType, type); | 4400 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4401 | ShellClient *client; | 4401 | ShellClient *client; | ||
4402 | Surface *surface; | 4402 | Surface *surface; | ||
4403 | XdgShellSurface *shellSurface; | 4403 | XdgShellSurface *shellSurface; | ||
4404 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4404 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4405 | QVERIFY(client); | 4405 | QVERIFY(client); | ||
4406 | QVERIFY(client->isActive()); | 4406 | QVERIFY(client->isActive()); | ||
4407 | 4407 | | |||
4408 | // Make the client inactive. | 4408 | // Make the client inactive. | ||
Show All 22 Lines | 4424 | { | |||
4431 | group.writeEntry("wmclass", "org.kde.foo"); | 4431 | group.writeEntry("wmclass", "org.kde.foo"); | ||
4432 | group.writeEntry("wmclasscomplete", false); | 4432 | group.writeEntry("wmclasscomplete", false); | ||
4433 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4433 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4434 | group.sync(); | 4434 | group.sync(); | ||
4435 | RuleBook::self()->setConfig(config); | 4435 | RuleBook::self()->setConfig(config); | ||
4436 | workspace()->slotReconfigure(); | 4436 | workspace()->slotReconfigure(); | ||
4437 | 4437 | | |||
4438 | // Create the test client. | 4438 | // Create the test client. | ||
4439 | QFETCH(Test::ShellSurfaceType, type); | 4439 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4440 | ShellClient *client; | 4440 | ShellClient *client; | ||
4441 | Surface *surface; | 4441 | Surface *surface; | ||
4442 | XdgShellSurface *shellSurface; | 4442 | XdgShellSurface *shellSurface; | ||
4443 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4443 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4444 | QVERIFY(client); | 4444 | QVERIFY(client); | ||
4445 | QVERIFY(client->isActive()); | 4445 | QVERIFY(client->isActive()); | ||
4446 | QCOMPARE(client->opacity(), 1.0); | 4446 | QCOMPARE(client->opacity(), 1.0); | ||
4447 | 4447 | | |||
Show All 23 Lines | 4464 | { | |||
4471 | group.writeEntry("wmclass", "org.kde.foo"); | 4471 | group.writeEntry("wmclass", "org.kde.foo"); | ||
4472 | group.writeEntry("wmclasscomplete", false); | 4472 | group.writeEntry("wmclasscomplete", false); | ||
4473 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4473 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4474 | group.sync(); | 4474 | group.sync(); | ||
4475 | RuleBook::self()->setConfig(config); | 4475 | RuleBook::self()->setConfig(config); | ||
4476 | workspace()->slotReconfigure(); | 4476 | workspace()->slotReconfigure(); | ||
4477 | 4477 | | |||
4478 | // Create the test client. | 4478 | // Create the test client. | ||
4479 | QFETCH(Test::ShellSurfaceType, type); | 4479 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4480 | ShellClient *client; | 4480 | ShellClient *client; | ||
4481 | Surface *surface; | 4481 | Surface *surface; | ||
4482 | XdgShellSurface *shellSurface; | 4482 | XdgShellSurface *shellSurface; | ||
4483 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4483 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4484 | QVERIFY(client); | 4484 | QVERIFY(client); | ||
4485 | QVERIFY(client->isActive()); | 4485 | QVERIFY(client->isActive()); | ||
4486 | QCOMPARE(client->opacity(), 1.0); | 4486 | QCOMPARE(client->opacity(), 1.0); | ||
4487 | 4487 | | |||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |