Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/pointer_constraints_test.cpp
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Line(s) | 138 | { | |||
---|---|---|---|---|---|
181 | QCOMPARE(pointerPositionChangedSpy.count(), 1); | 181 | QCOMPARE(pointerPositionChangedSpy.count(), 1); | ||
182 | QCOMPARE(KWin::Cursor::pos(), position); | 182 | QCOMPARE(KWin::Cursor::pos(), position); | ||
183 | // moving one to bottom should not be possible | 183 | // moving one to bottom should not be possible | ||
184 | QFETCH(int, yOffset); | 184 | QFETCH(int, yOffset); | ||
185 | KWin::Cursor::setPos(position + QPoint(0, yOffset)); | 185 | KWin::Cursor::setPos(position + QPoint(0, yOffset)); | ||
186 | QCOMPARE(pointerPositionChangedSpy.count(), 1); | 186 | QCOMPARE(pointerPositionChangedSpy.count(), 1); | ||
187 | QCOMPARE(KWin::Cursor::pos(), position); | 187 | QCOMPARE(KWin::Cursor::pos(), position); | ||
188 | 188 | | |||
189 | // modifier + click should be ignored | ||||
190 | // first ensure the settings are ok | ||||
191 | KConfigGroup group = kwinApp()->config()->group("MouseBindings"); | ||||
192 | group.writeEntry("CommandAllKey", QStringLiteral("Alt")); | ||||
193 | group.writeEntry("CommandAll1", "Move"); | ||||
194 | group.writeEntry("CommandAll2", "Move"); | ||||
195 | group.writeEntry("CommandAll3", "Move"); | ||||
196 | group.sync(); | ||||
197 | workspace()->slotReconfigure(); | ||||
198 | QCOMPARE(options->commandAllModifier(), Qt::AltModifier); | ||||
199 | QCOMPARE(options->commandAll1(), Options::MouseUnrestrictedMove); | ||||
200 | QCOMPARE(options->commandAll2(), Options::MouseUnrestrictedMove); | ||||
201 | QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove); | ||||
202 | | ||||
203 | quint32 timestamp = 1; | ||||
204 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++); | ||||
205 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | ||||
206 | QVERIFY(!c->isMove()); | ||||
207 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | ||||
208 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++); | ||||
209 | | ||||
189 | // deactivate the client, this should unconfine | 210 | // deactivate the client, this should unconfine | ||
190 | workspace()->activateClient(nullptr); | 211 | workspace()->activateClient(nullptr); | ||
191 | QVERIFY(unconfinedSpy.wait()); | 212 | QVERIFY(unconfinedSpy.wait()); | ||
192 | QCOMPARE(input()->pointer()->isConstrained(), false); | 213 | QCOMPARE(input()->pointer()->isConstrained(), false); | ||
193 | 214 | | |||
194 | // reconfine pointer (this time with persistent life time) | 215 | // reconfine pointer (this time with persistent life time) | ||
195 | confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.data(), pointer.data(), nullptr, PointerConstraints::LifeTime::Persistent)); | 216 | confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.data(), pointer.data(), nullptr, PointerConstraints::LifeTime::Persistent)); | ||
196 | QSignalSpy confinedSpy2(confinedPointer.data(), &ConfinedPointer::confined); | 217 | QSignalSpy confinedSpy2(confinedPointer.data(), &ConfinedPointer::confined); | ||
▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines |