@@ -134,40 +134,31 @@ Item {
134134 compare(screenshotSpy.count, 1);
135135 }
136136
137− function test_altIsDispatchedOnRelease() {
138− // Press alt, make sure it does *not* end up in inputCatcher (aka, the focused app)
137+ function test_altIsCancelledOnAltTab() {
138+ // Press alt, make sure it does end up in inputCatcher (aka, the focused app)
139+ inputCatcher.pressedKeys = [];
139140 keyPress(Qt.Key_Alt, Qt.NoModifier)
140− compare(inputCatcher.pressedKeys.length, 0);
141− // Now release alt. It should cause the previous Alt press to be dispatched along with the release
142− keyRelease(Qt.Key_Alt, Qt.NoModifier);
143141 compare(inputCatcher.pressedKeys.length, 1);
144142 compare(inputCatcher.pressedKeys[0], Qt.Key_Alt);
143+ // Now also press tab. As this should trigger the spread, alt needs to be released for the app
144+ keyPress(Qt.Key_Tab, Qt.NoModifier)
145145 compare(inputCatcher.releasedKeys.length, 1);
146146 compare(inputCatcher.releasedKeys[0], Qt.Key_Alt);
147− }
148−
149− function test_altIsNotDispatchedOnAltTab() {
150− // Press alt, make sure it does *not* end up in inputCatcher (aka, the focused app)
151− inputCatcher.pressedKeys = [];
152− keyPress(Qt.Key_Alt, Qt.NoModifier)
153− compare(inputCatcher.pressedKeys.length, 0);
154− // Now also press tab. As this should trigger the spread, neither of them should end up in the app
155− keyPress(Qt.Key_Tab, Qt.NoModifier)
156− compare(inputCatcher.pressedKeys.length, 0);
157147
158− // Also the release events should not be dispatched to the app
148+ // Now release the keys, none of that should get to the app any more
159149 keyRelease(Qt.Key_Tab, Qt.NoModifier);
160150 keyRelease(Qt.Key_Alt, Qt.NoModifier);
161− compare(inputCatcher.pressedKeys.length, 0);
162− compare(inputCatcher.releasedKeys.length, 0);
151+ compare(inputCatcher.pressedKeys.length, 1);
152+ compare(inputCatcher.releasedKeys.length, 1);
163153 }
164154
165155 function test_altComboIsDispatched() {
166156 inputCatcher.pressedKeys = [];
167− // Press alt, make sure it does *not* yet end up in inputCatcher (aka, the focused app)
157+ // Press alt, make sure it does end up in inputCatcher (aka, the focused app)
168158 keyPress(Qt.Key_Alt, Qt.NoModifier)
169− compare(inputCatcher.pressedKeys.length, 0);
170− // Now press F in order to opening the File menu (Alt+F), now the app should get the full combo
159+ compare(inputCatcher.pressedKeys.length, 1);
160+ compare(inputCatcher.pressedKeys[0], Qt.Key_Alt);
161+ // Now press F in order to opening the File menu (Alt+F), make sure it is dispatched too
171162 keyPress(Qt.Key_F, Qt.NoModifier)
172163 compare(inputCatcher.pressedKeys.length, 2);
173164 compare(inputCatcher.pressedKeys[0], Qt.Key_Alt);