Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/keyboard_layout_test.cpp
Show First 20 Lines • Show All 456 Lines • ▼ Show 20 Line(s) | 401 | { | |||
---|---|---|---|---|---|
457 | QVERIFY(Test::waitForWindowDestroyed(c2)); | 457 | QVERIFY(Test::waitForWindowDestroyed(c2)); | ||
458 | QVERIFY(!layoutChangedSpy.wait()); | 458 | QVERIFY(!layoutChangedSpy.wait()); | ||
459 | QTRY_COMPARE(xkb->layoutName(), QStringLiteral("German (Neo 2)")); | 459 | QTRY_COMPARE(xkb->layoutName(), QStringLiteral("German (Neo 2)")); | ||
460 | } | 460 | } | ||
461 | 461 | | |||
462 | void KeyboardLayoutTest::testNumLock() | 462 | void KeyboardLayoutTest::testNumLock() | ||
463 | { | 463 | { | ||
464 | qputenv("KWIN_FORCE_NUM_LOCK_EVALUATION", "1"); | 464 | qputenv("KWIN_FORCE_NUM_LOCK_EVALUATION", "1"); | ||
465 | KConfigGroup layoutGroup = kwinApp()->kxkbConfig()->group("Layout"); | ||||
466 | layoutGroup.writeEntry("LayoutList", QStringLiteral("us")); | ||||
467 | layoutGroup.sync(); | ||||
468 | reconfigureLayouts(); | ||||
469 | | ||||
465 | auto xkb = input()->keyboard()->xkb(); | 470 | auto xkb = input()->keyboard()->xkb(); | ||
471 | QTRY_COMPARE(xkb->numberOfLayouts(), 1u); | ||||
472 | QTRY_COMPARE(xkb->layoutName(), QStringLiteral("English (US)")); | ||||
473 | | ||||
466 | // by default not set | 474 | // by default not set | ||
467 | QVERIFY(!xkb->modifiers().testFlag(Qt::KeypadModifier)); | 475 | QVERIFY(!xkb->modifiers().testFlag(Qt::KeypadModifier)); | ||
468 | quint32 timestamp = 0; | 476 | quint32 timestamp = 0; | ||
469 | kwinApp()->platform()->keyboardKeyPressed(KEY_NUMLOCK, timestamp++); | 477 | kwinApp()->platform()->keyboardKeyPressed(KEY_NUMLOCK, timestamp++); | ||
470 | kwinApp()->platform()->keyboardKeyReleased(KEY_NUMLOCK, timestamp++); | 478 | kwinApp()->platform()->keyboardKeyReleased(KEY_NUMLOCK, timestamp++); | ||
471 | // now it should be on | 479 | // now it should be on | ||
472 | QVERIFY(xkb->modifiers().testFlag(Qt::KeypadModifier)); | 480 | QVERIFY(xkb->modifiers().testFlag(Qt::KeypadModifier)); | ||
473 | // and back to off | 481 | // and back to off | ||
Show All 31 Lines |