Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/globalshortcuts_test.cpp
Show First 20 Lines • Show All 168 Lines • ▼ Show 20 Line(s) | 147 | { | |||
---|---|---|---|---|---|
169 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++); | 169 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++); | ||
170 | } | 170 | } | ||
171 | 171 | | |||
172 | void GlobalShortcutsTest::testMetaShiftW() | 172 | void GlobalShortcutsTest::testMetaShiftW() | ||
173 | { | 173 | { | ||
174 | // BUG 370341 | 174 | // BUG 370341 | ||
175 | QScopedPointer<QAction> action(new QAction(nullptr)); | 175 | QScopedPointer<QAction> action(new QAction(nullptr)); | ||
176 | action->setProperty("componentName", QStringLiteral(KWIN_NAME)); | 176 | action->setProperty("componentName", QStringLiteral(KWIN_NAME)); | ||
177 | action->setObjectName(QStringLiteral("globalshortcuts-test-consumed-shift")); | 177 | action->setObjectName(QStringLiteral("globalshortcuts-test-meta-shift-w")); | ||
178 | QSignalSpy triggeredSpy(action.data(), &QAction::triggered); | 178 | QSignalSpy triggeredSpy(action.data(), &QAction::triggered); | ||
179 | QVERIFY(triggeredSpy.isValid()); | 179 | QVERIFY(triggeredSpy.isValid()); | ||
180 | KGlobalAccel::self()->setShortcut(action.data(), QList<QKeySequence>{Qt::META + Qt::SHIFT + Qt::Key_W}, KGlobalAccel::NoAutoloading); | 180 | KGlobalAccel::self()->setShortcut(action.data(), QList<QKeySequence>{Qt::META + Qt::SHIFT + Qt::Key_W}, KGlobalAccel::NoAutoloading); | ||
181 | input()->registerShortcut(Qt::META + Qt::SHIFT + Qt::Key_W, action.data()); | 181 | input()->registerShortcut(Qt::META + Qt::SHIFT + Qt::Key_W, action.data()); | ||
182 | 182 | | |||
183 | // press meta+shift+w | 183 | // press meta+shift+w | ||
184 | quint32 timestamp = 0; | 184 | quint32 timestamp = 0; | ||
185 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++); | 185 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++); | ||
186 | QCOMPARE(input()->keyboardModifiers(), Qt::MetaModifier); | 186 | QCOMPARE(input()->keyboardModifiers(), Qt::MetaModifier); | ||
187 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTSHIFT, timestamp++); | 187 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTSHIFT, timestamp++); | ||
188 | QCOMPARE(input()->keyboardModifiers(), Qt::ShiftModifier | Qt::MetaModifier); | 188 | QCOMPARE(input()->keyboardModifiers(), Qt::ShiftModifier | Qt::MetaModifier); | ||
189 | kwinApp()->platform()->keyboardKeyPressed(KEY_W, timestamp++); | 189 | kwinApp()->platform()->keyboardKeyPressed(KEY_W, timestamp++); | ||
190 | QEXPECT_FAIL("", "BUG 370341", Continue); | | |||
191 | QTRY_COMPARE(triggeredSpy.count(), 1); | 190 | QTRY_COMPARE(triggeredSpy.count(), 1); | ||
192 | kwinApp()->platform()->keyboardKeyReleased(KEY_W, timestamp++); | 191 | kwinApp()->platform()->keyboardKeyReleased(KEY_W, timestamp++); | ||
193 | 192 | | |||
194 | // release meta+shift | 193 | // release meta+shift | ||
195 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTSHIFT, timestamp++); | 194 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTSHIFT, timestamp++); | ||
196 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++); | 195 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++); | ||
197 | } | 196 | } | ||
198 | 197 | | |||
199 | WAYLANDTEST_MAIN(GlobalShortcutsTest) | 198 | WAYLANDTEST_MAIN(GlobalShortcutsTest) | ||
200 | #include "globalshortcuts_test.moc" | 199 | #include "globalshortcuts_test.moc" |