Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/xdgshellclient_rules_test.cpp
Show All 15 Lines | |||||
16 | GNU General Public License for more details. | 16 | GNU General Public License for more details. | ||
17 | 17 | | |||
18 | You should have received a copy of the GNU General Public License | 18 | You should have received a copy of the GNU General Public License | ||
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
20 | *********************************************************************/ | 20 | *********************************************************************/ | ||
21 | 21 | | |||
22 | #include "kwin_wayland_test.h" | 22 | #include "kwin_wayland_test.h" | ||
23 | 23 | | |||
24 | #include "abstract_client.h" | ||||
24 | #include "cursor.h" | 25 | #include "cursor.h" | ||
25 | #include "platform.h" | 26 | #include "platform.h" | ||
26 | #include "rules.h" | 27 | #include "rules.h" | ||
27 | #include "screens.h" | 28 | #include "screens.h" | ||
28 | #include "xdgshellclient.h" | | |||
29 | #include "virtualdesktops.h" | 29 | #include "virtualdesktops.h" | ||
30 | #include "wayland_server.h" | 30 | #include "wayland_server.h" | ||
31 | #include "workspace.h" | 31 | #include "workspace.h" | ||
32 | 32 | | |||
33 | #include <KWayland/Client/surface.h> | 33 | #include <KWayland/Client/surface.h> | ||
34 | #include <KWayland/Client/xdgshell.h> | 34 | #include <KWayland/Client/xdgshell.h> | ||
35 | 35 | | |||
36 | #include <linux/input.h> | 36 | #include <linux/input.h> | ||
▲ Show 20 Lines • Show All 182 Lines • ▼ Show 20 Line(s) | 47 | private Q_SLOTS: | |||
219 | void testInactiveOpacityForceTemporarily_data(); | 219 | void testInactiveOpacityForceTemporarily_data(); | ||
220 | void testInactiveOpacityForceTemporarily(); | 220 | void testInactiveOpacityForceTemporarily(); | ||
221 | 221 | | |||
222 | void testMatchAfterNameChange(); | 222 | void testMatchAfterNameChange(); | ||
223 | }; | 223 | }; | ||
224 | 224 | | |||
225 | void TestXdgShellClientRules::initTestCase() | 225 | void TestXdgShellClientRules::initTestCase() | ||
226 | { | 226 | { | ||
227 | qRegisterMetaType<KWin::XdgShellClient *>(); | | |||
228 | qRegisterMetaType<KWin::AbstractClient *>(); | 227 | qRegisterMetaType<KWin::AbstractClient *>(); | ||
229 | 228 | | |||
230 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 229 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
231 | QVERIFY(workspaceCreatedSpy.isValid()); | 230 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
232 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 231 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
233 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 232 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
234 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | 233 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | ||
235 | 234 | | |||
Show All 29 Lines | |||||
265 | #define TEST_DATA(name) \ | 264 | #define TEST_DATA(name) \ | ||
266 | void TestXdgShellClientRules::name##_data() \ | 265 | void TestXdgShellClientRules::name##_data() \ | ||
267 | { \ | 266 | { \ | ||
268 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); \ | 267 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); \ | ||
269 | QTest::newRow("XdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6; \ | 268 | QTest::newRow("XdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6; \ | ||
270 | QTest::newRow("XdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; \ | 269 | QTest::newRow("XdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; \ | ||
271 | } | 270 | } | ||
272 | 271 | | |||
273 | std::tuple<XdgShellClient *, Surface *, XdgShellSurface *> createWindow(Test::XdgShellSurfaceType type, const QByteArray &appId) | 272 | std::tuple<AbstractClient *, Surface *, XdgShellSurface *> createWindow(Test::XdgShellSurfaceType type, const QByteArray &appId) | ||
274 | { | 273 | { | ||
275 | // Create an xdg surface. | 274 | // Create an xdg surface. | ||
276 | Surface *surface = Test::createSurface(); | 275 | Surface *surface = Test::createSurface(); | ||
277 | XdgShellSurface *shellSurface = Test::createXdgShellSurface(type, surface, surface, Test::CreationSetup::CreateOnly); | 276 | XdgShellSurface *shellSurface = Test::createXdgShellSurface(type, surface, surface, Test::CreationSetup::CreateOnly); | ||
278 | 277 | | |||
279 | // Assign the desired app id. | 278 | // Assign the desired app id. | ||
280 | shellSurface->setAppId(appId); | 279 | shellSurface->setAppId(appId); | ||
281 | 280 | | |||
282 | // Wait for the initial configure event. | 281 | // Wait for the initial configure event. | ||
283 | QSignalSpy configureRequestedSpy(shellSurface, &XdgShellSurface::configureRequested); | 282 | QSignalSpy configureRequestedSpy(shellSurface, &XdgShellSurface::configureRequested); | ||
284 | surface->commit(Surface::CommitFlag::None); | 283 | surface->commit(Surface::CommitFlag::None); | ||
285 | configureRequestedSpy.wait(); | 284 | configureRequestedSpy.wait(); | ||
286 | 285 | | |||
287 | // Draw content of the surface. | 286 | // Draw content of the surface. | ||
288 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | 287 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | ||
289 | XdgShellClient *client = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | 288 | AbstractClient *client = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | ||
290 | 289 | | |||
291 | return {client, surface, shellSurface}; | 290 | return {client, surface, shellSurface}; | ||
292 | } | 291 | } | ||
293 | 292 | | |||
294 | TEST_DATA(testPositionDontAffect) | 293 | TEST_DATA(testPositionDontAffect) | ||
295 | 294 | | |||
296 | void TestXdgShellClientRules::testPositionDontAffect() | 295 | void TestXdgShellClientRules::testPositionDontAffect() | ||
297 | { | 296 | { | ||
298 | // Initialize RuleBook with the test rule. | 297 | // Initialize RuleBook with the test rule. | ||
299 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 298 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
300 | config->group("General").writeEntry("count", 1); | 299 | config->group("General").writeEntry("count", 1); | ||
301 | KConfigGroup group = config->group("1"); | 300 | KConfigGroup group = config->group("1"); | ||
302 | group.writeEntry("position", QPoint(42, 42)); | 301 | group.writeEntry("position", QPoint(42, 42)); | ||
303 | group.writeEntry("positionrule", int(Rules::DontAffect)); | 302 | group.writeEntry("positionrule", int(Rules::DontAffect)); | ||
304 | group.writeEntry("wmclass", "org.kde.foo"); | 303 | group.writeEntry("wmclass", "org.kde.foo"); | ||
305 | group.writeEntry("wmclasscomplete", false); | 304 | group.writeEntry("wmclasscomplete", false); | ||
306 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 305 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
307 | group.sync(); | 306 | group.sync(); | ||
308 | RuleBook::self()->setConfig(config); | 307 | RuleBook::self()->setConfig(config); | ||
309 | workspace()->slotReconfigure(); | 308 | workspace()->slotReconfigure(); | ||
310 | 309 | | |||
311 | // Create the test client. | 310 | // Create the test client. | ||
312 | QFETCH(Test::XdgShellSurfaceType, type); | 311 | QFETCH(Test::XdgShellSurfaceType, type); | ||
313 | XdgShellClient *client; | 312 | AbstractClient *client; | ||
314 | Surface *surface; | 313 | Surface *surface; | ||
315 | XdgShellSurface *shellSurface; | 314 | XdgShellSurface *shellSurface; | ||
316 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 315 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
317 | QVERIFY(client); | 316 | QVERIFY(client); | ||
318 | QVERIFY(client->isActive()); | 317 | QVERIFY(client->isActive()); | ||
319 | 318 | | |||
320 | // The position of the client should not be affected by the rule. The default | 319 | // The position of the client should not be affected by the rule. The default | ||
321 | // placement policy will put the client in the top-left corner of the screen. | 320 | // placement policy will put the client in the top-left corner of the screen. | ||
Show All 21 Lines | 334 | { | |||
343 | group.writeEntry("wmclasscomplete", false); | 342 | group.writeEntry("wmclasscomplete", false); | ||
344 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 343 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
345 | group.sync(); | 344 | group.sync(); | ||
346 | RuleBook::self()->setConfig(config); | 345 | RuleBook::self()->setConfig(config); | ||
347 | workspace()->slotReconfigure(); | 346 | workspace()->slotReconfigure(); | ||
348 | 347 | | |||
349 | // Create the test client. | 348 | // Create the test client. | ||
350 | QFETCH(Test::XdgShellSurfaceType, type); | 349 | QFETCH(Test::XdgShellSurfaceType, type); | ||
351 | XdgShellClient *client; | 350 | AbstractClient *client; | ||
352 | Surface *surface; | 351 | Surface *surface; | ||
353 | XdgShellSurface *shellSurface; | 352 | XdgShellSurface *shellSurface; | ||
354 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 353 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
355 | QVERIFY(client); | 354 | QVERIFY(client); | ||
356 | QVERIFY(client->isActive()); | 355 | QVERIFY(client->isActive()); | ||
357 | 356 | | |||
358 | // The client should be moved to the position specified by the rule. | 357 | // The client should be moved to the position specified by the rule. | ||
359 | QVERIFY(client->isMovable()); | 358 | QVERIFY(client->isMovable()); | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 413 | { | |||
422 | group.writeEntry("wmclasscomplete", false); | 421 | group.writeEntry("wmclasscomplete", false); | ||
423 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 422 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
424 | group.sync(); | 423 | group.sync(); | ||
425 | RuleBook::self()->setConfig(config); | 424 | RuleBook::self()->setConfig(config); | ||
426 | workspace()->slotReconfigure(); | 425 | workspace()->slotReconfigure(); | ||
427 | 426 | | |||
428 | // Create the test client. | 427 | // Create the test client. | ||
429 | QFETCH(Test::XdgShellSurfaceType, type); | 428 | QFETCH(Test::XdgShellSurfaceType, type); | ||
430 | XdgShellClient *client; | 429 | AbstractClient *client; | ||
431 | Surface *surface; | 430 | Surface *surface; | ||
432 | XdgShellSurface *shellSurface; | 431 | XdgShellSurface *shellSurface; | ||
433 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 432 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
434 | QVERIFY(client); | 433 | QVERIFY(client); | ||
435 | QVERIFY(client->isActive()); | 434 | QVERIFY(client->isActive()); | ||
436 | 435 | | |||
437 | // The client should be moved to the position specified by the rule. | 436 | // The client should be moved to the position specified by the rule. | ||
438 | QVERIFY(client->isMovable()); | 437 | QVERIFY(client->isMovable()); | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 492 | { | |||
501 | group.writeEntry("wmclasscomplete", false); | 500 | group.writeEntry("wmclasscomplete", false); | ||
502 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 501 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
503 | group.sync(); | 502 | group.sync(); | ||
504 | RuleBook::self()->setConfig(config); | 503 | RuleBook::self()->setConfig(config); | ||
505 | workspace()->slotReconfigure(); | 504 | workspace()->slotReconfigure(); | ||
506 | 505 | | |||
507 | // Create the test client. | 506 | // Create the test client. | ||
508 | QFETCH(Test::XdgShellSurfaceType, type); | 507 | QFETCH(Test::XdgShellSurfaceType, type); | ||
509 | XdgShellClient *client; | 508 | AbstractClient *client; | ||
510 | Surface *surface; | 509 | Surface *surface; | ||
511 | XdgShellSurface *shellSurface; | 510 | XdgShellSurface *shellSurface; | ||
512 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 511 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
513 | QVERIFY(client); | 512 | QVERIFY(client); | ||
514 | QVERIFY(client->isActive()); | 513 | QVERIFY(client->isActive()); | ||
515 | 514 | | |||
516 | // The client should be moved to the position specified by the rule. | 515 | // The client should be moved to the position specified by the rule. | ||
517 | QVERIFY(!client->isMovable()); | 516 | QVERIFY(!client->isMovable()); | ||
Show All 30 Lines | |||||
548 | } | 547 | } | ||
549 | 548 | | |||
550 | TEST_DATA(testPositionApplyNow) | 549 | TEST_DATA(testPositionApplyNow) | ||
551 | 550 | | |||
552 | void TestXdgShellClientRules::testPositionApplyNow() | 551 | void TestXdgShellClientRules::testPositionApplyNow() | ||
553 | { | 552 | { | ||
554 | // Create the test client. | 553 | // Create the test client. | ||
555 | QFETCH(Test::XdgShellSurfaceType, type); | 554 | QFETCH(Test::XdgShellSurfaceType, type); | ||
556 | XdgShellClient *client; | 555 | AbstractClient *client; | ||
557 | Surface *surface; | 556 | Surface *surface; | ||
558 | QObject *shellSurface; | 557 | QObject *shellSurface; | ||
559 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 558 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
560 | QVERIFY(client); | 559 | QVERIFY(client); | ||
561 | QVERIFY(client->isActive()); | 560 | QVERIFY(client->isActive()); | ||
562 | 561 | | |||
563 | // The position of the client isn't set by any rule, thus the default placement | 562 | // The position of the client isn't set by any rule, thus the default placement | ||
564 | // policy will try to put the client in the top-left corner of the screen. | 563 | // policy will try to put the client in the top-left corner of the screen. | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 633 | { | |||
642 | group.writeEntry("wmclasscomplete", false); | 641 | group.writeEntry("wmclasscomplete", false); | ||
643 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 642 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
644 | group.sync(); | 643 | group.sync(); | ||
645 | RuleBook::self()->setConfig(config); | 644 | RuleBook::self()->setConfig(config); | ||
646 | workspace()->slotReconfigure(); | 645 | workspace()->slotReconfigure(); | ||
647 | 646 | | |||
648 | // Create the test client. | 647 | // Create the test client. | ||
649 | QFETCH(Test::XdgShellSurfaceType, type); | 648 | QFETCH(Test::XdgShellSurfaceType, type); | ||
650 | XdgShellClient *client; | 649 | AbstractClient *client; | ||
651 | Surface *surface; | 650 | Surface *surface; | ||
652 | XdgShellSurface *shellSurface; | 651 | XdgShellSurface *shellSurface; | ||
653 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 652 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
654 | QVERIFY(client); | 653 | QVERIFY(client); | ||
655 | QVERIFY(client->isActive()); | 654 | QVERIFY(client->isActive()); | ||
656 | 655 | | |||
657 | // The client should be moved to the position specified by the rule. | 656 | // The client should be moved to the position specified by the rule. | ||
658 | QVERIFY(!client->isMovable()); | 657 | QVERIFY(!client->isMovable()); | ||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 693 | { | |||
718 | 717 | | |||
719 | // The window size shouldn't be enforced by the rule. | 718 | // The window size shouldn't be enforced by the rule. | ||
720 | QVERIFY(configureRequestedSpy->wait()); | 719 | QVERIFY(configureRequestedSpy->wait()); | ||
721 | QCOMPARE(configureRequestedSpy->count(), 1); | 720 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
722 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(0, 0)); | 721 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(0, 0)); | ||
723 | 722 | | |||
724 | // Map the client. | 723 | // Map the client. | ||
725 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 724 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
726 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 725 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
727 | QVERIFY(client); | 726 | QVERIFY(client); | ||
728 | QVERIFY(client->isActive()); | 727 | QVERIFY(client->isActive()); | ||
729 | QVERIFY(client->isResizable()); | 728 | QVERIFY(client->isResizable()); | ||
730 | QCOMPARE(client->size(), QSize(100, 50)); | 729 | QCOMPARE(client->size(), QSize(100, 50)); | ||
731 | 730 | | |||
732 | // We should receive a configure event when the client becomes active. | 731 | // We should receive a configure event when the client becomes active. | ||
733 | QVERIFY(configureRequestedSpy->wait()); | 732 | QVERIFY(configureRequestedSpy->wait()); | ||
734 | QCOMPARE(configureRequestedSpy->count(), 2); | 733 | QCOMPARE(configureRequestedSpy->count(), 2); | ||
Show All 38 Lines | 744 | { | |||
773 | QCOMPARE(configureRequestedSpy->count(), 1); | 772 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
774 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(480, 640)); | 773 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(480, 640)); | ||
775 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 774 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
776 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | 775 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | ||
777 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | 776 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | ||
778 | 777 | | |||
779 | // Map the client. | 778 | // Map the client. | ||
780 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 779 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
781 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); | 780 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); | ||
782 | QVERIFY(client); | 781 | QVERIFY(client); | ||
783 | QVERIFY(client->isActive()); | 782 | QVERIFY(client->isActive()); | ||
784 | QVERIFY(client->isResizable()); | 783 | QVERIFY(client->isResizable()); | ||
785 | QCOMPARE(client->size(), QSize(480, 640)); | 784 | QCOMPARE(client->size(), QSize(480, 640)); | ||
786 | 785 | | |||
787 | // We should receive a configure event when the client becomes active. | 786 | // We should receive a configure event when the client becomes active. | ||
788 | QVERIFY(configureRequestedSpy->wait()); | 787 | QVERIFY(configureRequestedSpy->wait()); | ||
789 | QCOMPARE(configureRequestedSpy->count(), 2); | 788 | QCOMPARE(configureRequestedSpy->count(), 2); | ||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Line(s) | 882 | { | |||
911 | QCOMPARE(configureRequestedSpy->count(), 1); | 910 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
912 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(480, 640)); | 911 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(480, 640)); | ||
913 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 912 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
914 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | 913 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | ||
915 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | 914 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | ||
916 | 915 | | |||
917 | // Map the client. | 916 | // Map the client. | ||
918 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 917 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
919 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); | 918 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); | ||
920 | QVERIFY(client); | 919 | QVERIFY(client); | ||
921 | QVERIFY(client->isActive()); | 920 | QVERIFY(client->isActive()); | ||
922 | QVERIFY(client->isResizable()); | 921 | QVERIFY(client->isResizable()); | ||
923 | QCOMPARE(client->size(), QSize(480, 640)); | 922 | QCOMPARE(client->size(), QSize(480, 640)); | ||
924 | 923 | | |||
925 | // We should receive a configure event when the client becomes active. | 924 | // We should receive a configure event when the client becomes active. | ||
926 | QVERIFY(configureRequestedSpy->wait()); | 925 | QVERIFY(configureRequestedSpy->wait()); | ||
927 | QCOMPARE(configureRequestedSpy->count(), 2); | 926 | QCOMPARE(configureRequestedSpy->count(), 2); | ||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Line(s) | 1020 | { | |||
1045 | 1044 | | |||
1046 | // The initial configure event should contain size hint set by the rule. | 1045 | // The initial configure event should contain size hint set by the rule. | ||
1047 | QVERIFY(configureRequestedSpy->wait()); | 1046 | QVERIFY(configureRequestedSpy->wait()); | ||
1048 | QCOMPARE(configureRequestedSpy->count(), 1); | 1047 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
1049 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(480, 640)); | 1048 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(480, 640)); | ||
1050 | 1049 | | |||
1051 | // Map the client. | 1050 | // Map the client. | ||
1052 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1051 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1053 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); | 1052 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); | ||
1054 | QVERIFY(client); | 1053 | QVERIFY(client); | ||
1055 | QVERIFY(client->isActive()); | 1054 | QVERIFY(client->isActive()); | ||
1056 | QVERIFY(!client->isResizable()); | 1055 | QVERIFY(!client->isResizable()); | ||
1057 | QCOMPARE(client->size(), QSize(480, 640)); | 1056 | QCOMPARE(client->size(), QSize(480, 640)); | ||
1058 | 1057 | | |||
1059 | // We should receive a configure event when the client becomes active. | 1058 | // We should receive a configure event when the client becomes active. | ||
1060 | QVERIFY(configureRequestedSpy->wait()); | 1059 | QVERIFY(configureRequestedSpy->wait()); | ||
1061 | QCOMPARE(configureRequestedSpy->count(), 2); | 1060 | QCOMPARE(configureRequestedSpy->count(), 2); | ||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 1108 | { | |||
1120 | 1119 | | |||
1121 | // The expected surface dimensions should be set by the rule. | 1120 | // The expected surface dimensions should be set by the rule. | ||
1122 | QVERIFY(configureRequestedSpy->wait()); | 1121 | QVERIFY(configureRequestedSpy->wait()); | ||
1123 | QCOMPARE(configureRequestedSpy->count(), 1); | 1122 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
1124 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(0, 0)); | 1123 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(0, 0)); | ||
1125 | 1124 | | |||
1126 | // Map the client. | 1125 | // Map the client. | ||
1127 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1126 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1128 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1127 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1129 | QVERIFY(client); | 1128 | QVERIFY(client); | ||
1130 | QVERIFY(client->isActive()); | 1129 | QVERIFY(client->isActive()); | ||
1131 | QVERIFY(client->isResizable()); | 1130 | QVERIFY(client->isResizable()); | ||
1132 | QCOMPARE(client->size(), QSize(100, 50)); | 1131 | QCOMPARE(client->size(), QSize(100, 50)); | ||
1133 | 1132 | | |||
1134 | // We should receive a configure event when the client becomes active. | 1133 | // We should receive a configure event when the client becomes active. | ||
1135 | QVERIFY(configureRequestedSpy->wait()); | 1134 | QVERIFY(configureRequestedSpy->wait()); | ||
1136 | QCOMPARE(configureRequestedSpy->count(), 2); | 1135 | QCOMPARE(configureRequestedSpy->count(), 2); | ||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 1177 | { | |||
1202 | 1201 | | |||
1203 | // The initial configure event should contain size hint set by the rule. | 1202 | // The initial configure event should contain size hint set by the rule. | ||
1204 | QVERIFY(configureRequestedSpy->wait()); | 1203 | QVERIFY(configureRequestedSpy->wait()); | ||
1205 | QCOMPARE(configureRequestedSpy->count(), 1); | 1204 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
1206 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(480, 640)); | 1205 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(480, 640)); | ||
1207 | 1206 | | |||
1208 | // Map the client. | 1207 | // Map the client. | ||
1209 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1208 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1210 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); | 1209 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); | ||
1211 | QVERIFY(client); | 1210 | QVERIFY(client); | ||
1212 | QVERIFY(client->isActive()); | 1211 | QVERIFY(client->isActive()); | ||
1213 | QVERIFY(!client->isResizable()); | 1212 | QVERIFY(!client->isResizable()); | ||
1214 | QCOMPARE(client->size(), QSize(480, 640)); | 1213 | QCOMPARE(client->size(), QSize(480, 640)); | ||
1215 | 1214 | | |||
1216 | // We should receive a configure event when the client becomes active. | 1215 | // We should receive a configure event when the client becomes active. | ||
1217 | QVERIFY(configureRequestedSpy->wait()); | 1216 | QVERIFY(configureRequestedSpy->wait()); | ||
1218 | QCOMPARE(configureRequestedSpy->count(), 2); | 1217 | QCOMPARE(configureRequestedSpy->count(), 2); | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 1265 | { | |||
1296 | QCOMPARE(configureRequestedSpy->count(), 1); | 1295 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
1297 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | 1296 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | ||
1298 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1297 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1299 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | 1298 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | ||
1300 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | 1299 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | ||
1301 | 1300 | | |||
1302 | // Map the client. | 1301 | // Map the client. | ||
1303 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1302 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1304 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1303 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1305 | QVERIFY(client); | 1304 | QVERIFY(client); | ||
1306 | QVERIFY(client->isActive()); | 1305 | QVERIFY(client->isActive()); | ||
1307 | QVERIFY(client->isMaximizable()); | 1306 | QVERIFY(client->isMaximizable()); | ||
1308 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | 1307 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | ||
1309 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | 1308 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | ||
1310 | QCOMPARE(client->size(), QSize(100, 50)); | 1309 | QCOMPARE(client->size(), QSize(100, 50)); | ||
1311 | 1310 | | |||
1312 | // We should receive a configure event when the client becomes active. | 1311 | // We should receive a configure event when the client becomes active. | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 1327 | { | |||
1358 | QCOMPARE(configureRequestedSpy->count(), 1); | 1357 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
1359 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024)); | 1358 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024)); | ||
1360 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1359 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1361 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | 1360 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | ||
1362 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | 1361 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | ||
1363 | 1362 | | |||
1364 | // Map the client. | 1363 | // Map the client. | ||
1365 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1364 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1366 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); | 1365 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); | ||
1367 | QVERIFY(client); | 1366 | QVERIFY(client); | ||
1368 | QVERIFY(client->isActive()); | 1367 | QVERIFY(client->isActive()); | ||
1369 | QVERIFY(client->isMaximizable()); | 1368 | QVERIFY(client->isMaximizable()); | ||
1370 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | 1369 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | ||
1371 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | 1370 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | ||
1372 | QCOMPARE(client->size(), QSize(1280, 1024)); | 1371 | QCOMPARE(client->size(), QSize(1280, 1024)); | ||
1373 | 1372 | | |||
1374 | // We should receive a configure event when the client becomes active. | 1373 | // We should receive a configure event when the client becomes active. | ||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 1439 | { | |||
1470 | QCOMPARE(configureRequestedSpy->count(), 1); | 1469 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
1471 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024)); | 1470 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024)); | ||
1472 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1471 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1473 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | 1472 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | ||
1474 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | 1473 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | ||
1475 | 1474 | | |||
1476 | // Map the client. | 1475 | // Map the client. | ||
1477 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1476 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1478 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); | 1477 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); | ||
1479 | QVERIFY(client); | 1478 | QVERIFY(client); | ||
1480 | QVERIFY(client->isActive()); | 1479 | QVERIFY(client->isActive()); | ||
1481 | QVERIFY(client->isMaximizable()); | 1480 | QVERIFY(client->isMaximizable()); | ||
1482 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | 1481 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | ||
1483 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | 1482 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | ||
1484 | QCOMPARE(client->size(), QSize(1280, 1024)); | 1483 | QCOMPARE(client->size(), QSize(1280, 1024)); | ||
1485 | 1484 | | |||
1486 | // We should receive a configure event when the client becomes active. | 1485 | // We should receive a configure event when the client becomes active. | ||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 1551 | { | |||
1582 | QCOMPARE(configureRequestedSpy->count(), 1); | 1581 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
1583 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024)); | 1582 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024)); | ||
1584 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1583 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1585 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | 1584 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | ||
1586 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | 1585 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | ||
1587 | 1586 | | |||
1588 | // Map the client. | 1587 | // Map the client. | ||
1589 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1588 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1590 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); | 1589 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); | ||
1591 | QVERIFY(client); | 1590 | QVERIFY(client); | ||
1592 | QVERIFY(client->isActive()); | 1591 | QVERIFY(client->isActive()); | ||
1593 | QVERIFY(!client->isMaximizable()); | 1592 | QVERIFY(!client->isMaximizable()); | ||
1594 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | 1593 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | ||
1595 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | 1594 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | ||
1596 | QCOMPARE(client->size(), QSize(1280, 1024)); | 1595 | QCOMPARE(client->size(), QSize(1280, 1024)); | ||
1597 | 1596 | | |||
1598 | // We should receive a configure event when the client becomes active. | 1597 | // We should receive a configure event when the client becomes active. | ||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 1653 | { | |||
1669 | QCOMPARE(configureRequestedSpy->count(), 1); | 1668 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
1670 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | 1669 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | ||
1671 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1670 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1672 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | 1671 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | ||
1673 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | 1672 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | ||
1674 | 1673 | | |||
1675 | // Map the client. | 1674 | // Map the client. | ||
1676 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1675 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1677 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1676 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1678 | QVERIFY(client); | 1677 | QVERIFY(client); | ||
1679 | QVERIFY(client->isActive()); | 1678 | QVERIFY(client->isActive()); | ||
1680 | QVERIFY(client->isMaximizable()); | 1679 | QVERIFY(client->isMaximizable()); | ||
1681 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | 1680 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | ||
1682 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | 1681 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | ||
1683 | QCOMPARE(client->size(), QSize(100, 50)); | 1682 | QCOMPARE(client->size(), QSize(100, 50)); | ||
1684 | 1683 | | |||
1685 | // We should receive a configure event when the client becomes active. | 1684 | // We should receive a configure event when the client becomes active. | ||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | 1760 | { | |||
1791 | QCOMPARE(configureRequestedSpy->count(), 1); | 1790 | QCOMPARE(configureRequestedSpy->count(), 1); | ||
1792 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024)); | 1791 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024)); | ||
1793 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1792 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1794 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | 1793 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | ||
1795 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | 1794 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | ||
1796 | 1795 | | |||
1797 | // Map the client. | 1796 | // Map the client. | ||
1798 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1797 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1799 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); | 1798 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); | ||
1800 | QVERIFY(client); | 1799 | QVERIFY(client); | ||
1801 | QVERIFY(client->isActive()); | 1800 | QVERIFY(client->isActive()); | ||
1802 | QVERIFY(!client->isMaximizable()); | 1801 | QVERIFY(!client->isMaximizable()); | ||
1803 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | 1802 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | ||
1804 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | 1803 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | ||
1805 | QCOMPARE(client->size(), QSize(1280, 1024)); | 1804 | QCOMPARE(client->size(), QSize(1280, 1024)); | ||
1806 | 1805 | | |||
1807 | // We should receive a configure event when the client becomes active. | 1806 | // We should receive a configure event when the client becomes active. | ||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 1862 | { | |||
1877 | // We need at least two virtual desktop for this test. | 1876 | // We need at least two virtual desktop for this test. | ||
1878 | VirtualDesktopManager::self()->setCount(2); | 1877 | VirtualDesktopManager::self()->setCount(2); | ||
1879 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 1878 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
1880 | VirtualDesktopManager::self()->setCurrent(1); | 1879 | VirtualDesktopManager::self()->setCurrent(1); | ||
1881 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 1880 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
1882 | 1881 | | |||
1883 | // Create the test client. | 1882 | // Create the test client. | ||
1884 | QFETCH(Test::XdgShellSurfaceType, type); | 1883 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1885 | XdgShellClient *client; | 1884 | AbstractClient *client; | ||
1886 | Surface *surface; | 1885 | Surface *surface; | ||
1887 | XdgShellSurface *shellSurface; | 1886 | XdgShellSurface *shellSurface; | ||
1888 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 1887 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
1889 | QVERIFY(client); | 1888 | QVERIFY(client); | ||
1890 | 1889 | | |||
1891 | // The client should appear on the current virtual desktop. | 1890 | // The client should appear on the current virtual desktop. | ||
1892 | QCOMPARE(client->desktop(), 1); | 1891 | QCOMPARE(client->desktop(), 1); | ||
1893 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 1892 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
Show All 24 Lines | 1903 | { | |||
1918 | // We need at least two virtual desktop for this test. | 1917 | // We need at least two virtual desktop for this test. | ||
1919 | VirtualDesktopManager::self()->setCount(2); | 1918 | VirtualDesktopManager::self()->setCount(2); | ||
1920 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 1919 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
1921 | VirtualDesktopManager::self()->setCurrent(1); | 1920 | VirtualDesktopManager::self()->setCurrent(1); | ||
1922 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 1921 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
1923 | 1922 | | |||
1924 | // Create the test client. | 1923 | // Create the test client. | ||
1925 | QFETCH(Test::XdgShellSurfaceType, type); | 1924 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1926 | XdgShellClient *client; | 1925 | AbstractClient *client; | ||
1927 | Surface *surface; | 1926 | Surface *surface; | ||
1928 | XdgShellSurface *shellSurface; | 1927 | XdgShellSurface *shellSurface; | ||
1929 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 1928 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
1930 | QVERIFY(client); | 1929 | QVERIFY(client); | ||
1931 | 1930 | | |||
1932 | // The client should appear on the second virtual desktop. | 1931 | // The client should appear on the second virtual desktop. | ||
1933 | QCOMPARE(client->desktop(), 2); | 1932 | QCOMPARE(client->desktop(), 2); | ||
1934 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | 1933 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | ||
Show All 40 Lines | 1960 | { | |||
1975 | // We need at least two virtual desktop for this test. | 1974 | // We need at least two virtual desktop for this test. | ||
1976 | VirtualDesktopManager::self()->setCount(2); | 1975 | VirtualDesktopManager::self()->setCount(2); | ||
1977 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 1976 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
1978 | VirtualDesktopManager::self()->setCurrent(1); | 1977 | VirtualDesktopManager::self()->setCurrent(1); | ||
1979 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 1978 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
1980 | 1979 | | |||
1981 | // Create the test client. | 1980 | // Create the test client. | ||
1982 | QFETCH(Test::XdgShellSurfaceType, type); | 1981 | QFETCH(Test::XdgShellSurfaceType, type); | ||
1983 | XdgShellClient *client; | 1982 | AbstractClient *client; | ||
1984 | Surface *surface; | 1983 | Surface *surface; | ||
1985 | XdgShellSurface *shellSurface; | 1984 | XdgShellSurface *shellSurface; | ||
1986 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 1985 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
1987 | QVERIFY(client); | 1986 | QVERIFY(client); | ||
1988 | QCOMPARE(client->desktop(), 2); | 1987 | QCOMPARE(client->desktop(), 2); | ||
1989 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | 1988 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | ||
1990 | 1989 | | |||
1991 | // Move the client to the first virtual desktop. | 1990 | // Move the client to the first virtual desktop. | ||
Show All 36 Lines | 2013 | { | |||
2028 | // We need at least two virtual desktop for this test. | 2027 | // We need at least two virtual desktop for this test. | ||
2029 | VirtualDesktopManager::self()->setCount(2); | 2028 | VirtualDesktopManager::self()->setCount(2); | ||
2030 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 2029 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
2031 | VirtualDesktopManager::self()->setCurrent(1); | 2030 | VirtualDesktopManager::self()->setCurrent(1); | ||
2032 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2031 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2033 | 2032 | | |||
2034 | // Create the test client. | 2033 | // Create the test client. | ||
2035 | QFETCH(Test::XdgShellSurfaceType, type); | 2034 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2036 | XdgShellClient *client; | 2035 | AbstractClient *client; | ||
2037 | Surface *surface; | 2036 | Surface *surface; | ||
2038 | XdgShellSurface *shellSurface; | 2037 | XdgShellSurface *shellSurface; | ||
2039 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2038 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2040 | QVERIFY(client); | 2039 | QVERIFY(client); | ||
2041 | 2040 | | |||
2042 | // The client should appear on the second virtual desktop. | 2041 | // The client should appear on the second virtual desktop. | ||
2043 | QCOMPARE(client->desktop(), 2); | 2042 | QCOMPARE(client->desktop(), 2); | ||
2044 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | 2043 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | ||
Show All 27 Lines | 2070 | { | |||
2072 | // We need at least two virtual desktop for this test. | 2071 | // We need at least two virtual desktop for this test. | ||
2073 | VirtualDesktopManager::self()->setCount(2); | 2072 | VirtualDesktopManager::self()->setCount(2); | ||
2074 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 2073 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
2075 | VirtualDesktopManager::self()->setCurrent(1); | 2074 | VirtualDesktopManager::self()->setCurrent(1); | ||
2076 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2075 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2077 | 2076 | | |||
2078 | // Create the test client. | 2077 | // Create the test client. | ||
2079 | QFETCH(Test::XdgShellSurfaceType, type); | 2078 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2080 | XdgShellClient *client; | 2079 | AbstractClient *client; | ||
2081 | Surface *surface; | 2080 | Surface *surface; | ||
2082 | XdgShellSurface *shellSurface; | 2081 | XdgShellSurface *shellSurface; | ||
2083 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2082 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2084 | QVERIFY(client); | 2083 | QVERIFY(client); | ||
2085 | QCOMPARE(client->desktop(), 1); | 2084 | QCOMPARE(client->desktop(), 1); | ||
2086 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2085 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2087 | 2086 | | |||
2088 | // Initialize RuleBook with the test rule. | 2087 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 2123 | { | |||
2138 | // We need at least two virtual desktop for this test. | 2137 | // We need at least two virtual desktop for this test. | ||
2139 | VirtualDesktopManager::self()->setCount(2); | 2138 | VirtualDesktopManager::self()->setCount(2); | ||
2140 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | 2139 | QCOMPARE(VirtualDesktopManager::self()->count(), 2u); | ||
2141 | VirtualDesktopManager::self()->setCurrent(1); | 2140 | VirtualDesktopManager::self()->setCurrent(1); | ||
2142 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2141 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2143 | 2142 | | |||
2144 | // Create the test client. | 2143 | // Create the test client. | ||
2145 | QFETCH(Test::XdgShellSurfaceType, type); | 2144 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2146 | XdgShellClient *client; | 2145 | AbstractClient *client; | ||
2147 | Surface *surface; | 2146 | Surface *surface; | ||
2148 | XdgShellSurface *shellSurface; | 2147 | XdgShellSurface *shellSurface; | ||
2149 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2148 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2150 | QVERIFY(client); | 2149 | QVERIFY(client); | ||
2151 | 2150 | | |||
2152 | // The client should appear on the second virtual desktop. | 2151 | // The client should appear on the second virtual desktop. | ||
2153 | QCOMPARE(client->desktop(), 2); | 2152 | QCOMPARE(client->desktop(), 2); | ||
2154 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | 2153 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 2188 | { | |||
2197 | group.writeEntry("wmclasscomplete", false); | 2196 | group.writeEntry("wmclasscomplete", false); | ||
2198 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2197 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2199 | group.sync(); | 2198 | group.sync(); | ||
2200 | RuleBook::self()->setConfig(config); | 2199 | RuleBook::self()->setConfig(config); | ||
2201 | workspace()->slotReconfigure(); | 2200 | workspace()->slotReconfigure(); | ||
2202 | 2201 | | |||
2203 | // Create the test client. | 2202 | // Create the test client. | ||
2204 | QFETCH(Test::XdgShellSurfaceType, type); | 2203 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2205 | XdgShellClient *client; | 2204 | AbstractClient *client; | ||
2206 | Surface *surface; | 2205 | Surface *surface; | ||
2207 | XdgShellSurface *shellSurface; | 2206 | XdgShellSurface *shellSurface; | ||
2208 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2207 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2209 | QVERIFY(client); | 2208 | QVERIFY(client); | ||
2210 | QVERIFY(client->isMinimizable()); | 2209 | QVERIFY(client->isMinimizable()); | ||
2211 | 2210 | | |||
2212 | // The client should not be minimized. | 2211 | // The client should not be minimized. | ||
2213 | QVERIFY(!client->isMinimized()); | 2212 | QVERIFY(!client->isMinimized()); | ||
Show All 18 Lines | 2223 | { | |||
2232 | group.writeEntry("wmclasscomplete", false); | 2231 | group.writeEntry("wmclasscomplete", false); | ||
2233 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2232 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2234 | group.sync(); | 2233 | group.sync(); | ||
2235 | RuleBook::self()->setConfig(config); | 2234 | RuleBook::self()->setConfig(config); | ||
2236 | workspace()->slotReconfigure(); | 2235 | workspace()->slotReconfigure(); | ||
2237 | 2236 | | |||
2238 | // Create the test client. | 2237 | // Create the test client. | ||
2239 | QFETCH(Test::XdgShellSurfaceType, type); | 2238 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2240 | XdgShellClient *client; | 2239 | AbstractClient *client; | ||
2241 | Surface *surface; | 2240 | Surface *surface; | ||
2242 | XdgShellSurface *shellSurface; | 2241 | XdgShellSurface *shellSurface; | ||
2243 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2242 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2244 | QVERIFY(client); | 2243 | QVERIFY(client); | ||
2245 | QVERIFY(client->isMinimizable()); | 2244 | QVERIFY(client->isMinimizable()); | ||
2246 | 2245 | | |||
2247 | // The client should be minimized. | 2246 | // The client should be minimized. | ||
2248 | QVERIFY(client->isMinimized()); | 2247 | QVERIFY(client->isMinimized()); | ||
Show All 31 Lines | 2271 | { | |||
2280 | group.writeEntry("wmclasscomplete", false); | 2279 | group.writeEntry("wmclasscomplete", false); | ||
2281 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2280 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2282 | group.sync(); | 2281 | group.sync(); | ||
2283 | RuleBook::self()->setConfig(config); | 2282 | RuleBook::self()->setConfig(config); | ||
2284 | workspace()->slotReconfigure(); | 2283 | workspace()->slotReconfigure(); | ||
2285 | 2284 | | |||
2286 | // Create the test client. | 2285 | // Create the test client. | ||
2287 | QFETCH(Test::XdgShellSurfaceType, type); | 2286 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2288 | XdgShellClient *client; | 2287 | AbstractClient *client; | ||
2289 | Surface *surface; | 2288 | Surface *surface; | ||
2290 | XdgShellSurface *shellSurface; | 2289 | XdgShellSurface *shellSurface; | ||
2291 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2290 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2292 | QVERIFY(client); | 2291 | QVERIFY(client); | ||
2293 | QVERIFY(client->isMinimizable()); | 2292 | QVERIFY(client->isMinimizable()); | ||
2294 | QVERIFY(!client->isMinimized()); | 2293 | QVERIFY(!client->isMinimized()); | ||
2295 | 2294 | | |||
2296 | // Minimize the client. | 2295 | // Minimize the client. | ||
Show All 29 Lines | 2317 | { | |||
2326 | group.writeEntry("wmclasscomplete", false); | 2325 | group.writeEntry("wmclasscomplete", false); | ||
2327 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2326 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2328 | group.sync(); | 2327 | group.sync(); | ||
2329 | RuleBook::self()->setConfig(config); | 2328 | RuleBook::self()->setConfig(config); | ||
2330 | workspace()->slotReconfigure(); | 2329 | workspace()->slotReconfigure(); | ||
2331 | 2330 | | |||
2332 | // Create the test client. | 2331 | // Create the test client. | ||
2333 | QFETCH(Test::XdgShellSurfaceType, type); | 2332 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2334 | XdgShellClient *client; | 2333 | AbstractClient *client; | ||
2335 | Surface *surface; | 2334 | Surface *surface; | ||
2336 | XdgShellSurface *shellSurface; | 2335 | XdgShellSurface *shellSurface; | ||
2337 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2336 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2338 | QVERIFY(client); | 2337 | QVERIFY(client); | ||
2339 | QVERIFY(!client->isMinimizable()); | 2338 | QVERIFY(!client->isMinimizable()); | ||
2340 | QVERIFY(!client->isMinimized()); | 2339 | QVERIFY(!client->isMinimized()); | ||
2341 | 2340 | | |||
2342 | // Any attempt to minimize the client should fail. | 2341 | // Any attempt to minimize the client should fail. | ||
Show All 18 Lines | |||||
2361 | } | 2360 | } | ||
2362 | 2361 | | |||
2363 | TEST_DATA(testMinimizeApplyNow) | 2362 | TEST_DATA(testMinimizeApplyNow) | ||
2364 | 2363 | | |||
2365 | void TestXdgShellClientRules::testMinimizeApplyNow() | 2364 | void TestXdgShellClientRules::testMinimizeApplyNow() | ||
2366 | { | 2365 | { | ||
2367 | // Create the test client. | 2366 | // Create the test client. | ||
2368 | QFETCH(Test::XdgShellSurfaceType, type); | 2367 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2369 | XdgShellClient *client; | 2368 | AbstractClient *client; | ||
2370 | Surface *surface; | 2369 | Surface *surface; | ||
2371 | XdgShellSurface *shellSurface; | 2370 | XdgShellSurface *shellSurface; | ||
2372 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2371 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2373 | QVERIFY(client); | 2372 | QVERIFY(client); | ||
2374 | QVERIFY(client->isMinimizable()); | 2373 | QVERIFY(client->isMinimizable()); | ||
2375 | QVERIFY(!client->isMinimized()); | 2374 | QVERIFY(!client->isMinimized()); | ||
2376 | 2375 | | |||
2377 | // Initialize RuleBook with the test rule. | 2376 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 2411 | { | |||
2420 | group.writeEntry("wmclasscomplete", false); | 2419 | group.writeEntry("wmclasscomplete", false); | ||
2421 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2420 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2422 | group.sync(); | 2421 | group.sync(); | ||
2423 | RuleBook::self()->setConfig(config); | 2422 | RuleBook::self()->setConfig(config); | ||
2424 | workspace()->slotReconfigure(); | 2423 | workspace()->slotReconfigure(); | ||
2425 | 2424 | | |||
2426 | // Create the test client. | 2425 | // Create the test client. | ||
2427 | QFETCH(Test::XdgShellSurfaceType, type); | 2426 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2428 | XdgShellClient *client; | 2427 | AbstractClient *client; | ||
2429 | Surface *surface; | 2428 | Surface *surface; | ||
2430 | XdgShellSurface *shellSurface; | 2429 | XdgShellSurface *shellSurface; | ||
2431 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2430 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2432 | QVERIFY(client); | 2431 | QVERIFY(client); | ||
2433 | QVERIFY(!client->isMinimizable()); | 2432 | QVERIFY(!client->isMinimizable()); | ||
2434 | QVERIFY(!client->isMinimized()); | 2433 | QVERIFY(!client->isMinimized()); | ||
2435 | 2434 | | |||
2436 | // Any attempt to minimize the client should fail until the client is closed. | 2435 | // Any attempt to minimize the client should fail until the client is closed. | ||
Show All 31 Lines | 2459 | { | |||
2468 | group.writeEntry("wmclasscomplete", false); | 2467 | group.writeEntry("wmclasscomplete", false); | ||
2469 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2468 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2470 | group.sync(); | 2469 | group.sync(); | ||
2471 | RuleBook::self()->setConfig(config); | 2470 | RuleBook::self()->setConfig(config); | ||
2472 | workspace()->slotReconfigure(); | 2471 | workspace()->slotReconfigure(); | ||
2473 | 2472 | | |||
2474 | // Create the test client. | 2473 | // Create the test client. | ||
2475 | QFETCH(Test::XdgShellSurfaceType, type); | 2474 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2476 | XdgShellClient *client; | 2475 | AbstractClient *client; | ||
2477 | Surface *surface; | 2476 | Surface *surface; | ||
2478 | XdgShellSurface *shellSurface; | 2477 | XdgShellSurface *shellSurface; | ||
2479 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2478 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2480 | QVERIFY(client); | 2479 | QVERIFY(client); | ||
2481 | 2480 | | |||
2482 | // The client should not be affected by the rule. | 2481 | // The client should not be affected by the rule. | ||
2483 | QVERIFY(!client->skipTaskbar()); | 2482 | QVERIFY(!client->skipTaskbar()); | ||
2484 | 2483 | | |||
Show All 17 Lines | 2493 | { | |||
2502 | group.writeEntry("wmclasscomplete", false); | 2501 | group.writeEntry("wmclasscomplete", false); | ||
2503 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2502 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2504 | group.sync(); | 2503 | group.sync(); | ||
2505 | RuleBook::self()->setConfig(config); | 2504 | RuleBook::self()->setConfig(config); | ||
2506 | workspace()->slotReconfigure(); | 2505 | workspace()->slotReconfigure(); | ||
2507 | 2506 | | |||
2508 | // Create the test client. | 2507 | // Create the test client. | ||
2509 | QFETCH(Test::XdgShellSurfaceType, type); | 2508 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2510 | XdgShellClient *client; | 2509 | AbstractClient *client; | ||
2511 | Surface *surface; | 2510 | Surface *surface; | ||
2512 | XdgShellSurface *shellSurface; | 2511 | XdgShellSurface *shellSurface; | ||
2513 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2512 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2514 | QVERIFY(client); | 2513 | QVERIFY(client); | ||
2515 | 2514 | | |||
2516 | // The client should not be included on a taskbar. | 2515 | // The client should not be included on a taskbar. | ||
2517 | QVERIFY(client->skipTaskbar()); | 2516 | QVERIFY(client->skipTaskbar()); | ||
2518 | 2517 | | |||
Show All 29 Lines | 2539 | { | |||
2548 | group.writeEntry("wmclasscomplete", false); | 2547 | group.writeEntry("wmclasscomplete", false); | ||
2549 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2548 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2550 | group.sync(); | 2549 | group.sync(); | ||
2551 | RuleBook::self()->setConfig(config); | 2550 | RuleBook::self()->setConfig(config); | ||
2552 | workspace()->slotReconfigure(); | 2551 | workspace()->slotReconfigure(); | ||
2553 | 2552 | | |||
2554 | // Create the test client. | 2553 | // Create the test client. | ||
2555 | QFETCH(Test::XdgShellSurfaceType, type); | 2554 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2556 | XdgShellClient *client; | 2555 | AbstractClient *client; | ||
2557 | Surface *surface; | 2556 | Surface *surface; | ||
2558 | XdgShellSurface *shellSurface; | 2557 | XdgShellSurface *shellSurface; | ||
2559 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2558 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2560 | QVERIFY(client); | 2559 | QVERIFY(client); | ||
2561 | 2560 | | |||
2562 | // The client should not be included on a taskbar. | 2561 | // The client should not be included on a taskbar. | ||
2563 | QVERIFY(client->skipTaskbar()); | 2562 | QVERIFY(client->skipTaskbar()); | ||
2564 | 2563 | | |||
Show All 31 Lines | 2587 | { | |||
2596 | group.writeEntry("wmclasscomplete", false); | 2595 | group.writeEntry("wmclasscomplete", false); | ||
2597 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2596 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2598 | group.sync(); | 2597 | group.sync(); | ||
2599 | RuleBook::self()->setConfig(config); | 2598 | RuleBook::self()->setConfig(config); | ||
2600 | workspace()->slotReconfigure(); | 2599 | workspace()->slotReconfigure(); | ||
2601 | 2600 | | |||
2602 | // Create the test client. | 2601 | // Create the test client. | ||
2603 | QFETCH(Test::XdgShellSurfaceType, type); | 2602 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2604 | XdgShellClient *client; | 2603 | AbstractClient *client; | ||
2605 | Surface *surface; | 2604 | Surface *surface; | ||
2606 | XdgShellSurface *shellSurface; | 2605 | XdgShellSurface *shellSurface; | ||
2607 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2606 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2608 | QVERIFY(client); | 2607 | QVERIFY(client); | ||
2609 | 2608 | | |||
2610 | // The client should not be included on a taskbar. | 2609 | // The client should not be included on a taskbar. | ||
2611 | QVERIFY(client->skipTaskbar()); | 2610 | QVERIFY(client->skipTaskbar()); | ||
2612 | 2611 | | |||
Show All 18 Lines | |||||
2631 | } | 2630 | } | ||
2632 | 2631 | | |||
2633 | TEST_DATA(testSkipTaskbarApplyNow) | 2632 | TEST_DATA(testSkipTaskbarApplyNow) | ||
2634 | 2633 | | |||
2635 | void TestXdgShellClientRules::testSkipTaskbarApplyNow() | 2634 | void TestXdgShellClientRules::testSkipTaskbarApplyNow() | ||
2636 | { | 2635 | { | ||
2637 | // Create the test client. | 2636 | // Create the test client. | ||
2638 | QFETCH(Test::XdgShellSurfaceType, type); | 2637 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2639 | XdgShellClient *client; | 2638 | AbstractClient *client; | ||
2640 | Surface *surface; | 2639 | Surface *surface; | ||
2641 | XdgShellSurface *shellSurface; | 2640 | XdgShellSurface *shellSurface; | ||
2642 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2641 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2643 | QVERIFY(client); | 2642 | QVERIFY(client); | ||
2644 | QVERIFY(!client->skipTaskbar()); | 2643 | QVERIFY(!client->skipTaskbar()); | ||
2645 | 2644 | | |||
2646 | // Initialize RuleBook with the test rule. | 2645 | // Initialize RuleBook with the test rule. | ||
2647 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 2646 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
Show All 39 Lines | 2678 | { | |||
2687 | group.writeEntry("wmclasscomplete", false); | 2686 | group.writeEntry("wmclasscomplete", false); | ||
2688 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2687 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2689 | group.sync(); | 2688 | group.sync(); | ||
2690 | RuleBook::self()->setConfig(config); | 2689 | RuleBook::self()->setConfig(config); | ||
2691 | workspace()->slotReconfigure(); | 2690 | workspace()->slotReconfigure(); | ||
2692 | 2691 | | |||
2693 | // Create the test client. | 2692 | // Create the test client. | ||
2694 | QFETCH(Test::XdgShellSurfaceType, type); | 2693 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2695 | XdgShellClient *client; | 2694 | AbstractClient *client; | ||
2696 | Surface *surface; | 2695 | Surface *surface; | ||
2697 | XdgShellSurface *shellSurface; | 2696 | XdgShellSurface *shellSurface; | ||
2698 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2697 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2699 | QVERIFY(client); | 2698 | QVERIFY(client); | ||
2700 | 2699 | | |||
2701 | // The client should not be included on a taskbar. | 2700 | // The client should not be included on a taskbar. | ||
2702 | QVERIFY(client->skipTaskbar()); | 2701 | QVERIFY(client->skipTaskbar()); | ||
2703 | 2702 | | |||
Show All 33 Lines | 2728 | { | |||
2737 | group.writeEntry("wmclasscomplete", false); | 2736 | group.writeEntry("wmclasscomplete", false); | ||
2738 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2737 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2739 | group.sync(); | 2738 | group.sync(); | ||
2740 | RuleBook::self()->setConfig(config); | 2739 | RuleBook::self()->setConfig(config); | ||
2741 | workspace()->slotReconfigure(); | 2740 | workspace()->slotReconfigure(); | ||
2742 | 2741 | | |||
2743 | // Create the test client. | 2742 | // Create the test client. | ||
2744 | QFETCH(Test::XdgShellSurfaceType, type); | 2743 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2745 | XdgShellClient *client; | 2744 | AbstractClient *client; | ||
2746 | Surface *surface; | 2745 | Surface *surface; | ||
2747 | XdgShellSurface *shellSurface; | 2746 | XdgShellSurface *shellSurface; | ||
2748 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2747 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2749 | QVERIFY(client); | 2748 | QVERIFY(client); | ||
2750 | 2749 | | |||
2751 | // The client should not be affected by the rule. | 2750 | // The client should not be affected by the rule. | ||
2752 | QVERIFY(!client->skipPager()); | 2751 | QVERIFY(!client->skipPager()); | ||
2753 | 2752 | | |||
Show All 17 Lines | 2762 | { | |||
2771 | group.writeEntry("wmclasscomplete", false); | 2770 | group.writeEntry("wmclasscomplete", false); | ||
2772 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2771 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2773 | group.sync(); | 2772 | group.sync(); | ||
2774 | RuleBook::self()->setConfig(config); | 2773 | RuleBook::self()->setConfig(config); | ||
2775 | workspace()->slotReconfigure(); | 2774 | workspace()->slotReconfigure(); | ||
2776 | 2775 | | |||
2777 | // Create the test client. | 2776 | // Create the test client. | ||
2778 | QFETCH(Test::XdgShellSurfaceType, type); | 2777 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2779 | XdgShellClient *client; | 2778 | AbstractClient *client; | ||
2780 | Surface *surface; | 2779 | Surface *surface; | ||
2781 | XdgShellSurface *shellSurface; | 2780 | XdgShellSurface *shellSurface; | ||
2782 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2781 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2783 | QVERIFY(client); | 2782 | QVERIFY(client); | ||
2784 | 2783 | | |||
2785 | // The client should not be included on a pager. | 2784 | // The client should not be included on a pager. | ||
2786 | QVERIFY(client->skipPager()); | 2785 | QVERIFY(client->skipPager()); | ||
2787 | 2786 | | |||
Show All 29 Lines | 2808 | { | |||
2817 | group.writeEntry("wmclasscomplete", false); | 2816 | group.writeEntry("wmclasscomplete", false); | ||
2818 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2817 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2819 | group.sync(); | 2818 | group.sync(); | ||
2820 | RuleBook::self()->setConfig(config); | 2819 | RuleBook::self()->setConfig(config); | ||
2821 | workspace()->slotReconfigure(); | 2820 | workspace()->slotReconfigure(); | ||
2822 | 2821 | | |||
2823 | // Create the test client. | 2822 | // Create the test client. | ||
2824 | QFETCH(Test::XdgShellSurfaceType, type); | 2823 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2825 | XdgShellClient *client; | 2824 | AbstractClient *client; | ||
2826 | Surface *surface; | 2825 | Surface *surface; | ||
2827 | XdgShellSurface *shellSurface; | 2826 | XdgShellSurface *shellSurface; | ||
2828 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2827 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2829 | QVERIFY(client); | 2828 | QVERIFY(client); | ||
2830 | 2829 | | |||
2831 | // The client should not be included on a pager. | 2830 | // The client should not be included on a pager. | ||
2832 | QVERIFY(client->skipPager()); | 2831 | QVERIFY(client->skipPager()); | ||
2833 | 2832 | | |||
Show All 31 Lines | 2856 | { | |||
2865 | group.writeEntry("wmclasscomplete", false); | 2864 | group.writeEntry("wmclasscomplete", false); | ||
2866 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2865 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2867 | group.sync(); | 2866 | group.sync(); | ||
2868 | RuleBook::self()->setConfig(config); | 2867 | RuleBook::self()->setConfig(config); | ||
2869 | workspace()->slotReconfigure(); | 2868 | workspace()->slotReconfigure(); | ||
2870 | 2869 | | |||
2871 | // Create the test client. | 2870 | // Create the test client. | ||
2872 | QFETCH(Test::XdgShellSurfaceType, type); | 2871 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2873 | XdgShellClient *client; | 2872 | AbstractClient *client; | ||
2874 | Surface *surface; | 2873 | Surface *surface; | ||
2875 | XdgShellSurface *shellSurface; | 2874 | XdgShellSurface *shellSurface; | ||
2876 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2875 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2877 | QVERIFY(client); | 2876 | QVERIFY(client); | ||
2878 | 2877 | | |||
2879 | // The client should not be included on a pager. | 2878 | // The client should not be included on a pager. | ||
2880 | QVERIFY(client->skipPager()); | 2879 | QVERIFY(client->skipPager()); | ||
2881 | 2880 | | |||
Show All 18 Lines | |||||
2900 | } | 2899 | } | ||
2901 | 2900 | | |||
2902 | TEST_DATA(testSkipPagerApplyNow) | 2901 | TEST_DATA(testSkipPagerApplyNow) | ||
2903 | 2902 | | |||
2904 | void TestXdgShellClientRules::testSkipPagerApplyNow() | 2903 | void TestXdgShellClientRules::testSkipPagerApplyNow() | ||
2905 | { | 2904 | { | ||
2906 | // Create the test client. | 2905 | // Create the test client. | ||
2907 | QFETCH(Test::XdgShellSurfaceType, type); | 2906 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2908 | XdgShellClient *client; | 2907 | AbstractClient *client; | ||
2909 | Surface *surface; | 2908 | Surface *surface; | ||
2910 | XdgShellSurface *shellSurface; | 2909 | XdgShellSurface *shellSurface; | ||
2911 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2910 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2912 | QVERIFY(client); | 2911 | QVERIFY(client); | ||
2913 | QVERIFY(!client->skipPager()); | 2912 | QVERIFY(!client->skipPager()); | ||
2914 | 2913 | | |||
2915 | // Initialize RuleBook with the test rule. | 2914 | // Initialize RuleBook with the test rule. | ||
2916 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 2915 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
Show All 39 Lines | 2947 | { | |||
2956 | group.writeEntry("wmclasscomplete", false); | 2955 | group.writeEntry("wmclasscomplete", false); | ||
2957 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 2956 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
2958 | group.sync(); | 2957 | group.sync(); | ||
2959 | RuleBook::self()->setConfig(config); | 2958 | RuleBook::self()->setConfig(config); | ||
2960 | workspace()->slotReconfigure(); | 2959 | workspace()->slotReconfigure(); | ||
2961 | 2960 | | |||
2962 | // Create the test client. | 2961 | // Create the test client. | ||
2963 | QFETCH(Test::XdgShellSurfaceType, type); | 2962 | QFETCH(Test::XdgShellSurfaceType, type); | ||
2964 | XdgShellClient *client; | 2963 | AbstractClient *client; | ||
2965 | Surface *surface; | 2964 | Surface *surface; | ||
2966 | XdgShellSurface *shellSurface; | 2965 | XdgShellSurface *shellSurface; | ||
2967 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2966 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2968 | QVERIFY(client); | 2967 | QVERIFY(client); | ||
2969 | 2968 | | |||
2970 | // The client should not be included on a pager. | 2969 | // The client should not be included on a pager. | ||
2971 | QVERIFY(client->skipPager()); | 2970 | QVERIFY(client->skipPager()); | ||
2972 | 2971 | | |||
Show All 33 Lines | 2997 | { | |||
3006 | group.writeEntry("wmclasscomplete", false); | 3005 | group.writeEntry("wmclasscomplete", false); | ||
3007 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3006 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3008 | group.sync(); | 3007 | group.sync(); | ||
3009 | RuleBook::self()->setConfig(config); | 3008 | RuleBook::self()->setConfig(config); | ||
3010 | workspace()->slotReconfigure(); | 3009 | workspace()->slotReconfigure(); | ||
3011 | 3010 | | |||
3012 | // Create the test client. | 3011 | // Create the test client. | ||
3013 | QFETCH(Test::XdgShellSurfaceType, type); | 3012 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3014 | XdgShellClient *client; | 3013 | AbstractClient *client; | ||
3015 | Surface *surface; | 3014 | Surface *surface; | ||
3016 | XdgShellSurface *shellSurface; | 3015 | XdgShellSurface *shellSurface; | ||
3017 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3016 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3018 | QVERIFY(client); | 3017 | QVERIFY(client); | ||
3019 | 3018 | | |||
3020 | // The client should not be affected by the rule. | 3019 | // The client should not be affected by the rule. | ||
3021 | QVERIFY(!client->skipSwitcher()); | 3020 | QVERIFY(!client->skipSwitcher()); | ||
3022 | 3021 | | |||
Show All 17 Lines | 3031 | { | |||
3040 | group.writeEntry("wmclasscomplete", false); | 3039 | group.writeEntry("wmclasscomplete", false); | ||
3041 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3040 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3042 | group.sync(); | 3041 | group.sync(); | ||
3043 | RuleBook::self()->setConfig(config); | 3042 | RuleBook::self()->setConfig(config); | ||
3044 | workspace()->slotReconfigure(); | 3043 | workspace()->slotReconfigure(); | ||
3045 | 3044 | | |||
3046 | // Create the test client. | 3045 | // Create the test client. | ||
3047 | QFETCH(Test::XdgShellSurfaceType, type); | 3046 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3048 | XdgShellClient *client; | 3047 | AbstractClient *client; | ||
3049 | Surface *surface; | 3048 | Surface *surface; | ||
3050 | XdgShellSurface *shellSurface; | 3049 | XdgShellSurface *shellSurface; | ||
3051 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3050 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3052 | QVERIFY(client); | 3051 | QVERIFY(client); | ||
3053 | 3052 | | |||
3054 | // The client should be excluded from window switching effects. | 3053 | // The client should be excluded from window switching effects. | ||
3055 | QVERIFY(client->skipSwitcher()); | 3054 | QVERIFY(client->skipSwitcher()); | ||
3056 | 3055 | | |||
Show All 29 Lines | 3077 | { | |||
3086 | group.writeEntry("wmclasscomplete", false); | 3085 | group.writeEntry("wmclasscomplete", false); | ||
3087 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3086 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3088 | group.sync(); | 3087 | group.sync(); | ||
3089 | RuleBook::self()->setConfig(config); | 3088 | RuleBook::self()->setConfig(config); | ||
3090 | workspace()->slotReconfigure(); | 3089 | workspace()->slotReconfigure(); | ||
3091 | 3090 | | |||
3092 | // Create the test client. | 3091 | // Create the test client. | ||
3093 | QFETCH(Test::XdgShellSurfaceType, type); | 3092 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3094 | XdgShellClient *client; | 3093 | AbstractClient *client; | ||
3095 | Surface *surface; | 3094 | Surface *surface; | ||
3096 | XdgShellSurface *shellSurface; | 3095 | XdgShellSurface *shellSurface; | ||
3097 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3096 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3098 | QVERIFY(client); | 3097 | QVERIFY(client); | ||
3099 | 3098 | | |||
3100 | // The client should be excluded from window switching effects. | 3099 | // The client should be excluded from window switching effects. | ||
3101 | QVERIFY(client->skipSwitcher()); | 3100 | QVERIFY(client->skipSwitcher()); | ||
3102 | 3101 | | |||
Show All 31 Lines | 3125 | { | |||
3134 | group.writeEntry("wmclasscomplete", false); | 3133 | group.writeEntry("wmclasscomplete", false); | ||
3135 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3134 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3136 | group.sync(); | 3135 | group.sync(); | ||
3137 | RuleBook::self()->setConfig(config); | 3136 | RuleBook::self()->setConfig(config); | ||
3138 | workspace()->slotReconfigure(); | 3137 | workspace()->slotReconfigure(); | ||
3139 | 3138 | | |||
3140 | // Create the test client. | 3139 | // Create the test client. | ||
3141 | QFETCH(Test::XdgShellSurfaceType, type); | 3140 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3142 | XdgShellClient *client; | 3141 | AbstractClient *client; | ||
3143 | Surface *surface; | 3142 | Surface *surface; | ||
3144 | XdgShellSurface *shellSurface; | 3143 | XdgShellSurface *shellSurface; | ||
3145 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3144 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3146 | QVERIFY(client); | 3145 | QVERIFY(client); | ||
3147 | 3146 | | |||
3148 | // The client should be excluded from window switching effects. | 3147 | // The client should be excluded from window switching effects. | ||
3149 | QVERIFY(client->skipSwitcher()); | 3148 | QVERIFY(client->skipSwitcher()); | ||
3150 | 3149 | | |||
Show All 18 Lines | |||||
3169 | } | 3168 | } | ||
3170 | 3169 | | |||
3171 | TEST_DATA(testSkipSwitcherApplyNow) | 3170 | TEST_DATA(testSkipSwitcherApplyNow) | ||
3172 | 3171 | | |||
3173 | void TestXdgShellClientRules::testSkipSwitcherApplyNow() | 3172 | void TestXdgShellClientRules::testSkipSwitcherApplyNow() | ||
3174 | { | 3173 | { | ||
3175 | // Create the test client. | 3174 | // Create the test client. | ||
3176 | QFETCH(Test::XdgShellSurfaceType, type); | 3175 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3177 | XdgShellClient *client; | 3176 | AbstractClient *client; | ||
3178 | Surface *surface; | 3177 | Surface *surface; | ||
3179 | XdgShellSurface *shellSurface; | 3178 | XdgShellSurface *shellSurface; | ||
3180 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3179 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3181 | QVERIFY(client); | 3180 | QVERIFY(client); | ||
3182 | QVERIFY(!client->skipSwitcher()); | 3181 | QVERIFY(!client->skipSwitcher()); | ||
3183 | 3182 | | |||
3184 | // Initialize RuleBook with the test rule. | 3183 | // Initialize RuleBook with the test rule. | ||
3185 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 3184 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
Show All 39 Lines | 3216 | { | |||
3225 | group.writeEntry("wmclasscomplete", false); | 3224 | group.writeEntry("wmclasscomplete", false); | ||
3226 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3225 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3227 | group.sync(); | 3226 | group.sync(); | ||
3228 | RuleBook::self()->setConfig(config); | 3227 | RuleBook::self()->setConfig(config); | ||
3229 | workspace()->slotReconfigure(); | 3228 | workspace()->slotReconfigure(); | ||
3230 | 3229 | | |||
3231 | // Create the test client. | 3230 | // Create the test client. | ||
3232 | QFETCH(Test::XdgShellSurfaceType, type); | 3231 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3233 | XdgShellClient *client; | 3232 | AbstractClient *client; | ||
3234 | Surface *surface; | 3233 | Surface *surface; | ||
3235 | XdgShellSurface *shellSurface; | 3234 | XdgShellSurface *shellSurface; | ||
3236 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3235 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3237 | QVERIFY(client); | 3236 | QVERIFY(client); | ||
3238 | 3237 | | |||
3239 | // The client should be excluded from window switching effects. | 3238 | // The client should be excluded from window switching effects. | ||
3240 | QVERIFY(client->skipSwitcher()); | 3239 | QVERIFY(client->skipSwitcher()); | ||
3241 | 3240 | | |||
Show All 33 Lines | 3266 | { | |||
3275 | group.writeEntry("wmclasscomplete", false); | 3274 | group.writeEntry("wmclasscomplete", false); | ||
3276 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3275 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3277 | group.sync(); | 3276 | group.sync(); | ||
3278 | RuleBook::self()->setConfig(config); | 3277 | RuleBook::self()->setConfig(config); | ||
3279 | workspace()->slotReconfigure(); | 3278 | workspace()->slotReconfigure(); | ||
3280 | 3279 | | |||
3281 | // Create the test client. | 3280 | // Create the test client. | ||
3282 | QFETCH(Test::XdgShellSurfaceType, type); | 3281 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3283 | XdgShellClient *client; | 3282 | AbstractClient *client; | ||
3284 | Surface *surface; | 3283 | Surface *surface; | ||
3285 | XdgShellSurface *shellSurface; | 3284 | XdgShellSurface *shellSurface; | ||
3286 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3285 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3287 | QVERIFY(client); | 3286 | QVERIFY(client); | ||
3288 | 3287 | | |||
3289 | // The keep-above state of the client should not be affected by the rule. | 3288 | // The keep-above state of the client should not be affected by the rule. | ||
3290 | QVERIFY(!client->keepAbove()); | 3289 | QVERIFY(!client->keepAbove()); | ||
3291 | 3290 | | |||
Show All 17 Lines | 3300 | { | |||
3309 | group.writeEntry("wmclasscomplete", false); | 3308 | group.writeEntry("wmclasscomplete", false); | ||
3310 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3309 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3311 | group.sync(); | 3310 | group.sync(); | ||
3312 | RuleBook::self()->setConfig(config); | 3311 | RuleBook::self()->setConfig(config); | ||
3313 | workspace()->slotReconfigure(); | 3312 | workspace()->slotReconfigure(); | ||
3314 | 3313 | | |||
3315 | // Create the test client. | 3314 | // Create the test client. | ||
3316 | QFETCH(Test::XdgShellSurfaceType, type); | 3315 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3317 | XdgShellClient *client; | 3316 | AbstractClient *client; | ||
3318 | Surface *surface; | 3317 | Surface *surface; | ||
3319 | XdgShellSurface *shellSurface; | 3318 | XdgShellSurface *shellSurface; | ||
3320 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3319 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3321 | QVERIFY(client); | 3320 | QVERIFY(client); | ||
3322 | 3321 | | |||
3323 | // Initially, the client should be kept above. | 3322 | // Initially, the client should be kept above. | ||
3324 | QVERIFY(client->keepAbove()); | 3323 | QVERIFY(client->keepAbove()); | ||
3325 | 3324 | | |||
Show All 29 Lines | 3346 | { | |||
3355 | group.writeEntry("wmclasscomplete", false); | 3354 | group.writeEntry("wmclasscomplete", false); | ||
3356 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3355 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3357 | group.sync(); | 3356 | group.sync(); | ||
3358 | RuleBook::self()->setConfig(config); | 3357 | RuleBook::self()->setConfig(config); | ||
3359 | workspace()->slotReconfigure(); | 3358 | workspace()->slotReconfigure(); | ||
3360 | 3359 | | |||
3361 | // Create the test client. | 3360 | // Create the test client. | ||
3362 | QFETCH(Test::XdgShellSurfaceType, type); | 3361 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3363 | XdgShellClient *client; | 3362 | AbstractClient *client; | ||
3364 | Surface *surface; | 3363 | Surface *surface; | ||
3365 | XdgShellSurface *shellSurface; | 3364 | XdgShellSurface *shellSurface; | ||
3366 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3365 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3367 | QVERIFY(client); | 3366 | QVERIFY(client); | ||
3368 | 3367 | | |||
3369 | // Initially, the client should be kept above. | 3368 | // Initially, the client should be kept above. | ||
3370 | QVERIFY(client->keepAbove()); | 3369 | QVERIFY(client->keepAbove()); | ||
3371 | 3370 | | |||
Show All 29 Lines | 3392 | { | |||
3401 | group.writeEntry("wmclasscomplete", false); | 3400 | group.writeEntry("wmclasscomplete", false); | ||
3402 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3401 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3403 | group.sync(); | 3402 | group.sync(); | ||
3404 | RuleBook::self()->setConfig(config); | 3403 | RuleBook::self()->setConfig(config); | ||
3405 | workspace()->slotReconfigure(); | 3404 | workspace()->slotReconfigure(); | ||
3406 | 3405 | | |||
3407 | // Create the test client. | 3406 | // Create the test client. | ||
3408 | QFETCH(Test::XdgShellSurfaceType, type); | 3407 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3409 | XdgShellClient *client; | 3408 | AbstractClient *client; | ||
3410 | Surface *surface; | 3409 | Surface *surface; | ||
3411 | XdgShellSurface *shellSurface; | 3410 | XdgShellSurface *shellSurface; | ||
3412 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3411 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3413 | QVERIFY(client); | 3412 | QVERIFY(client); | ||
3414 | 3413 | | |||
3415 | // Initially, the client should be kept above. | 3414 | // Initially, the client should be kept above. | ||
3416 | QVERIFY(client->keepAbove()); | 3415 | QVERIFY(client->keepAbove()); | ||
3417 | 3416 | | |||
Show All 16 Lines | |||||
3434 | } | 3433 | } | ||
3435 | 3434 | | |||
3436 | TEST_DATA(testKeepAboveApplyNow) | 3435 | TEST_DATA(testKeepAboveApplyNow) | ||
3437 | 3436 | | |||
3438 | void TestXdgShellClientRules::testKeepAboveApplyNow() | 3437 | void TestXdgShellClientRules::testKeepAboveApplyNow() | ||
3439 | { | 3438 | { | ||
3440 | // Create the test client. | 3439 | // Create the test client. | ||
3441 | QFETCH(Test::XdgShellSurfaceType, type); | 3440 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3442 | XdgShellClient *client; | 3441 | AbstractClient *client; | ||
3443 | Surface *surface; | 3442 | Surface *surface; | ||
3444 | XdgShellSurface *shellSurface; | 3443 | XdgShellSurface *shellSurface; | ||
3445 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3444 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3446 | QVERIFY(client); | 3445 | QVERIFY(client); | ||
3447 | QVERIFY(!client->keepAbove()); | 3446 | QVERIFY(!client->keepAbove()); | ||
3448 | 3447 | | |||
3449 | // Initialize RuleBook with the test rule. | 3448 | // Initialize RuleBook with the test rule. | ||
3450 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 3449 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
Show All 39 Lines | 3481 | { | |||
3490 | group.writeEntry("wmclasscomplete", false); | 3489 | group.writeEntry("wmclasscomplete", false); | ||
3491 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3490 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3492 | group.sync(); | 3491 | group.sync(); | ||
3493 | RuleBook::self()->setConfig(config); | 3492 | RuleBook::self()->setConfig(config); | ||
3494 | workspace()->slotReconfigure(); | 3493 | workspace()->slotReconfigure(); | ||
3495 | 3494 | | |||
3496 | // Create the test client. | 3495 | // Create the test client. | ||
3497 | QFETCH(Test::XdgShellSurfaceType, type); | 3496 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3498 | XdgShellClient *client; | 3497 | AbstractClient *client; | ||
3499 | Surface *surface; | 3498 | Surface *surface; | ||
3500 | XdgShellSurface *shellSurface; | 3499 | XdgShellSurface *shellSurface; | ||
3501 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3500 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3502 | QVERIFY(client); | 3501 | QVERIFY(client); | ||
3503 | 3502 | | |||
3504 | // Initially, the client should be kept above. | 3503 | // Initially, the client should be kept above. | ||
3505 | QVERIFY(client->keepAbove()); | 3504 | QVERIFY(client->keepAbove()); | ||
3506 | 3505 | | |||
Show All 35 Lines | 3533 | { | |||
3542 | group.writeEntry("wmclasscomplete", false); | 3541 | group.writeEntry("wmclasscomplete", false); | ||
3543 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3542 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3544 | group.sync(); | 3543 | group.sync(); | ||
3545 | RuleBook::self()->setConfig(config); | 3544 | RuleBook::self()->setConfig(config); | ||
3546 | workspace()->slotReconfigure(); | 3545 | workspace()->slotReconfigure(); | ||
3547 | 3546 | | |||
3548 | // Create the test client. | 3547 | // Create the test client. | ||
3549 | QFETCH(Test::XdgShellSurfaceType, type); | 3548 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3550 | XdgShellClient *client; | 3549 | AbstractClient *client; | ||
3551 | Surface *surface; | 3550 | Surface *surface; | ||
3552 | XdgShellSurface *shellSurface; | 3551 | XdgShellSurface *shellSurface; | ||
3553 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3552 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3554 | QVERIFY(client); | 3553 | QVERIFY(client); | ||
3555 | 3554 | | |||
3556 | // The keep-below state of the client should not be affected by the rule. | 3555 | // The keep-below state of the client should not be affected by the rule. | ||
3557 | QVERIFY(!client->keepBelow()); | 3556 | QVERIFY(!client->keepBelow()); | ||
3558 | 3557 | | |||
Show All 17 Lines | 3567 | { | |||
3576 | group.writeEntry("wmclasscomplete", false); | 3575 | group.writeEntry("wmclasscomplete", false); | ||
3577 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3576 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3578 | group.sync(); | 3577 | group.sync(); | ||
3579 | RuleBook::self()->setConfig(config); | 3578 | RuleBook::self()->setConfig(config); | ||
3580 | workspace()->slotReconfigure(); | 3579 | workspace()->slotReconfigure(); | ||
3581 | 3580 | | |||
3582 | // Create the test client. | 3581 | // Create the test client. | ||
3583 | QFETCH(Test::XdgShellSurfaceType, type); | 3582 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3584 | XdgShellClient *client; | 3583 | AbstractClient *client; | ||
3585 | Surface *surface; | 3584 | Surface *surface; | ||
3586 | XdgShellSurface *shellSurface; | 3585 | XdgShellSurface *shellSurface; | ||
3587 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3586 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3588 | QVERIFY(client); | 3587 | QVERIFY(client); | ||
3589 | 3588 | | |||
3590 | // Initially, the client should be kept below. | 3589 | // Initially, the client should be kept below. | ||
3591 | QVERIFY(client->keepBelow()); | 3590 | QVERIFY(client->keepBelow()); | ||
3592 | 3591 | | |||
Show All 29 Lines | 3613 | { | |||
3622 | group.writeEntry("wmclasscomplete", false); | 3621 | group.writeEntry("wmclasscomplete", false); | ||
3623 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3622 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3624 | group.sync(); | 3623 | group.sync(); | ||
3625 | RuleBook::self()->setConfig(config); | 3624 | RuleBook::self()->setConfig(config); | ||
3626 | workspace()->slotReconfigure(); | 3625 | workspace()->slotReconfigure(); | ||
3627 | 3626 | | |||
3628 | // Create the test client. | 3627 | // Create the test client. | ||
3629 | QFETCH(Test::XdgShellSurfaceType, type); | 3628 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3630 | XdgShellClient *client; | 3629 | AbstractClient *client; | ||
3631 | Surface *surface; | 3630 | Surface *surface; | ||
3632 | XdgShellSurface *shellSurface; | 3631 | XdgShellSurface *shellSurface; | ||
3633 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3632 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3634 | QVERIFY(client); | 3633 | QVERIFY(client); | ||
3635 | 3634 | | |||
3636 | // Initially, the client should be kept below. | 3635 | // Initially, the client should be kept below. | ||
3637 | QVERIFY(client->keepBelow()); | 3636 | QVERIFY(client->keepBelow()); | ||
3638 | 3637 | | |||
Show All 29 Lines | 3659 | { | |||
3668 | group.writeEntry("wmclasscomplete", false); | 3667 | group.writeEntry("wmclasscomplete", false); | ||
3669 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3668 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3670 | group.sync(); | 3669 | group.sync(); | ||
3671 | RuleBook::self()->setConfig(config); | 3670 | RuleBook::self()->setConfig(config); | ||
3672 | workspace()->slotReconfigure(); | 3671 | workspace()->slotReconfigure(); | ||
3673 | 3672 | | |||
3674 | // Create the test client. | 3673 | // Create the test client. | ||
3675 | QFETCH(Test::XdgShellSurfaceType, type); | 3674 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3676 | XdgShellClient *client; | 3675 | AbstractClient *client; | ||
3677 | Surface *surface; | 3676 | Surface *surface; | ||
3678 | XdgShellSurface *shellSurface; | 3677 | XdgShellSurface *shellSurface; | ||
3679 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3678 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3680 | QVERIFY(client); | 3679 | QVERIFY(client); | ||
3681 | 3680 | | |||
3682 | // Initially, the client should be kept below. | 3681 | // Initially, the client should be kept below. | ||
3683 | QVERIFY(client->keepBelow()); | 3682 | QVERIFY(client->keepBelow()); | ||
3684 | 3683 | | |||
Show All 16 Lines | |||||
3701 | } | 3700 | } | ||
3702 | 3701 | | |||
3703 | TEST_DATA(testKeepBelowApplyNow) | 3702 | TEST_DATA(testKeepBelowApplyNow) | ||
3704 | 3703 | | |||
3705 | void TestXdgShellClientRules::testKeepBelowApplyNow() | 3704 | void TestXdgShellClientRules::testKeepBelowApplyNow() | ||
3706 | { | 3705 | { | ||
3707 | // Create the test client. | 3706 | // Create the test client. | ||
3708 | QFETCH(Test::XdgShellSurfaceType, type); | 3707 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3709 | XdgShellClient *client; | 3708 | AbstractClient *client; | ||
3710 | Surface *surface; | 3709 | Surface *surface; | ||
3711 | XdgShellSurface *shellSurface; | 3710 | XdgShellSurface *shellSurface; | ||
3712 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3711 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3713 | QVERIFY(client); | 3712 | QVERIFY(client); | ||
3714 | QVERIFY(!client->keepBelow()); | 3713 | QVERIFY(!client->keepBelow()); | ||
3715 | 3714 | | |||
3716 | // Initialize RuleBook with the test rule. | 3715 | // Initialize RuleBook with the test rule. | ||
3717 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 3716 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
Show All 39 Lines | 3748 | { | |||
3757 | group.writeEntry("wmclasscomplete", false); | 3756 | group.writeEntry("wmclasscomplete", false); | ||
3758 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3757 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3759 | group.sync(); | 3758 | group.sync(); | ||
3760 | RuleBook::self()->setConfig(config); | 3759 | RuleBook::self()->setConfig(config); | ||
3761 | workspace()->slotReconfigure(); | 3760 | workspace()->slotReconfigure(); | ||
3762 | 3761 | | |||
3763 | // Create the test client. | 3762 | // Create the test client. | ||
3764 | QFETCH(Test::XdgShellSurfaceType, type); | 3763 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3765 | XdgShellClient *client; | 3764 | AbstractClient *client; | ||
3766 | Surface *surface; | 3765 | Surface *surface; | ||
3767 | XdgShellSurface *shellSurface; | 3766 | XdgShellSurface *shellSurface; | ||
3768 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3767 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3769 | QVERIFY(client); | 3768 | QVERIFY(client); | ||
3770 | 3769 | | |||
3771 | // Initially, the client should be kept below. | 3770 | // Initially, the client should be kept below. | ||
3772 | QVERIFY(client->keepBelow()); | 3771 | QVERIFY(client->keepBelow()); | ||
3773 | 3772 | | |||
Show All 35 Lines | 3800 | { | |||
3809 | group.writeEntry("wmclasscomplete", false); | 3808 | group.writeEntry("wmclasscomplete", false); | ||
3810 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3809 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3811 | group.sync(); | 3810 | group.sync(); | ||
3812 | RuleBook::self()->setConfig(config); | 3811 | RuleBook::self()->setConfig(config); | ||
3813 | workspace()->slotReconfigure(); | 3812 | workspace()->slotReconfigure(); | ||
3814 | 3813 | | |||
3815 | // Create the test client. | 3814 | // Create the test client. | ||
3816 | QFETCH(Test::XdgShellSurfaceType, type); | 3815 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3817 | XdgShellClient *client; | 3816 | AbstractClient *client; | ||
3818 | Surface *surface; | 3817 | Surface *surface; | ||
3819 | XdgShellSurface *shellSurface; | 3818 | XdgShellSurface *shellSurface; | ||
3820 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3819 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3821 | QVERIFY(client); | 3820 | QVERIFY(client); | ||
3822 | QCOMPARE(client->shortcut(), QKeySequence()); | 3821 | QCOMPARE(client->shortcut(), QKeySequence()); | ||
3823 | client->minimize(); | 3822 | client->minimize(); | ||
3824 | QVERIFY(client->isMinimized()); | 3823 | QVERIFY(client->isMinimized()); | ||
3825 | 3824 | | |||
Show All 30 Lines | 3847 | { | |||
3856 | group.writeEntry("wmclasscomplete", false); | 3855 | group.writeEntry("wmclasscomplete", false); | ||
3857 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3856 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3858 | group.sync(); | 3857 | group.sync(); | ||
3859 | RuleBook::self()->setConfig(config); | 3858 | RuleBook::self()->setConfig(config); | ||
3860 | workspace()->slotReconfigure(); | 3859 | workspace()->slotReconfigure(); | ||
3861 | 3860 | | |||
3862 | // Create the test client. | 3861 | // Create the test client. | ||
3863 | QFETCH(Test::XdgShellSurfaceType, type); | 3862 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3864 | XdgShellClient *client; | 3863 | AbstractClient *client; | ||
3865 | Surface *surface; | 3864 | Surface *surface; | ||
3866 | XdgShellSurface *shellSurface; | 3865 | XdgShellSurface *shellSurface; | ||
3867 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3866 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3868 | QVERIFY(client); | 3867 | QVERIFY(client); | ||
3869 | 3868 | | |||
3870 | // If we press the window shortcut, the window should be brought back to user. | 3869 | // If we press the window shortcut, the window should be brought back to user. | ||
3871 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | 3870 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | ||
3872 | QVERIFY(clientUnminimizedSpy.isValid()); | 3871 | QVERIFY(clientUnminimizedSpy.isValid()); | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 3930 | { | |||
3941 | group.writeEntry("wmclasscomplete", false); | 3940 | group.writeEntry("wmclasscomplete", false); | ||
3942 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 3941 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
3943 | group.sync(); | 3942 | group.sync(); | ||
3944 | RuleBook::self()->setConfig(config); | 3943 | RuleBook::self()->setConfig(config); | ||
3945 | workspace()->slotReconfigure(); | 3944 | workspace()->slotReconfigure(); | ||
3946 | 3945 | | |||
3947 | // Create the test client. | 3946 | // Create the test client. | ||
3948 | QFETCH(Test::XdgShellSurfaceType, type); | 3947 | QFETCH(Test::XdgShellSurfaceType, type); | ||
3949 | XdgShellClient *client; | 3948 | AbstractClient *client; | ||
3950 | Surface *surface; | 3949 | Surface *surface; | ||
3951 | XdgShellSurface *shellSurface; | 3950 | XdgShellSurface *shellSurface; | ||
3952 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3951 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3953 | QVERIFY(client); | 3952 | QVERIFY(client); | ||
3954 | 3953 | | |||
3955 | // If we press the window shortcut, the window should be brought back to user. | 3954 | // If we press the window shortcut, the window should be brought back to user. | ||
3956 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | 3955 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | ||
3957 | QVERIFY(clientUnminimizedSpy.isValid()); | 3956 | QVERIFY(clientUnminimizedSpy.isValid()); | ||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 4003 | { | |||
4014 | group.writeEntry("wmclasscomplete", false); | 4013 | group.writeEntry("wmclasscomplete", false); | ||
4015 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4014 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4016 | group.sync(); | 4015 | group.sync(); | ||
4017 | RuleBook::self()->setConfig(config); | 4016 | RuleBook::self()->setConfig(config); | ||
4018 | workspace()->slotReconfigure(); | 4017 | workspace()->slotReconfigure(); | ||
4019 | 4018 | | |||
4020 | // Create the test client. | 4019 | // Create the test client. | ||
4021 | QFETCH(Test::XdgShellSurfaceType, type); | 4020 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4022 | XdgShellClient *client; | 4021 | AbstractClient *client; | ||
4023 | Surface *surface; | 4022 | Surface *surface; | ||
4024 | XdgShellSurface *shellSurface; | 4023 | XdgShellSurface *shellSurface; | ||
4025 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4024 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4026 | QVERIFY(client); | 4025 | QVERIFY(client); | ||
4027 | 4026 | | |||
4028 | // If we press the window shortcut, the window should be brought back to user. | 4027 | // If we press the window shortcut, the window should be brought back to user. | ||
4029 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | 4028 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | ||
4030 | QVERIFY(clientUnminimizedSpy.isValid()); | 4029 | QVERIFY(clientUnminimizedSpy.isValid()); | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
4072 | } | 4071 | } | ||
4073 | 4072 | | |||
4074 | TEST_DATA(testShortcutApplyNow) | 4073 | TEST_DATA(testShortcutApplyNow) | ||
4075 | 4074 | | |||
4076 | void TestXdgShellClientRules::testShortcutApplyNow() | 4075 | void TestXdgShellClientRules::testShortcutApplyNow() | ||
4077 | { | 4076 | { | ||
4078 | // Create the test client. | 4077 | // Create the test client. | ||
4079 | QFETCH(Test::XdgShellSurfaceType, type); | 4078 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4080 | XdgShellClient *client; | 4079 | AbstractClient *client; | ||
4081 | Surface *surface; | 4080 | Surface *surface; | ||
4082 | XdgShellSurface *shellSurface; | 4081 | XdgShellSurface *shellSurface; | ||
4083 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4082 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4084 | QVERIFY(client); | 4083 | QVERIFY(client); | ||
4085 | QVERIFY(client->shortcut().isEmpty()); | 4084 | QVERIFY(client->shortcut().isEmpty()); | ||
4086 | 4085 | | |||
4087 | // Initialize RuleBook with the test rule. | 4086 | // Initialize RuleBook with the test rule. | ||
4088 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 4087 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 4142 | { | |||
4153 | group.writeEntry("wmclasscomplete", false); | 4152 | group.writeEntry("wmclasscomplete", false); | ||
4154 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4153 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4155 | group.sync(); | 4154 | group.sync(); | ||
4156 | RuleBook::self()->setConfig(config); | 4155 | RuleBook::self()->setConfig(config); | ||
4157 | workspace()->slotReconfigure(); | 4156 | workspace()->slotReconfigure(); | ||
4158 | 4157 | | |||
4159 | // Create the test client. | 4158 | // Create the test client. | ||
4160 | QFETCH(Test::XdgShellSurfaceType, type); | 4159 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4161 | XdgShellClient *client; | 4160 | AbstractClient *client; | ||
4162 | Surface *surface; | 4161 | Surface *surface; | ||
4163 | XdgShellSurface *shellSurface; | 4162 | XdgShellSurface *shellSurface; | ||
4164 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4163 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4165 | QVERIFY(client); | 4164 | QVERIFY(client); | ||
4166 | 4165 | | |||
4167 | // If we press the window shortcut, the window should be brought back to user. | 4166 | // If we press the window shortcut, the window should be brought back to user. | ||
4168 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | 4167 | QSignalSpy clientUnminimizedSpy(client, &AbstractClient::clientUnminimized); | ||
4169 | QVERIFY(clientUnminimizedSpy.isValid()); | 4168 | QVERIFY(clientUnminimizedSpy.isValid()); | ||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | 4273 | { | |||
4282 | group.writeEntry("wmclasscomplete", false); | 4281 | group.writeEntry("wmclasscomplete", false); | ||
4283 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4282 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4284 | group.sync(); | 4283 | group.sync(); | ||
4285 | RuleBook::self()->setConfig(config); | 4284 | RuleBook::self()->setConfig(config); | ||
4286 | workspace()->slotReconfigure(); | 4285 | workspace()->slotReconfigure(); | ||
4287 | 4286 | | |||
4288 | // Create the test client. | 4287 | // Create the test client. | ||
4289 | QFETCH(Test::XdgShellSurfaceType, type); | 4288 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4290 | XdgShellClient *client; | 4289 | AbstractClient *client; | ||
4291 | Surface *surface; | 4290 | Surface *surface; | ||
4292 | XdgShellSurface *shellSurface; | 4291 | XdgShellSurface *shellSurface; | ||
4293 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4292 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4294 | QVERIFY(client); | 4293 | QVERIFY(client); | ||
4295 | QVERIFY(client->isActive()); | 4294 | QVERIFY(client->isActive()); | ||
4296 | 4295 | | |||
4297 | // The opacity should not be affected by the rule. | 4296 | // The opacity should not be affected by the rule. | ||
4298 | QCOMPARE(client->opacity(), 1.0); | 4297 | QCOMPARE(client->opacity(), 1.0); | ||
Show All 18 Lines | 4308 | { | |||
4317 | group.writeEntry("wmclasscomplete", false); | 4316 | group.writeEntry("wmclasscomplete", false); | ||
4318 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4317 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4319 | group.sync(); | 4318 | group.sync(); | ||
4320 | RuleBook::self()->setConfig(config); | 4319 | RuleBook::self()->setConfig(config); | ||
4321 | workspace()->slotReconfigure(); | 4320 | workspace()->slotReconfigure(); | ||
4322 | 4321 | | |||
4323 | // Create the test client. | 4322 | // Create the test client. | ||
4324 | QFETCH(Test::XdgShellSurfaceType, type); | 4323 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4325 | XdgShellClient *client; | 4324 | AbstractClient *client; | ||
4326 | Surface *surface; | 4325 | Surface *surface; | ||
4327 | XdgShellSurface *shellSurface; | 4326 | XdgShellSurface *shellSurface; | ||
4328 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4327 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4329 | QVERIFY(client); | 4328 | QVERIFY(client); | ||
4330 | QVERIFY(client->isActive()); | 4329 | QVERIFY(client->isActive()); | ||
4331 | QCOMPARE(client->opacity(), 0.9); | 4330 | QCOMPARE(client->opacity(), 0.9); | ||
4332 | 4331 | | |||
4333 | // Destroy the client. | 4332 | // Destroy the client. | ||
Show All 16 Lines | 4341 | { | |||
4350 | group.writeEntry("wmclasscomplete", false); | 4349 | group.writeEntry("wmclasscomplete", false); | ||
4351 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4350 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4352 | group.sync(); | 4351 | group.sync(); | ||
4353 | RuleBook::self()->setConfig(config); | 4352 | RuleBook::self()->setConfig(config); | ||
4354 | workspace()->slotReconfigure(); | 4353 | workspace()->slotReconfigure(); | ||
4355 | 4354 | | |||
4356 | // Create the test client. | 4355 | // Create the test client. | ||
4357 | QFETCH(Test::XdgShellSurfaceType, type); | 4356 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4358 | XdgShellClient *client; | 4357 | AbstractClient *client; | ||
4359 | Surface *surface; | 4358 | Surface *surface; | ||
4360 | XdgShellSurface *shellSurface; | 4359 | XdgShellSurface *shellSurface; | ||
4361 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4360 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4362 | QVERIFY(client); | 4361 | QVERIFY(client); | ||
4363 | QVERIFY(client->isActive()); | 4362 | QVERIFY(client->isActive()); | ||
4364 | QCOMPARE(client->opacity(), 0.9); | 4363 | QCOMPARE(client->opacity(), 0.9); | ||
4365 | 4364 | | |||
4366 | // The rule should be discarded when the client is closed. | 4365 | // The rule should be discarded when the client is closed. | ||
Show All 25 Lines | 4383 | { | |||
4392 | group.writeEntry("wmclasscomplete", false); | 4391 | group.writeEntry("wmclasscomplete", false); | ||
4393 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4392 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4394 | group.sync(); | 4393 | group.sync(); | ||
4395 | RuleBook::self()->setConfig(config); | 4394 | RuleBook::self()->setConfig(config); | ||
4396 | workspace()->slotReconfigure(); | 4395 | workspace()->slotReconfigure(); | ||
4397 | 4396 | | |||
4398 | // Create the test client. | 4397 | // Create the test client. | ||
4399 | QFETCH(Test::XdgShellSurfaceType, type); | 4398 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4400 | XdgShellClient *client; | 4399 | AbstractClient *client; | ||
4401 | Surface *surface; | 4400 | Surface *surface; | ||
4402 | XdgShellSurface *shellSurface; | 4401 | XdgShellSurface *shellSurface; | ||
4403 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4402 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4404 | QVERIFY(client); | 4403 | QVERIFY(client); | ||
4405 | QVERIFY(client->isActive()); | 4404 | QVERIFY(client->isActive()); | ||
4406 | 4405 | | |||
4407 | // Make the client inactive. | 4406 | // Make the client inactive. | ||
4408 | workspace()->setActiveClient(nullptr); | 4407 | workspace()->setActiveClient(nullptr); | ||
Show All 22 Lines | 4422 | { | |||
4431 | group.writeEntry("wmclasscomplete", false); | 4430 | group.writeEntry("wmclasscomplete", false); | ||
4432 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4431 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4433 | group.sync(); | 4432 | group.sync(); | ||
4434 | RuleBook::self()->setConfig(config); | 4433 | RuleBook::self()->setConfig(config); | ||
4435 | workspace()->slotReconfigure(); | 4434 | workspace()->slotReconfigure(); | ||
4436 | 4435 | | |||
4437 | // Create the test client. | 4436 | // Create the test client. | ||
4438 | QFETCH(Test::XdgShellSurfaceType, type); | 4437 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4439 | XdgShellClient *client; | 4438 | AbstractClient *client; | ||
4440 | Surface *surface; | 4439 | Surface *surface; | ||
4441 | XdgShellSurface *shellSurface; | 4440 | XdgShellSurface *shellSurface; | ||
4442 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4441 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4443 | QVERIFY(client); | 4442 | QVERIFY(client); | ||
4444 | QVERIFY(client->isActive()); | 4443 | QVERIFY(client->isActive()); | ||
4445 | QCOMPARE(client->opacity(), 1.0); | 4444 | QCOMPARE(client->opacity(), 1.0); | ||
4446 | 4445 | | |||
4447 | // Make the client inactive. | 4446 | // Make the client inactive. | ||
Show All 23 Lines | 4462 | { | |||
4471 | group.writeEntry("wmclasscomplete", false); | 4470 | group.writeEntry("wmclasscomplete", false); | ||
4472 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 4471 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
4473 | group.sync(); | 4472 | group.sync(); | ||
4474 | RuleBook::self()->setConfig(config); | 4473 | RuleBook::self()->setConfig(config); | ||
4475 | workspace()->slotReconfigure(); | 4474 | workspace()->slotReconfigure(); | ||
4476 | 4475 | | |||
4477 | // Create the test client. | 4476 | // Create the test client. | ||
4478 | QFETCH(Test::XdgShellSurfaceType, type); | 4477 | QFETCH(Test::XdgShellSurfaceType, type); | ||
4479 | XdgShellClient *client; | 4478 | AbstractClient *client; | ||
4480 | Surface *surface; | 4479 | Surface *surface; | ||
4481 | XdgShellSurface *shellSurface; | 4480 | XdgShellSurface *shellSurface; | ||
4482 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4481 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4483 | QVERIFY(client); | 4482 | QVERIFY(client); | ||
4484 | QVERIFY(client->isActive()); | 4483 | QVERIFY(client->isActive()); | ||
4485 | QCOMPARE(client->opacity(), 1.0); | 4484 | QCOMPARE(client->opacity(), 1.0); | ||
4486 | 4485 | | |||
4487 | // Make the client inactive. | 4486 | // Make the client inactive. | ||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |