summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2017-01-21 19:13:09 (GMT)
committerMartin Gräßlin <mgraesslin@kde.org>2017-01-22 08:42:00 (GMT)
commit0acfebd96bace0fefd7c4291617f1d07f96ca03e (patch)
treeb68a47e8c2806f299369d50558cfcd3c24dfa702
parentc0be6a45f07b3ca96c7d0c210e2e9159192771db (diff)
[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. CCBUG: 375355
-rw-r--r--autotests/integration/modifier_only_shortcut_test.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/autotests/integration/modifier_only_shortcut_test.cpp b/autotests/integration/modifier_only_shortcut_test.cpp
index 68feb70..1b304d8 100644
--- a/autotests/integration/modifier_only_shortcut_test.cpp
+++ b/autotests/integration/modifier_only_shortcut_test.cpp
@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "kwin_wayland_test.h"
#include "cursor.h"
#include "input.h"
+#include "keyboard_input.h"
#include "platform.h"
#include "screens.h"
#include "wayland_server.h"
@@ -283,11 +284,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()->keyboard()->xkb()->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()