Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/pointer_constraints_test.cpp
| Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Line(s) | 138 | { | |||
|---|---|---|---|---|---|
| 188 | 188 | | |||
| 189 | // modifier + click should be ignored | 189 | // modifier + click should be ignored | ||
| 190 | // first ensure the settings are ok | 190 | // first ensure the settings are ok | ||
| 191 | KConfigGroup group = kwinApp()->config()->group("MouseBindings"); | 191 | KConfigGroup group = kwinApp()->config()->group("MouseBindings"); | ||
| 192 | group.writeEntry("CommandAllKey", QStringLiteral("Alt")); | 192 | group.writeEntry("CommandAllKey", QStringLiteral("Alt")); | ||
| 193 | group.writeEntry("CommandAll1", "Move"); | 193 | group.writeEntry("CommandAll1", "Move"); | ||
| 194 | group.writeEntry("CommandAll2", "Move"); | 194 | group.writeEntry("CommandAll2", "Move"); | ||
| 195 | group.writeEntry("CommandAll3", "Move"); | 195 | group.writeEntry("CommandAll3", "Move"); | ||
| 196 | group.writeEntry("CommandAllWheel", "change opacity"); | ||||
| 196 | group.sync(); | 197 | group.sync(); | ||
| 197 | workspace()->slotReconfigure(); | 198 | workspace()->slotReconfigure(); | ||
| 198 | QCOMPARE(options->commandAllModifier(), Qt::AltModifier); | 199 | QCOMPARE(options->commandAllModifier(), Qt::AltModifier); | ||
| 199 | QCOMPARE(options->commandAll1(), Options::MouseUnrestrictedMove); | 200 | QCOMPARE(options->commandAll1(), Options::MouseUnrestrictedMove); | ||
| 200 | QCOMPARE(options->commandAll2(), Options::MouseUnrestrictedMove); | 201 | QCOMPARE(options->commandAll2(), Options::MouseUnrestrictedMove); | ||
| 201 | QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove); | 202 | QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove); | ||
| 202 | 203 | | |||
| 203 | quint32 timestamp = 1; | 204 | quint32 timestamp = 1; | ||
| 204 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++); | 205 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++); | ||
| 205 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | 206 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | ||
| 206 | QVERIFY(!c->isMove()); | 207 | QVERIFY(!c->isMove()); | ||
| 207 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | 208 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | ||
| 209 | | ||||
| 210 | // set the opacity to 0.5 | ||||
| 211 | c->setOpacity(0.5); | ||||
| 212 | QCOMPARE(c->opacity(), 0.5); | ||||
| 213 | | ||||
| 214 | // pointer is confined so shortcut should not work | ||||
| 215 | kwinApp()->platform()->pointerAxisVertical(-5, timestamp++); | ||||
| 216 | QCOMPARE(c->opacity(), 0.5); | ||||
| 217 | kwinApp()->platform()->pointerAxisVertical(5, timestamp++); | ||||
| 218 | QCOMPARE(c->opacity(), 0.5); | ||||
| 219 | | ||||
| 208 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++); | 220 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++); | ||
| 209 | 221 | | |||
| 210 | // deactivate the client, this should unconfine | 222 | // deactivate the client, this should unconfine | ||
| 211 | workspace()->activateClient(nullptr); | 223 | workspace()->activateClient(nullptr); | ||
| 212 | QVERIFY(unconfinedSpy.wait()); | 224 | QVERIFY(unconfinedSpy.wait()); | ||
| 213 | QCOMPARE(input()->pointer()->isConstrained(), false); | 225 | QCOMPARE(input()->pointer()->isConstrained(), false); | ||
| 214 | 226 | | |||
| 215 | // reconfine pointer (this time with persistent life time) | 227 | // reconfine pointer (this time with persistent life time) | ||
| ▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines | |||||