From 5dc942ac5e3611ae7db8f2902bb092b66920edeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 21 Jan 2017 20:13:09 +0100 Subject: [PATCH] [autotests] Add test case for modifier only trigger when capslock enabled This extends the testCapsLock to ensure that modifier only shortcut trigger when capslock is enabled. So far the test only ensured that capslock doesn't trigger the shift modifier only shortcut. As the test shows currently when capslock is on, the meta key doesn't trigger any more. This test case goes into Plasma/5.9 branch and not in Plasma/5.8 as a fix will most likely need the new xkbcommon 0.7 code paths which we do not have in Plasma/5.8. CCBUG: 375355 --- .../integration/modifier_only_shortcut_test.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/autotests/integration/modifier_only_shortcut_test.cpp b/autotests/integration/modifier_only_shortcut_test.cpp index 68feb70ac1..a192db7cdc 100644 --- a/autotests/integration/modifier_only_shortcut_test.cpp +++ b/autotests/integration/modifier_only_shortcut_test.cpp @@ -283,11 +283,26 @@ void ModifierOnlyShortcutTest::testCapsLock() QCOMPARE(input()->keyboardModifiers(), Qt::ShiftModifier); QCOMPARE(triggeredSpy.count(), 1); + // meta on the other hand should trigger + group.writeEntry("Meta", QStringList{s_serviceName, s_path, s_serviceName, QStringLiteral("shortcut")}); + group.writeEntry("Alt", QStringList()); + group.writeEntry("Shift", QStringList{}); + group.writeEntry("Control", QStringList()); + group.sync(); + workspace()->slotReconfigure(); + kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++); + QCOMPARE(input()->keyboardModifiers(), Qt::ShiftModifier | Qt::MetaModifier); + QCOMPARE(input()->modifiersRelevantForGlobalShortcuts(), Qt::MetaModifier); + kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++); + QEXPECT_FAIL("", "BUG 375355", Continue); + QCOMPARE(triggeredSpy.count(), 2); + // release caps lock kwinApp()->platform()->keyboardKeyPressed(KEY_CAPSLOCK, timestamp++); kwinApp()->platform()->keyboardKeyReleased(KEY_CAPSLOCK, timestamp++); QCOMPARE(input()->keyboardModifiers(), Qt::NoModifier); - QCOMPARE(triggeredSpy.count(), 1); + QEXPECT_FAIL("", "BUG 375355", Continue); + QCOMPARE(triggeredSpy.count(), 2); } void ModifierOnlyShortcutTest::testGlobalShortcutsDisabled_data()